]> git.karo-electronics.de Git - karo-tx-linux.git/commit
ipc/msg.c: msgsnd: use freezable blocking call
authorManinder Singh <maninder1.s@samsung.com>
Tue, 9 Feb 2016 23:14:01 +0000 (10:14 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 9 Feb 2016 23:14:01 +0000 (10:14 +1100)
commitdb323b03c07c2391fab9ad110ca0160b26cd8856
tree0439b3d73c4c0c1b2ebba3bd7938eaa9c6862f7b
parentc762a2319ae87c9257d94010981f84f20cb95fba
ipc/msg.c: msgsnd: use freezable blocking call

When any task is stuck in Interruptible or Uninterruptible state then
waking up of that task fails.  If wakeup fails, then suspend operation
fails and all process send to frezeer state at this moment also gets
wakeup.  Correct implementation is that if suspend fails, then kernel
would retry suspend operation again after some specific timeinterval for
some fixed retry count.  But as changes suggested by Mr Colin Cross
(https://lkml.org/lkml/2013/5/1/424), for the system calls for which issue
has been faced process flag being appended with PF_FREEZER_SKIP.

We are testing some scenarios in which we have to do multi suspend-resume
scenario, and we faced the problem, hence the suggested changes for msgsnd
and msgrcv.

Avoid waking up every thread sleeping in a msgsnd call during suspend and
resume by calling a freezable blocking call.  Previous patches modified
the freezer to avoid sending wakeups to threads that are blocked in
freezable blocking calls.

This call was selected to be converted to a freezable call because it
doesn't hold any locks or release any resources when interrupted that
might be needed by another freezing task or a kernel driver during
suspend, and is a common site where idle userspace tasks are blocked.

Signed-off-by: Vaneet narang <v.narang@samsung.com>
Signed-off-by: Maninder Singh <maninder1.s@samsung.com>
Cc: Yogesh Gaur <yn.gaur@samsung.com>
Cc: Manjeet Pawar <manjeet.p@samsung.com>
Cc: Ajeet Yadav <ajeet.y@samsung.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Tejun Heo <tj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
ipc/msg.c