Skip to contentSkip to conversation

slab: use deferable timers for its periodic housekeeping

PATCH Applied Arjan van de Ven 2 participants 2 messages Jul 19, 2010 – Jul 20, 2010 Memory management

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 slab: use deferable timers for its periodic housekeeping

From: Arjan van de Ven <[email protected]>
Subject: [PATCH] slab: use deferable timers for its periodic housekeeping

slab has a "once every 2 second" timer for its housekeeping. As the number of logical processors is growing, its more and more common that this 2 second timer becomes the primary wakeup source.

This patch turns this housekeeping timer into a deferable timer, which means that the timer does not interrupt idle, but just runs at the next event that wakes the cpu up.

The impact is that the timer likely runs a bit later, but during the delay no code is running so there's not all that much reason for a difference in housekeeping to occur because of this delay.

---
 mm/slab.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
mm/slab.c +1 -1
index 7451bda..ef3cd3d 100644
@@ -884,7 +884,7 @@ static void __cpuinit start_cpu_timer(int cpu)
      */
     if (keventd_up() && reap_work->work.func == NULL) {
         init_reap_node(cpu);
-        INIT_DELAYED_WORK(reap_work, cache_reap);
+        INIT_DELAYED_WORK_DEFERRABLE(reap_work, cache_reap);
         schedule_delayed_work_on(cpu, reap_work,
                     __round_jiffies_relative(HZ, cpu));
     }
Signature · 1 line
1.6.1.3
Applied
#1 lore raw
Quoted 25 lines · Arjan van de Ven

From: Arjan van de Ven <[email protected]>
Subject: [PATCH] slab: use deferable timers for its periodic housekeeping

slab has a "once every 2 second" timer for its housekeeping. As the number of logical processors is growing, its more and more common that this 2 second timer becomes the primary wakeup source.

This patch turns this housekeeping timer into a deferable timer, which means that the timer does not interrupt idle, but just runs at the next event that wakes the cpu up.

The impact is that the timer likely runs a bit later, but during the delay no code is running so there's not all that much reason for a difference in housekeeping to occur because of this delay.

---
 mm/slab.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
mm/slab.c +0 -0
index 7451bda..ef3cd3d 100644

mm/slab.c static void __cpuinit start_cpu_timer(int cpu) · line 890

Quoted 8 lines
mm/slab.c +1 -1
@@ -884,7 +884,7 @@ static void __cpuinit start_cpu_timer(int cpu)
      */
     if (keventd_up() && reap_work->work.func == NULL) {
         init_reap_node(cpu);
-        INIT_DELAYED_WORK(reap_work, cache_reap);
+        INIT_DELAYED_WORK_DEFERRABLE(reap_work, cache_reap);
         schedule_delayed_work_on(cpu, reap_work,
                     __round_jiffies_relative(HZ, cpu));
     }

[ The patch seems to have been whitespace damaged. ]

Applied, thanks!