mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nick Piggin <npiggin@suse.de>
To: Jan Beulich <jbeulich@novell.com>
Cc: mingo@elte.hu, tglx@linutronix.de, hpa@zytor.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] x86: fix spin_is_contended()
Date: Tue, 5 Aug 2008 04:07:59 +0200	[thread overview]
Message-ID: <20080805020758.GB15075@wotan.suse.de> (raw)
In-Reply-To: <4897228E.76E4.0078.0@novell.com>

On Mon, Aug 04, 2008 at 02:38:54PM +0100, Jan Beulich wrote:
> The masked difference is what needs to be compared against 1, rather
> than the difference of masked values (which can be negative).

Dang, thanks.

> 
> Signed-off-by: Jan Beulich <jbeulich@novell.com>
> Cc: Nick Piggin <npiggin@suse.de>
> 
> ---
>  include/asm-x86/spinlock.h |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> --- linux-2.6.27-rc1/include/asm-x86/spinlock.h	2008-07-31 17:08:34.000000000 +0200
> +++ 2.6.27-rc1-x86-spin-is-contended/include/asm-x86/spinlock.h	2008-08-04 11:09:33.000000000 +0200
> @@ -65,7 +65,7 @@ static inline int __ticket_spin_is_conte
>  {
>  	int tmp = ACCESS_ONCE(lock->slock);
>  
> -	return (((tmp >> 8) & 0xff) - (tmp & 0xff)) > 1;
> +	return (((tmp >> 8) - tmp) & 0xff) > 1;
>  }
>  
>  static __always_inline void __ticket_spin_lock(raw_spinlock_t *lock)
> @@ -127,7 +127,7 @@ static inline int __ticket_spin_is_conte
>  {
>  	int tmp = ACCESS_ONCE(lock->slock);
>  
> -	return (((tmp >> 16) & 0xffff) - (tmp & 0xffff)) > 1;
> +	return (((tmp >> 16) - tmp) & 0xffff) > 1;
>  }
>  
>  static __always_inline void __ticket_spin_lock(raw_spinlock_t *lock)
> 
> 

  reply	other threads:[~2008-08-05  2:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-04 13:38 Jan Beulich
2008-08-05  2:07 ` Nick Piggin [this message]
2008-08-15 14:26   ` 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=20080805020758.GB15075@wotan.suse.de \
    --to=npiggin@suse.de \
    --cc=hpa@zytor.com \
    --cc=jbeulich@novell.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    /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

all inboxes | Powered by JetHome®