linux-next: manual merge of the akpm tree with the tip tree

From: Stephen Rothwell
Date: Thu Sep 27 2012 - 03:04:10 EST


Hi Andrew,

Today's linux-next merge of the akpm tree got a conflict in
mm/huge_memory.c between commit 93c9d633bd9e ("mm/thp: Preserve pgprot
across huge page split") from the tip tree and commit "thp: merge page
pre-alloc in khugepaged_loop into khugepaged_do_scan" from the akpm tree.

I fixed it up (see below) and can carry the fix as necessary (no action
is required).

--
Cheers,
Stephen Rothwell sfr@xxxxxxxxxxxxxxxx

diff --cc mm/huge_memory.c
index 5ab8c26,50bd2ac..0000000
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@@ -2307,11 -2240,43 +2307,41 @@@ static int khugepaged_wait_event(void
kthread_should_stop();
}

- static void khugepaged_do_scan(struct page **hpage)
+ static void khugepaged_alloc_sleep(void)
+ {
+ wait_event_freezable_timeout(khugepaged_wait, false,
+ msecs_to_jiffies(khugepaged_alloc_sleep_millisecs));
+ }
+
+ #ifndef CONFIG_NUMA
+ static struct page *khugepaged_alloc_hugepage(bool *wait)
+ {
+ struct page *hpage;
+
+ do {
+ hpage = alloc_hugepage(khugepaged_defrag());
+ if (!hpage) {
+ count_vm_event(THP_COLLAPSE_ALLOC_FAILED);
+ if (!*wait)
+ return NULL;
+
+ *wait = false;
+ khugepaged_alloc_sleep();
+ } else
+ count_vm_event(THP_COLLAPSE_ALLOC);
+ } while (unlikely(!hpage) && likely(khugepaged_enabled()));
+
+ return hpage;
+ }
+ #endif
+
+ static void khugepaged_do_scan(void)
{
+ struct page *hpage = NULL;
unsigned int progress = 0, pass_through_head = 0;
- unsigned int pages = khugepaged_pages_to_scan;
+ unsigned int pages = ACCESS_ONCE(khugepaged_pages_to_scan);
+ bool wait = true;

- barrier(); /* write khugepaged_pages_to_scan to local stack */
-
while (progress < pages) {
cond_resched();

Attachment: pgp00000.pgp
Description: PGP signature