]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
thp: move khugepaged_mutex out of khugepaged
authorXiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
Fri, 28 Sep 2012 00:19:16 +0000 (10:19 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 8 Oct 2012 02:59:57 +0000 (13:59 +1100)
commitc5a4152c856c26e8d6bf7e023000a02fc285ae67
tree94da10e04846c784be1e94490236d445778a39fd
parentd593be820500abe186a42115b5f89979d1f0835a
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