mm/thp: new case thp04.c

The case is desinged to test THP functionality.

when one process allocate hugepage aligned anonymous pages,
kernel thread 'khugepaged' controlled by sysfs knobs
/sys/kernel/mm/transparent_hugepage/* will scan them, and make
them as transparent hugepage if they are suited, you can find out
how many transparent hugepages are there in one process from
/proc/<pid>/smaps, among the file contents, 'AnonHugePages' entry
stand for transparent hugepage.

Tested-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
Signed-off-by: Zhouping Liu <zliu@redhat.com>
Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
lib/mem: introduce a new function set_global_mempolicy()

Fork out a new function set_global_mempolicy() from the
previous testoom() func, which will be useful for other func.

Tested-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
Signed-off-by: Zhouping Liu <zliu@redhat.com>
Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
mm/thp: add new case thp05

added new case thp05, which is used to test transparent hugepage
under mempolicy - NUMA.

Tested-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
Signed-off-by: Zhouping Liu <zliu@redhat.com>
Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>