public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <dan@debian.org>
To: Paul Menage <pmenage@ensim.com>
Cc: Paul Gortmaker <p_gortmaker@yahoo.com>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Speedup SMP kernel on UP box
Date: Sat, 16 Mar 2002 18:54:43 -0500	[thread overview]
Message-ID: <20020316185443.A2171@nevyn.them.org> (raw)
In-Reply-To: <0C01A29FBAE24448A792F5C68F5EA47D238DE0@nasdaq.ms.ensim.com> <E16mNjq-0002xW-00@pmenage-dt.ensim.com>
In-Reply-To: <E16mNjq-0002xW-00@pmenage-dt.ensim.com>

On Sat, Mar 16, 2002 at 03:37:26PM -0800, Paul Menage wrote:
> In article <0C01A29FBAE24448A792F5C68F5EA47D238DE0@nasdaq.ms.ensim.com>,
> you write:
> >@@ -9,9 +9,15 @@
> >  */
> > 
> > #ifdef CONFIG_SMP
> >-#define LOCK "lock ; "
> >+#define LOCK "\n1:\tlock ; "
> >+#define LOCK_ADDR	"\n" \
> >+			".section .lock.init,\"a\"\n\t" \
> >+			".align 4\n\t" \
> >+			".long 1b\n" \
> >+			".previous\n"
> 
> 
> Why not do:
> 
> #define LOCK "1: lock ; \n" \
> 	 	".section .lock.init,\"a\"\n" \
> 		".align 4\n"\
> 		".long 1b\n"\
> 		".previous\n" 
> 
> Then you don't need the LOCK_ADDR macro, so most of atomic.h can be
> left as is. The assembler doesn't seem to care that there's a section
> change between the lock prefix and the instruction that it's locking.

Local labels work forwards as well as backwards:

 #define LOCK 
 	 	".section .lock.init,\"a\"\n" \
 		".align 4\n"\
 		".long 1f\n"\
 		".previous\n" 
		"1: lock ; \n"

I recommend not using "1" for your label, though, because probably
other bits of code that use locks have local loops in them.  It's to be
expected... just pick a less common number.

-- 
Daniel Jacobowitz                           Carnegie Mellon University
MontaVista Software                         Debian GNU/Linux Developer

  reply	other threads:[~2002-03-16 23:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <0C01A29FBAE24448A792F5C68F5EA47D238DE0@nasdaq.ms.ensim.com>
2002-03-16 23:37 ` [PATCH] Speedup SMP kernel on UP box Paul Menage
2002-03-16 23:54   ` Daniel Jacobowitz [this message]
2002-03-16 11:51 Paul Gortmaker
2002-03-16 12:42 ` Keith Owens

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=20020316185443.A2171@nevyn.them.org \
    --to=dan@debian.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=p_gortmaker@yahoo.com \
    --cc=pmenage@ensim.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox