Re: [PATCH 1/2] Add thread_info_cache_init() to all archs

2008-05-21 Thread Andrew Morton
On Wed, 21 May 2008 15:44:41 -0400 Benjamin Herrenschmidt <[EMAIL PROTECTED]> wrote: > > On Wed, 2008-05-21 at 11:41 -0700, Andrew Morton wrote: > > > > yup, gcc bug. Discussed recently on lkml, "Subject: Re: huge gcc > > 4.1.{0,1} __weak problem". I don't think anything ended up happening > >

Re: [PATCH 1/2] Add thread_info_cache_init() to all archs

2008-05-21 Thread Benjamin Herrenschmidt
On Wed, 2008-05-21 at 21:06 +0200, Sam Ravnborg wrote: > It was discussed to add some run-time checks for this issue. > But the examples given were a bit fluffy so I never integrated > anything > i kbuild to detect this. > > As this is only a bug for const weak functions they could be made > non-

Re: [PATCH 1/2] Add thread_info_cache_init() to all archs

2008-05-21 Thread Benjamin Herrenschmidt
On Wed, 2008-05-21 at 11:41 -0700, Andrew Morton wrote: > > yup, gcc bug. Discussed recently on lkml, "Subject: Re: huge gcc > 4.1.{0,1} __weak problem". I don't think anything ended up happening > about it though. Hrm... do you think we should work around ? ie. move the stubs to a separate .c

Re: [PATCH 1/2] Add thread_info_cache_init() to all archs

2008-05-21 Thread Sam Ravnborg
On Wed, May 21, 2008 at 11:41:47AM -0700, Andrew Morton wrote: > On Wed, 21 May 2008 13:56:25 -0400 Benjamin Herrenschmidt <[EMAIL PROTECTED]> > wrote: > > > > > On Fri, 2008-04-18 at 16:44 +1000, Benjamin Herrenschmidt wrote: > > > > > so what > > > > > about the patch below ? > > > > > > > >

Re: [PATCH 1/2] Add thread_info_cache_init() to all archs

2008-05-21 Thread Andrew Morton
On Wed, 21 May 2008 13:56:25 -0400 Benjamin Herrenschmidt <[EMAIL PROTECTED]> wrote: > > On Fri, 2008-04-18 at 16:44 +1000, Benjamin Herrenschmidt wrote: > > > > so what > > > > about the patch below ? > > > > > > I like it, but the compiler won't ;) > > > > > > > If you're ok, I'll re-send wi

Re: [PATCH 1/2] Add thread_info_cache_init() to all archs

2008-05-21 Thread Benjamin Herrenschmidt
On Fri, 2008-04-18 at 16:44 +1000, Benjamin Herrenschmidt wrote: > > > so what > > > about the patch below ? > > > > I like it, but the compiler won't ;) > > > > > If you're ok, I'll re-send with appropriate sob > > > & adapted powerpc part. > > > > Sure. > > > > > +void __init __attribute__((

Re: [PATCH 1/2] Add thread_info_cache_init() to all archs

2008-04-17 Thread Benjamin Herrenschmidt
> > so what > > about the patch below ? > > I like it, but the compiler won't ;) > > > If you're ok, I'll re-send with appropriate sob > > & adapted powerpc part. > > Sure. > > > +void __init __attribute__((weak) thread_info_cache_init(void) > > s/weak)/weak))/ Yeah, missing quilt ref :-) I

Re: [PATCH 1/2] Add thread_info_cache_init() to all archs

2008-04-17 Thread Michael Ellerman
On Thu, 2008-04-17 at 21:19 -0700, Andrew Morton wrote: > On Fri, 18 Apr 2008 13:58:06 +1000 Benjamin Herrenschmidt <[EMAIL PROTECTED]> > wrote: > > > > > > > > otoh, if only one .c file will ever call this function then I think > > > > > that > > > > > all problems are solved by > > > > > > >

Re: [PATCH 1/2] Add thread_info_cache_init() to all archs

2008-04-17 Thread Kyle McMartin
On Fri, Apr 18, 2008 at 01:58:06PM +1000, Benjamin Herrenschmidt wrote: > Well, looking there, I saw we already used weak symbols for that so what > about the patch below ? If you're ok, I'll re-send with appropriate sob > & adapted powerpc part. > This is definitely the cleanest way to do this f

Re: [PATCH 1/2] Add thread_info_cache_init() to all archs

2008-04-17 Thread Andrew Morton
On Fri, 18 Apr 2008 13:58:06 +1000 Benjamin Herrenschmidt <[EMAIL PROTECTED]> wrote: > > > > > otoh, if only one .c file will ever call this function then I think that > > > > all problems are solved by > > > > > > > > a) moving the above ifdeffery into the .c file > > > > b) adding a comment e

Re: [PATCH 1/2] Add thread_info_cache_init() to all archs

2008-04-17 Thread Benjamin Herrenschmidt
> > > otoh, if only one .c file will ever call this function then I think that > > > all problems are solved by > > > > > > a) moving the above ifdeffery into the .c file > > > b) adding a comment explaining which arch file must provide the override > > > c) directly including that file from with

Re: [PATCH 1/2] Add thread_info_cache_init() to all archs

2008-04-13 Thread Andrew Morton
On Mon, 14 Apr 2008 10:38:26 +1000 Benjamin Herrenschmidt <[EMAIL PROTECTED]> wrote: > > > +#ifndef thread_info_cache_init > > > +#define thread_info_cache_init do { } while(0) > > > +#endif > > > > This trick does cause a bit of a problem: it is undefined which arch header > > file is to prov

Re: [PATCH 1/2] Add thread_info_cache_init() to all archs

2008-04-13 Thread Benjamin Herrenschmidt
> > +#ifndef thread_info_cache_init > > +#define thread_info_cache_init do { } while(0) > > +#endif > > This trick does cause a bit of a problem: it is undefined which arch header > file is to provide the alternative definition of thread_info_cache_init. I this case it's well defined: thread_

Re: [PATCH 1/2] Add thread_info_cache_init() to all archs

2008-04-13 Thread Andrew Morton
On Thu, 10 Apr 2008 13:22:56 +1000 Benjamin Herrenschmidt <[EMAIL PROTECTED]> wrote: > Some architecture need to maintain a kmem cache for thread info > structures. (next patch adds that to powerpc to fix an alignment > problem). > > There is no good arch callback to use to initialize that cache

[PATCH 1/2] Add thread_info_cache_init() to all archs

2008-04-10 Thread Benjamin Herrenschmidt
Some architecture need to maintain a kmem cache for thread info structures. (next patch adds that to powerpc to fix an alignment problem). There is no good arch callback to use to initialize that cache that I can find, so this adds a new one and adds an empty macro for when it's not implemented.

Re: [PATCH 1/2] Add thread_info_cache_init() to all archs

2008-04-10 Thread Benjamin Herrenschmidt
> +#ifndef thread_info_cache_init > +#define thread_info_cache_init do { } while(0) > +#endif > + Blah ! Missing a pair of () here. Ooops. I'll send a fixed patch. Ben. ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/ma

[PATCH 1/2] Add thread_info_cache_init() to all archs

2008-04-09 Thread Benjamin Herrenschmidt
Some architecture need to maintain a kmem cache for thread info structures. (next patch adds that to powerpc to fix an alignment problem). There is no good arch callback to use to initialize that cache that I can find, so this adds a new one and adds an empty macro for when it's not implemented.