Re: Linux 2.6.17-rc2 - notifier chain problem?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 2006-04-24 at 15:03 -0700, Andrew Morton wrote:
> Chandra Seetharaman <[email protected]> wrote:
> >
> > Thanks for the steps. With that i was able to reproduce the problem and
> > i found the bug.
> > 
> > While i go ahead and generate the patch, i wanted to hear if my
> > conclusion is correct.
> > 
> > The problem is due to the fact that most notifier registrations
> > incorrectly use __devinitdata to define the callback structure, as in:
> > 
> > static struct notifier_block __devinitdata hrtimers_nb = {
> >         .notifier_call = hrtimer_cpu_notify,
> > };
> > 
> > devinitdata'd  data is not _expected to be available_ after the
> > initialization(unless CONFIG_HOTPLUG is defined).
> > 
> > I do not know how it was working until now :), anybody has a theory that
> > can explain it (or my conclusion is wrong) ?
> 
> That sounds right.  There are several __devinitdata notifier_blocks in the
> tree - please be sure to check them all.

Yes, I am covering all notifier blocks.

Another issue... many of the notifier callback functions are marked as
init calls (__cpuinit, __devinit etc.,) as in:

static int __cpuinit pageset_cpuup_callback(struct notifier_block *nfb,
                unsigned long action,
                void *hcpu)

I am generating a separate patch to take care of those too.
> 
> btw, it'd be pretty trivial to add runtime checking for this sort of thing:
> 
> int addr_in_init_section(void *addr)
> {
> 	return addr >= __init_begin && addr < __init_end;
> }

I will add this to kernel/sys.c, and put a BUG_ON to check for both the
notifier block and the callback function.

BTW, which header file you want me to export this through ? 
> 
> (x86-specific)
> (need to add __init_end to vmlinux.lds.S)

I see __init_end in arch/i386/kernel/vmlinux.lds.S.

> 
> then we could use that to check various things in various places...
-- 

----------------------------------------------------------------------
    Chandra Seetharaman               | Be careful what you choose....
              - [email protected]   |      .......you may get it.
----------------------------------------------------------------------


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

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux