Re: [rfc] [patch] mm: Slab - Eliminate lock_cpu_hotplug from slab

From: Andrew Morton
Date: Sat Oct 28 2006 - 12:50:57 EST


On Fri, 27 Oct 2006 18:19:19 -0700
Ravikiran G Thirumalai <kiran@xxxxxxxxxxxx> wrote:

> Another note. Looks like a cpu hotplug event can send CPU_UP_CANCELED to
> a registered subsystem even if the subsystem did not receive CPU_UP_PREPARE.
> This could be due to a subsystem registered for notification earlier than
> the current subsystem crapping out with NOTIFY_BAD. Badness can occur with
> in the CPU_UP_CANCELED code path at slab if this happens (The same would
> apply for workqueue.c as well).

yup, cancellation doesn't work at present.

> To overcome this, we might have to use either
> a) a per subsystem flag and avoid handling of CPU_UP_CANCELED, or
> b) Use a special notifier events like LOCK_ACQUIRE/RELEASE as Gautham was
> using in his experiments, or
> c) Do not send CPU_UP_CANCELED to a subsystem which did not receive
> CPU_UP_PREPARE.
>
> I would prefer c).

c) would work. I guess we could do that by simply counting the number of
called handlers rather than having to record state within each one.

It would require changes to the notifier_chain API, but I think the changes
are needed - the problem is general. Something like:


int __raw_notifier_call_chain(struct raw_notifier_head *nh,
unsigned long val, void *v, unsigned nr_to_call, int *nr_called);

int raw_notifier_call_chain(struct raw_notifier_head *nh,
unsigned long val, void *v)
{
return __raw_notifier_call_chain(nh, val, v, -1, NULL);
}


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/