+ mm-khugepaged-allow-to-interrupt-allocation-sleep-again.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Subject: mm/khugepaged: allow interruption of allocation sleep again
has been added to the -mm tree.  Its filename is
     mm-khugepaged-allow-to-interrupt-allocation-sleep-again.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/mm-khugepaged-allow-to-interrupt-allocation-sleep-again.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/mm-khugepaged-allow-to-interrupt-allocation-sleep-again.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Petr Mladek <pmladek@xxxxxxxx>
Subject: mm/khugepaged: allow interruption of allocation sleep again

Commit 1dfb059b9438633b0546 ("thp: reduce khugepaged freezing latency")
fixed khugepaged to do not block a system suspend.  But the result is that
it could not get interrupted before the given timeout because the
condition for the wait event is "false".

This patch puts back the original approach but it uses
freezable_schedule_timeout_interruptible() instead of
schedule_timeout_interruptible().  It does the right thing.  I am pretty
sure that the freezable variant was not used in the original fix only
because it was not available at that time.

The regression has been there for ages.  It was not critical.  It just did
the allocation throttling a little bit more aggressively.

I found this problem when converting the kthread to kthread worker API and
trying to understand the code.

Signed-off-by: Petr Mladek <pmladek@xxxxxxxx>
Cc: Andrea Arcangeli <aarcange@xxxxxxxxxx>
Cc: Vlastimil Babka <vbabka@xxxxxxx>
Cc: "Aneesh Kumar K.V" <aneesh.kumar@xxxxxxxxxxxxxxxxxx>
Cc: "Kirill A. Shutemov" <kirill.shutemov@xxxxxxxxxxxxxxx>
Cc: David Rientjes <rientjes@xxxxxxxxxx>
Cc: Ebru Akagunduz <ebru.akagunduz@xxxxxxxxx>
Cc: Mel Gorman <mgorman@xxxxxxx>
Cc: Jiri Kosina <jkosina@xxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 mm/huge_memory.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff -puN mm/huge_memory.c~mm-khugepaged-allow-to-interrupt-allocation-sleep-again mm/huge_memory.c
--- a/mm/huge_memory.c~mm-khugepaged-allow-to-interrupt-allocation-sleep-again
+++ a/mm/huge_memory.c
@@ -2326,8 +2326,12 @@ static void __collapse_huge_page_copy(pt
 
 static void khugepaged_alloc_sleep(void)
 {
-	wait_event_freezable_timeout(khugepaged_wait, false,
-			msecs_to_jiffies(khugepaged_alloc_sleep_millisecs));
+	DEFINE_WAIT(wait);
+
+	add_wait_queue(&khugepaged_wait, &wait);
+	freezable_schedule_timeout_interruptible(
+		msecs_to_jiffies(khugepaged_alloc_sleep_millisecs));
+	remove_wait_queue(&khugepaged_wait, &wait);
 }
 
 static int khugepaged_node_load[MAX_NUMNODES];
_

Patches currently in -mm which might be from pmladek@xxxxxxxx are

mm-khugepaged-allow-to-interrupt-allocation-sleep-again.patch

--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux