]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
thp: move khugepaged_mutex out of khugepaged
authorXiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
Thu, 13 Sep 2012 00:58:38 +0000 (10:58 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 13 Sep 2012 07:27:50 +0000 (17:27 +1000)
commit0a093ecb037c36c6c223f6a4d5d9d20856429b04
treed7cc845b0c69bf49bcd1802aefd1df4cdeabad9c
parent47bee53f1f8057f0b99f7ec2eaae3115b1f4db9d
thp: move khugepaged_mutex out of khugepaged

Currently, hugepaged_mutex is used really complexly and hard to
understand, actually, it is just used to serialize start_khugepaged and
khugepaged for these reasons:

- khugepaged_thread is shared between them
- the thp disable path (echo never > transparent_hugepage/enabled) is
  nonblocking, so we need to protect khugepaged_thread to get a stable
  running state

These can be avoided by:

- use the lock to serialize the thread creation and cancel
- thp disable path can not finised until the thread exits

Then khugepaged_thread is fully controlled by start_khugepaged, khugepaged
will be happy without the lock

Signed-off-by: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: David Rientjes <rientjes@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/huge_memory.c