public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: linux-ia64@vger.kernel.org
Subject: Re: periodically-drain-non-local-pagesets-fix.patch added to -mm
Date: Fri, 03 Jun 2005 07:22:10 +0000	[thread overview]
Message-ID: <20050603002210.3c548f4a.akpm@osdl.org> (raw)
In-Reply-To: <20050602231057.580dcaa3.akpm@osdl.org>

Keith Owens <kaos@sgi.com> wrote:
>
> Does this fix the problem?  Compiled but not tested.
> 
>  Index: linux/include/asm-ia64/processor.h
>  =================================>  --- linux.orig/include/asm-ia64/processor.h	2005-06-03 13:05:48.421839027 +1000
>  +++ linux/include/asm-ia64/processor.h	2005-06-03 17:10:43.911784989 +1000
>  @@ -407,15 +407,18 @@ extern void ia64_setreg_unknown_kr (void
>   #define ia64_is_local_fpu_owner(t)								\
>   ({												\
>   	struct task_struct *__ia64_islfo_task = (t);						\
>  -	(__ia64_islfo_task->thread.last_fph_cpu = smp_processor_id()				\
>  +	int ret = (__ia64_islfo_task->thread.last_fph_cpu = get_cpu()				\
>   	 && __ia64_islfo_task = (struct task_struct *) ia64_get_kr(IA64_KR_FPU_OWNER));	\
>  +	put_cpu();										\
>  +	ret;											\
>   })
>   
>   /* Mark task T as owning the fph partition of the CPU we're running on. */
>   #define ia64_set_local_fpu_owner(t) do {						\
>   	struct task_struct *__ia64_slfo_task = (t);					\
>  -	__ia64_slfo_task->thread.last_fph_cpu = smp_processor_id();			\
>  +	__ia64_slfo_task->thread.last_fph_cpu = get_cpu();				\
>   	ia64_set_kr(IA64_KR_FPU_OWNER, (unsigned long) __ia64_slfo_task);		\
>  +	put_cpu();									\
>   } while (0)
>   
>   /* Mark the fph partition of task T as being invalid on all CPUs.  */

Well it'll make the warning go away but I think there's a more fundamental
problem, in that:

	get_cpu();
	cond = something_which_uses_smp_processor_id();
	put_cpu();

	/* `cond' can become false at any time from here */


  parent reply	other threads:[~2005-06-03  7:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-03  6:10 periodically-drain-non-local-pagesets-fix.patch added to -mm Andrew Morton
2005-06-03  7:15 ` periodically-drain-non-local-pagesets-fix.patch added to -mm tree Keith Owens
2005-06-03  7:22 ` Andrew Morton [this message]
2005-06-03  7:31 ` Keith Owens
2005-06-03  7:35 ` periodically-drain-non-local-pagesets-fix.patch added to -mm Andrew Morton
2005-06-03  7:52 ` Christoph Lameter

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=20050603002210.3c548f4a.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=linux-ia64@vger.kernel.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox