LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Suresh Siddha <suresh.b.siddha@intel.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: Suresh Siddha <suresh.b.siddha@intel.com>,
	mingo@elte.hu, hpa@zytor.com, tglx@linutronix.de,
	andi@firstfloor.org, linux-kernel@vger.kernel.org,
	Arjan van de Ven <arjan@linux.intel.com>
Subject: Re: [patch 1/2] x86, fpu: split FPU state from task struct - v3
Date: Mon, 3 Mar 2008 17:36:49 -0800	[thread overview]
Message-ID: <20080304013649.GB28006@linux-os.sc.intel.com> (raw)
In-Reply-To: <20080304011849.GA22431@infradead.org>

On Mon, Mar 03, 2008 at 08:18:49PM -0500, Christoph Hellwig wrote:
> On Mon, Mar 03, 2008 at 03:02:45PM -0800, Suresh Siddha wrote:
> > +void __attribute__((weak)) arch_task_cache_init(void)
> > +{
> > +}
> > +
> >  void __init fork_init(unsigned long mempages)
> >  {
> >  #ifndef __HAVE_ARCH_TASK_STRUCT_ALLOCATOR
> > @@ -144,6 +148,9 @@
> >  			ARCH_MIN_TASKALIGN, SLAB_PANIC | SLAB_NOTRACK, NULL);
> >  #endif
> >  
> > +	/* do the arch specific task caches init */
> > +	arch_task_cache_init();
> 
> Why can't this just be a normal initcall (with the right level)?

This is sort of an extension to the per-task area. And this needs to be done
before any task starts using this state. Thought this is the nice place to
initialize the extension caches along with the main task_struct init.

> 
> > +int __attribute__((weak)) arch_dup_task_struct(struct task_struct *dst,
> > +					       struct task_struct *src)
> > +{
> > +	*dst = *src;
> > +	return 0;
> > +}
> > +
> >  static struct task_struct *dup_task_struct(struct task_struct *orig)
> >  {
> >  	struct task_struct *tsk;
> > @@ -181,15 +195,15 @@
> >  		return NULL;
> >  	}
> >  
> > -	*tsk = *orig;
> > + 	err = arch_dup_task_struct(tsk, orig);
> > +	if (err)
> > +		goto out;
> > +
> 
> You're still adding a second hook instead of re-using or re-naming
> setup_thread_stack.  Did I miss a good explanation for that
> or was this just an oversight?

Not an oversight. setup_thread_stack comes with its own baggage called
__HAVE_THREAD_FUNCTIONS. Thought of keeping this simple and separate
by using an inline or weak linkage.

> Also this weak linkage stuff creaping in is really ugly.

hmm.. any better suggestion?

thanks,
suresh

  reply	other threads:[~2008-03-04  1:37 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-03 23:02 Suresh Siddha
2008-03-03 23:02 ` [patch 2/2] x86, fpu: lazy allocation of FPU area " Suresh Siddha
2008-03-04  1:20   ` Christoph Hellwig
2008-03-04  1:43     ` Suresh Siddha
2008-03-04 10:32       ` Ingo Molnar
2008-03-04 17:55         ` Suresh Siddha
2008-03-05 19:47           ` Pavel Machek
2008-03-06 15:51             ` Ingo Molnar
2008-03-06 19:10               ` Suresh Siddha
2008-03-06 20:24               ` Pavel Machek
2008-03-06 20:52                 ` Andi Kleen
2008-03-07 12:29                 ` H. Peter Anvin
2008-03-07 13:06                   ` Arjan van de Ven
2008-03-07 13:18                     ` Andi Kleen
2008-03-07 13:20                       ` Arjan van de Ven
2008-03-07 13:27                         ` Andi Kleen
2008-03-05 19:48   ` Pavel Machek
2008-03-06 19:26     ` Suresh Siddha
2008-03-06 21:21       ` Pavel Machek
2008-03-04  1:18 ` [patch 1/2] x86, fpu: split FPU state from task struct " Christoph Hellwig
2008-03-04  1:36   ` Suresh Siddha [this message]
2008-03-04  8:20     ` Ingo Molnar
2008-03-06 12:39     ` Christoph Hellwig
2008-03-04 10:28 ` Ingo Molnar
2008-03-04 17:59   ` Suresh Siddha
2008-03-04 20:53     ` Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080304013649.GB28006@linux-os.sc.intel.com \
    --to=suresh.b.siddha@intel.com \
    --cc=andi@firstfloor.org \
    --cc=arjan@linux.intel.com \
    --cc=hch@infradead.org \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    --subject='Re: [patch 1/2] x86, fpu: split FPU state from task struct - v3' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).