1

I'm currently implementing suspend/resume for embedded Linux on some non-android network device. The requirement is to implement a sleep manager task in kernel which would trigger system suspend in case that no task is currently running and there's no traffic pending. I guess there should be some similar implementation existing already but failed to find. Can anyone refer me to some kind of similar project on this subject? Thanks a lot

alexa
  • 99
  • 1
  • 13

1 Answers1

2

If you don't mind doing some porting, the wakelocks from the Android kernel is exactly what you seem to need. User space acquires a wakelock when it needs to remain active (e.g. a task is running or traffic is taking place) and releases it when it doesn't anymore. When the number of held wakelocks reaches zero, the kernel enters suspend mode.

Gnurou
  • 7,923
  • 3
  • 22
  • 32
  • Thanks! I'll take a look at this framework. Also in addition I still have to monitor input/output traffic as it is a network device – alexa Jun 18 '12 at 08:49