All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: mm-commits@vger.kernel.org, clalance@redhat.com,
	dada1@cosmosbay.com, dhecht@vmware.com, jmorris@namei.org,
	johnstul@us.ibm.com, mingo@elte.hu, paulus@samba.org,
	prarit@redhat.com, ricklind@us.ibm.com, schwidefsky@de.ibm.com,
	tglx@linutronix.de, zach@vmware.com
Subject: Re: + ignore-stolen-time-in-the-softlockup-watchdog-fix.patch added to -mm tree
Date: Tue, 24 Apr 2007 21:48:49 -0700	[thread overview]
Message-ID: <20070424214849.37783c2d.akpm@linux-foundation.org> (raw)
In-Reply-To: <462EDB1B.5010909@goop.org>

On Tue, 24 Apr 2007 21:37:47 -0700 Jeremy Fitzhardinge <jeremy@goop.org> wrote:

> Andrew Morton wrote:
> > Any which enable CONFIG_DEBUG_PREEMPT...
> >   
> 
> Hm.  Normally smp_processor_id() CSEs nicely, so it isn't generally
> necessary to do it manually.

For all architectures?

>  Not sure what CONFIG_DEBUG_PREEMPT will do
> to it.

#ifdef CONFIG_DEBUG_PREEMPT
  extern unsigned int debug_smp_processor_id(void);
# define smp_processor_id() debug_smp_processor_id()
#else
# define smp_processor_id() raw_smp_processor_id()
#endif

We could perhaps mark debug_smp_processor_id() as pure or const or whatever
the trick is to say it doesn't need to be reevaluated.  That would usually
be OK, because as long as preempt is disabled that _is_ how it works,
however code might do:

	preempt_disable();
	smp_processor_id();
	preempt_enable();

	<preempt or schedule()>

	preempt_disable();
	smp_processor_id();
	preempt_enable();

and caching the value would be wrong.

hm.  If "smp_processor_id() CSEs nicely", what prevents the compiler from
making the same mistake?  IOW, what are the barriers for CSE?  Function
calls?

      parent reply	other threads:[~2007-04-25  4:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-24 20:45 + ignore-stolen-time-in-the-softlockup-watchdog-fix.patch added to -mm tree akpm
     [not found] ` <17966.45949.796715.978244@cargo.ozlabs.ibm.com>
2007-04-25  2:14   ` Andrew Morton
     [not found] ` <462EB849.4080402@goop.org>
2007-04-25  2:16   ` Andrew Morton
     [not found]     ` <462EDB1B.5010909@goop.org>
2007-04-25  4:48       ` Andrew Morton [this message]

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=20070424214849.37783c2d.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=clalance@redhat.com \
    --cc=dada1@cosmosbay.com \
    --cc=dhecht@vmware.com \
    --cc=jeremy@goop.org \
    --cc=jmorris@namei.org \
    --cc=johnstul@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mm-commits@vger.kernel.org \
    --cc=paulus@samba.org \
    --cc=prarit@redhat.com \
    --cc=ricklind@us.ibm.com \
    --cc=schwidefsky@de.ibm.com \
    --cc=tglx@linutronix.de \
    --cc=zach@vmware.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.