Re: PATCH] debug: add notifier chain debugging
From: Ingo Molnar
Date: Wed Aug 27 2008 - 02:39:39 EST
* Arjan van de Ven <arjan@xxxxxxxxxxxxx> wrote:
> The patch below fixes this;
> Ingo, please replace the patch with this one.
well, this one is now less than cheap on x86:
> +int func_ptr_is_kernel_text(void *ptr)
> +{
> + unsigned long addr;
> + addr = (unsigned long) dereference_function_descriptor(ptr);
> + if (core_kernel_text(addr))
> + return 1;
> + return module_text_address(addr) != NULL;
> +}
as it's rather large. So i kept the config option, and it defaults to
off.
> + if (!func_ptr_is_kernel_text(nb->notifier_call)) {
> + WARN(1, "Invalid notifier called!");
> + nb = next_nb;
> + continue;
> + }
and that should be an unlikely() too i guess.
i've applied v2 as a delta patch to -tip, with these changes - see the
commit below.
Ingo
-------------------->