Re: PATCH 2.4.0.1.ac10: a KISS memory pressure callback

From: Andi Kleen (ak@suse.de)
Date: Wed Jun 07 2000 - 04:10:31 EST


Jeff Garzik <jgarzik@mandrakesoft.com> writes:

Cool, someone had to do it ...

>
> int unregister_reboot_notifier(struct notifier_block * nb)
> +{
> + int i;
> +
> + spin_lock(&notifier_lock);
> + i = notifier_chain_unregister(&reboot_notifier_list, nb);
> + spin_unlock(&notifier_lock);

Shouldn't you move the spinlock that into the notifier_chain_* functions
itself ? In this case every user would be safe. Also while you're on it
you could move the notifier_* functions out of line. They are currently
inline (I think it was some plot of Alan to force some module writers
to go GPL ;). Anyways, with spinlocks they are far too big to be
inlined now. I guess that could save a few hundred bytes.

-Andi

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



This archive was generated by hypermail 2b29 : Wed Jun 07 2000 - 21:00:27 EST