Re: [PATCH] signal: Make oom_flags a bool
From: Andrew Morton <akpm@linux-foundation.org>
Date: 2016-03-28 22:04:12
On Mon, 21 Mar 2016 20:38:13 +0900 Tetsuo Handa [off-list ref] wrote:
Currently the size of "struct signal_struct"->oom_flags member is sizeof(unsigned) bytes, but only one flag OOM_FLAG_ORIGIN which is updated by current thread is defined. We can convert OOM_FLAG_ORIGIN into a bool, and reuse the saved bytes for updating from the OOM killer and/or the OOM reaper thread. By the way, do we care about a race window between run_store() and swapoff() because it would be theoretically possible that two threads sharing the "struct signal_struct" concurrently call respective functions? If we care, we can make oom_flags an atomic_t.
Making oom_flags atomic wouldn't fix such a race - run_store() and swapoff() could still much with each other's state. But no, I don't think it matters a lot - worst case is that the "wrong" process gets oom-killed. I think. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>