From: Robert Love <rml@tech9.net>
To: Roman Zippel <zippel@linux-m68k.org>
Cc: Rusty Russell <rusty@rustcorp.com.au>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] In-kernel module loader 3/7
Date: 18 Sep 2002 19:11:09 -0400 [thread overview]
Message-ID: <1032390672.4592.1977.camel@phantasy> (raw)
In-Reply-To: <Pine.LNX.4.44.0209190042370.8911-100000@serv>
On Wed, 2002-09-18 at 19:07, Roman Zippel wrote:
> On Wed, 18 Sep 2002, Rusty Russell wrote:
>
> > +/* Stopping interrupts faster than atomics on many archs (and more
> > + easily optimized if they're not) */
> > +static inline void bigref_inc(struct bigref *ref)
> > +{
> > + unsigned long flags;
> > + struct bigref_percpu *cpu;
> > +
> > + local_irq_save(flags);
> > + cpu = &ref->ref[smp_processor_id()];
> > + if (likely(!cpu->slow_mode))
> > + cpu->counter++;
>
> Did you benchmark this? On most UP machines an inc/dec should be cheaper
> than irq enable/disable.
Yah. I would think due to pipeline effects, disabling interrupts would
never be faster than an atomic inc/dec, assuming the architecture has
normal locking.
Robert Love
next prev parent reply other threads:[~2002-09-18 23:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-09-18 2:07 Rusty Russell
2002-09-18 23:07 ` Roman Zippel
2002-09-18 23:11 ` Robert Love [this message]
2002-09-19 2:05 ` Rusty Russell
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=1032390672.4592.1977.camel@phantasy \
--to=rml@tech9.net \
--cc=linux-kernel@vger.kernel.org \
--cc=rusty@rustcorp.com.au \
--cc=zippel@linux-m68k.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
all inboxes | Powered by JetHome®