mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chuck Ebbert <76306.1226@compuserve.com>
To: Andrew Morton <akpm@osdl.org>
Cc: torvalds@osdl.org, mingo@elte.hu, linux-kernel@vger.kernel.org
Subject: Re: [patch] i386 spinlocks: disable interrupts only if we enabled them
Date: Tue, 7 Mar 2006 20:45:53 -0500	[thread overview]
Message-ID: <200603072049_MC3-1-BA0B-ED8F@compuserve.com> (raw)

In-Reply-To: <20060307161550.27941df5.akpm@osdl.org>

On Tue, 7 Mar 2006 16:15:50, Andrew Morton wrote:

> Chuck Ebbert <76306.1226@compuserve.com> wrote:
> > Fastpath before patch:
> >         jle <keep looping>      not-taken conditional jump
> >         cli                     disable interrupts
> >         jmp <try for lock>      unconditional jump
> > 
> > Fastpath after patch, if interrupts were not enabled:
> >         jg <try for lock>       taken conditional branch
> > 
> 
> Well no.  The fastpath is:
> 
>       jns     4f              we got the lock.

 That's debatable.  Once the spinlock is available, jumping back to
try and get it becomes fastpath code, even though the spinloop itself
is not.  Any delay seen here means lost cycles that could be doing work.

 My only real question is how long 'cli' takes if interrupts are already
disabled.

> And it's increasing text size.  Which wouldn't be a big problem if the
> spinning code was still in an out-of-line section, but it isn't any more.

 __raw_spin_lock_flags is inlined, but only one place, in
_spin_lock_irqsave(), which is no longer an inline.  So there's no real
need to out-of-line the spin code anymore.  This adds nine bytes, which
should be acceptable in an out-of-line function. (Only the unlock functions
are inlined, and even then only if !CONFIG_PREEMPT).


-- 
Chuck
"Penguins don't come from next door, they come from the Antarctic!"


             reply	other threads:[~2006-03-08  1:49 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-08  1:45 Chuck Ebbert [this message]
  -- strict thread matches above, loose matches on Subject: below --
2006-03-07 23:34 Chuck Ebbert
2006-03-08  0:15 ` Andrew Morton
2006-03-08  0:43   ` Ingo Molnar
2006-03-08  2:52     ` Benjamin LaHaise
2006-03-08  6:55       ` Andrew Morton
2006-03-08  8:52         ` Nick Piggin

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=200603072049_MC3-1-BA0B-ED8F@compuserve.com \
    --to=76306.1226@compuserve.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=torvalds@osdl.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

Powered by JetHome