Skip to contentSkip to conversation

Weird schedule delay time for cache_reap()

DISCUSSION Chen, Kenneth W 2 participants 2 messages Oct 27, 2005 Memory management

lore
Share & tools
lore
#0 lore raw

I can't convince myself that the 2nd argument in schedule_delayed_work called from cache_reap() function make any sense:

static void cache_reap(void *unused)
{ ...

        check_irq_on();
        up(&cache_chain_sem);
        drain_remote_pages();
        /* Setup the next iteration */
        schedule_delayed_work(&__get_cpu_var(reap_work), REAPTIMEOUT_CPUC + smp_processor_id());
}

Suppose one have a lucky 1024-processor big iron numa box, cpu0 will do cache_reap every 2 sec (REAPTIMEOUT_CPUC = 2*HZ). cpu512 will do cache_reap every 4 sec,
cpu1023 will do cache_reap every 6 sec.

Is the skew intentional on different CPU? Why different interval for different cpu#?

- Ken

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

#1 lore raw
Quoted 7 lines · Kenneth W

can't convince myself that the 2nd argument in schedule_delayed_work called from cache_reap() function make any sense:

static void cache_reap(void *unused)
{ ...
schedule_delayed_work(&__get_cpu_var(reap_work), REAPTIMEOUT_CPUC +

smp_processor_id());

Quoted 8 lines

Suppose one have a lucky 1024-processor big iron numa box, cpu0 will do cache_reap every 2 sec (REAPTIMEOUT_CPUC = 2*HZ). cpu512 will do cache_reap every 4 sec,
cpu1023 will do cache_reap every 6 sec.

Is the skew intentional on different CPU? Why different interval for different cpu#?

It looks like a buggy attempt to make the timers not cluster. The +smp_processor_id() should be probably only done on the first iteration. start_cpu_timer() does this already, so removing it should be ok.

-Andi

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>