LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 06-23-2017, 03:22 AM   #1
ivid
LQ Newbie
 
Registered: Jun 2017
Posts: 1

Rep: Reputation: Disabled
Error in freeing memory for suspend to disk in linux kernel


When I try to perform hibernation on imx series board,i.e., echo disk > /sys/power/state, kernel gets into infinite loop like Freeing memory .... and so on.
When I added some debug statements to mm/vmscan.c where actually freeing memory(reclaiming pages) takes place in kernel source (linux 4.4), I saw the loop while reclaiming pages at below code.
Code:
if (global_reclaim(sc) &&
		   !reclaimable && zone_reclaimable(zone))
			reclaimable = true;
This issue gets solved by removing the above lines. Similar Issue is seen here https://groups.google.com/forum/#!to...el/kWwlQzj8mhc. And it is solved through a patch removing the offending lines. But it does not explain why the zone reclaimable goes into infinite loop and what causes it?

After some debugging, I found a userspace process in sleeping state and has three threads. This process is in pause state through system_pause()(waiting for some event to occur) and is accessing shared memory(/dev/shm) which is created with 100m size. This shared memory has some semaphore related files.

Also this process has some anonymous private and shared mappings when I saw the output of pmap -d PID and there is no swap space in the system.

Another solution to this hang situation is to remove that userspace process and hibernation works fine. But how can that be a solution since kernel should be able to handle any exception.

So my questions are:

1. How can this sleeping process in pause state cause issue in freeing memory for hibernation?
2. How are the pages reclaimed from sleeping process which is using shared memory in linux?
3. I tried to unmount /dev/shm but was not possible since process was using it. Can we release shared memory by any way? I tried munmap but no use.
4. How removing offending lines actually solves the issue?
5. Is removing the offending lines a correct solution? Will there be any kind of issues by removing the offending lines since it is related to reclaiming pages?

Any info would be helpful.
 
Old 06-23-2017, 11:42 AM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,093

Rep: Reputation: 2301Reputation: 2301Reputation: 2301Reputation: 2301Reputation: 2301Reputation: 2301Reputation: 2301Reputation: 2301Reputation: 2301Reputation: 2301Reputation: 2301
This is a generalised forum. You are better addressing queries to the specific developers who will have the answers if anyone does. Remember most of these are volunteers. To judge by your questions, one would think they were in your employ.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
kernel hangs after freeing memory ashlesha Linux - Software 2 10-31-2006 12:30 PM
Hang after Freeing unused Kernel memory.. junjem0702 Linux - Software 16 01-03-2005 07:12 PM
stops at freeing unused kernel memory rtr Linux - General 1 12-09-2003 10:42 AM
Hang after freeing unused kernel memory darkcloud Linux - General 9 07-07-2003 08:12 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:00 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration