thp: reduce khugepaged freezing latency (rhbz 771006)
This commit is contained in:
parent
cd152b3a6c
commit
2205c1a917
@ -846,6 +846,9 @@ Patch21048: b44-Use-dev_kfree_skb_irq-in-b44_tx.patch
|
|||||||
#rhbz 746097
|
#rhbz 746097
|
||||||
Patch21049: tpm_tis-delay-after-aborting-cmd.patch
|
Patch21049: tpm_tis-delay-after-aborting-cmd.patch
|
||||||
|
|
||||||
|
#rhbz 771006
|
||||||
|
Patch21050: thp-reduce-khugepaged-freezing-latency.patch
|
||||||
|
|
||||||
# compat-wireless patches
|
# compat-wireless patches
|
||||||
Patch50000: compat-wireless-config-fixups.patch
|
Patch50000: compat-wireless-config-fixups.patch
|
||||||
Patch50001: compat-wireless-change-CONFIG_IWLAGN-CONFIG_IWLWIFI.patch
|
Patch50001: compat-wireless-change-CONFIG_IWLAGN-CONFIG_IWLWIFI.patch
|
||||||
@ -1575,6 +1578,9 @@ ApplyPatch b44-Use-dev_kfree_skb_irq-in-b44_tx.patch
|
|||||||
#rhbz 746097
|
#rhbz 746097
|
||||||
ApplyPatch tpm_tis-delay-after-aborting-cmd.patch
|
ApplyPatch tpm_tis-delay-after-aborting-cmd.patch
|
||||||
|
|
||||||
|
#rhbz 771006
|
||||||
|
ApplyPatch thp-reduce-khugepaged-freezing-latency.patch
|
||||||
|
|
||||||
ApplyPatch route-cache-garbage-collector.patch
|
ApplyPatch route-cache-garbage-collector.patch
|
||||||
|
|
||||||
# END OF PATCH APPLICATIONS
|
# END OF PATCH APPLICATIONS
|
||||||
@ -2352,6 +2358,9 @@ fi
|
|||||||
# and build.
|
# and build.
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Tue Jan 03 2012 Dave Jones <davej@redhat.com>
|
||||||
|
- thp: reduce khugepaged freezing latency (rhbz 771006)
|
||||||
|
|
||||||
* Tue Jan 3 2012 John W. Linville <linville@redhat.com>
|
* Tue Jan 3 2012 John W. Linville <linville@redhat.com>
|
||||||
- Re-enable CONFIG_RT2800PCI_RT53XX in compat-wireless build (rhbz #720594)
|
- Re-enable CONFIG_RT2800PCI_RT53XX in compat-wireless build (rhbz #720594)
|
||||||
|
|
||||||
|
54
thp-reduce-khugepaged-freezing-latency.patch
Normal file
54
thp-reduce-khugepaged-freezing-latency.patch
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
From: Andrea Arcangeli <aarcange@redhat.com>
|
||||||
|
Subject: thp: reduce khugepaged freezing latency
|
||||||
|
|
||||||
|
Use wait_event_freezable_timeout() instead of
|
||||||
|
schedule_timeout_interruptible() to avoid missing freezer wakeups. A
|
||||||
|
try_to_freeze() would have been needed in the
|
||||||
|
khugepaged_alloc_hugepage tight loop too in case of the allocation
|
||||||
|
failing repeatedly, and wait_event_freezable_timeout will provide it
|
||||||
|
too.
|
||||||
|
|
||||||
|
khugepaged would still freeze just fine by trying again the next
|
||||||
|
minute but it's better if it freezes immediately.
|
||||||
|
|
||||||
|
Reported-by: Jiri Slaby <jslaby@suse.cz>
|
||||||
|
Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
|
||||||
|
|
||||||
|
diff --git a/mm/huge_memory.c b/mm/huge_memory.c
|
||||||
|
index 4298aba..fd925d0 100644
|
||||||
|
--- a/mm/huge_memory.c
|
||||||
|
+++ b/mm/huge_memory.c
|
||||||
|
@@ -2259,12 +2259,9 @@ static void khugepaged_do_scan(struct page **hpage)
|
||||||
|
|
||||||
|
static void khugepaged_alloc_sleep(void)
|
||||||
|
{
|
||||||
|
- DEFINE_WAIT(wait);
|
||||||
|
- add_wait_queue(&khugepaged_wait, &wait);
|
||||||
|
- schedule_timeout_interruptible(
|
||||||
|
- msecs_to_jiffies(
|
||||||
|
- khugepaged_alloc_sleep_millisecs));
|
||||||
|
- remove_wait_queue(&khugepaged_wait, &wait);
|
||||||
|
+ wait_event_freezable_timeout(khugepaged_wait, false,
|
||||||
|
+ msecs_to_jiffies(
|
||||||
|
+ khugepaged_alloc_sleep_millisecs));
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifndef CONFIG_NUMA
|
||||||
|
@@ -2313,14 +2310,11 @@ static void khugepaged_loop(void)
|
||||||
|
if (unlikely(kthread_should_stop()))
|
||||||
|
break;
|
||||||
|
if (khugepaged_has_work()) {
|
||||||
|
- DEFINE_WAIT(wait);
|
||||||
|
if (!khugepaged_scan_sleep_millisecs)
|
||||||
|
continue;
|
||||||
|
- add_wait_queue(&khugepaged_wait, &wait);
|
||||||
|
- schedule_timeout_interruptible(
|
||||||
|
+ wait_event_freezable_timeout(khugepaged_wait, false,
|
||||||
|
msecs_to_jiffies(
|
||||||
|
khugepaged_scan_sleep_millisecs));
|
||||||
|
- remove_wait_queue(&khugepaged_wait, &wait);
|
||||||
|
} else if (khugepaged_enabled())
|
||||||
|
wait_event_freezable(khugepaged_wait,
|
||||||
|
khugepaged_wait_event());
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user