All of lore.kernel.org
 help / color / mirror / Atom feed
* slab: start_cpu_timer/cache_reap CONFIG_HOTPLUG_CPU problems
@ 2007-01-29  1:13 Oleg Nesterov
  2007-01-29 16:54 ` Christoph Lameter
  0 siblings, 1 reply; 25+ messages in thread
From: Oleg Nesterov @ 2007-01-29  1:13 UTC (permalink / raw)
  To: Christoph Lameter, Ingo Molnar
  Cc: Srivatsa Vaddagiri, Pallipadi, Venkatesh, Gautham shenoy,
	Andrew Morton, linux-kernel

For the beginning, about another (but related) minor problem,

	debug_smp_processor_id:

		/*
		 * Kernel threads bound to a single CPU can safely use
		 * smp_processor_id():
		 */

This is only true without CONFIG_HOTPLUG_CPU. Otherwise CPU can go away when
the task takes a preemption or sleeps. I think we need #ifndef here.


Now,
	static void __devinit start_cpu_timer(int cpu)
	{
		struct delayed_work *reap_work = &per_cpu(reap_work, cpu);

		if (keventd_up() && reap_work->work.func == NULL) {
			init_reap_node(cpu);
			INIT_DELAYED_WORK(reap_work, cache_reap);
			schedule_delayed_work_on(cpu, reap_work,
						__round_jiffies_relative(HZ, cpu));
		}
	}

This is wrong. Suppose we have a CPU_UP,CPU_DOWN,CPU_UP sequence. The last
CPU_UP will not restart a per-cpu "cache_reap timer".


With or without recent changes, it is possible that work->func() will run on
another CPU (not that to which it was submitted) if CPU goes down. In fact,
this can happen while work->func() is running, so even smp_processor_id()
is not safe to use in work->func().

However, cache_reap() seems to wrongly assume that smp_processor_id() is stable,
this is the second problem.

Is my understanding correct?

Oleg.


^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2007-02-21  3:42 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-29  1:13 slab: start_cpu_timer/cache_reap CONFIG_HOTPLUG_CPU problems Oleg Nesterov
2007-01-29 16:54 ` Christoph Lameter
2007-01-29 17:19   ` Oleg Nesterov
2007-01-29 17:27     ` Christoph Lameter
2007-01-29 18:27       ` Oleg Nesterov
2007-01-29 19:09         ` Christoph Lameter
2007-01-29 19:29           ` Oleg Nesterov
2007-01-29 19:25         ` Christoph Lameter
2007-01-29 19:49           ` Oleg Nesterov
2007-01-29 20:29             ` Christoph Lameter
2007-01-29 21:05               ` Oleg Nesterov
2007-01-29 21:48                 ` Christoph Lameter
2007-01-29 22:14                   ` Oleg Nesterov
2007-02-20 18:39         ` Max Krasnyansky
2007-02-20 18:45           ` Christoph Lameter
2007-02-20 20:05             ` Oleg Nesterov
2007-02-20 21:22               ` Max Krasnyansky
2007-02-20 21:35                 ` Christoph Lameter
2007-02-20 22:01                   ` Max Krasnyansky
2007-02-20 22:14                     ` Christoph Lameter
2007-02-20 22:48                       ` SLAB cache reaper on isolated cpus Max Krasnyansky
2007-02-20 23:19                         ` Christoph Lameter
2007-02-21  3:41                           ` Max Krasnyansky
2007-02-20 21:05             ` slab: start_cpu_timer/cache_reap CONFIG_HOTPLUG_CPU problems Max Krasnyansky
2007-02-20 21:34               ` Christoph Lameter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.