LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 11-17-2020, 02:00 AM   #1
diptendulinux
LQ Newbie
 
Registered: Dec 2019
Posts: 7

Rep: Reputation: Disabled
Getting memory corruption when the device wakes up from sleep.


Hello All,

I am getting memory corruption issue during suspend resume cycle.
Basically I am getting issues like linux crash during wake up process, Kernel page fault, bag page map, squash fs error due to lzo decompression issue, segfaults etc issues when my device is waking up from suspend. The occurrence of the issues are rare but consistent.

I was trying to do few experiments and based on analysis, it looks like those issues are happening due to memory corruption. To confirm that I added 300 msec delay after sys_sync operation in suspend.c before device goes for suspend. On testing, scenario really improved, means I don't see those issues any more.

But here I cant use hard delays due to process utilization constraints. So my query is , is there any way to track sys_sync completion which can be implemented during suspend process?
because sys_sync returns before it actually finished syncing. So there will be possibility of devices are suspending before sync completes. Hence sue to unsuccessful sync, memory corruption might happen when the device wakes up.

Please suggest any way to track sys_sync completion during suspend.

Thanks,
Diptendu
 
Old 11-17-2020, 08:10 PM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,125

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Looking at your previous threads it seems you have an unusually constrained environment that you are not inclined to talk about. If you really think the sync is returning before the data are hardened, raise a bug against the kernel. My understanding is this shouldn't happen on current Linux kernels. Be prepared to have good evidence, and you will have to define the environment in detail.

I don't understand this.
Quote:
But here I cant use hard delays due to process utilization constraints.
Your organization is prepared to accept outages, but not institute a fix you says resolves (avoids) the issue. Strange place.
As to your question, you can trace the entry and exit to sync, but what would be the point if as you allege it is returning too early. Do you have accurate commit timing from the device itself ?. So many questions - how many levels of abstraction exist between the kernel and the "device" where the suspend writes to ?.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] PC wakes from sleep after a few seconds into it gurps Linux - Newbie 3 04-09-2016 05:41 PM
sleep does not return after machine wakes from suspend kwhitefoot Linux - Laptop and Netbook 1 02-13-2016 05:04 AM
SIGIO sigaction wakes sleep up early bldrco Programming 2 07-09-2009 08:56 AM
LXer: Midnight Commander wakes from deep sleep LXer Syndicated Linux News 0 02-02-2009 12:50 PM
Standby/Sleep immediately wakes up again bsander Linux - Laptop and Netbook 2 05-07-2005 03:29 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 02:29 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