lkml.org 
[lkml]   [2006]   [Apr]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 3/3] Assert notifier_block and notifier_call are not in init section
From
Date
On Tue, 2006-04-25 at 12:16 -0700, Linus Torvalds wrote:
>
> On Tue, 25 Apr 2006, Chandra Seetharaman wrote:
> >
> > Two questions:
> > 1) related to this patch: Do you want me to generate a patch that
> > asserts only notifier calls ?
>
> I don't really have any strong preferences. It seems a bit strange that
> we'd do it for notifiers but not for other people. It might be better to
> try to build it into the build system itself, and get it through the
> _normal_ "section checking".

I 'll hold off for now then.
>
> One way to do that would be to make the "register_notifier()" thing just
> create this dummy asm() that just puts the arguments into a section that
> doesn't even get loaded, but that cna be checked.
>
> > 2) Unrelated to this patch: If the _code_ section is never reallocated
> > or reused, what is the purpose of putting _code_ in the init section ?
> > Only to make sure that the init calls are called in order ?
>
> No, the code section is re-used, it's just never re-used for any other
> code (since we don't generate code on the fly). So if you pass in a
> function pointer, you know that if it's in the init section, it means that
> init-code that was discarded.
>
> But if you pass in a data pointer, you'll never know if it's a data
> pointer to the original init-code section, or if it was a data pointer
> that was just dynamically allocated after the init-code section was freed.

Thanks for the clarification.
>
> > PS: I fixed my mailer to put my name. sorry about that.
>
> Looks good.
>
> Linus
--

----------------------------------------------------------------------
Chandra Seetharaman | Be careful what you choose....
- sekharan@us.ibm.com | .......you may get it.
----------------------------------------------------------------------


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

\
 
 \ /
  Last update: 2006-04-26 00:36    [W:0.069 / U:0.744 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site