public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "David S. Miller" <davem@davemloft.net>
To: Russell King <rmk+lkml@arm.linux.org.uk>
Cc: hch@arm.linux.org.uk, akpm@osdl.org, spyro@f2s.com,
	linux390@de.ibm.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] irq_enter/irq_exit consolidation
Date: Sun, 12 Sep 2004 15:57:20 -0700	[thread overview]
Message-ID: <20040912155720.34b188d7.davem@davemloft.net> (raw)
In-Reply-To: <20040912124448.A13676@flint.arm.linux.org.uk>

On Sun, 12 Sep 2004 12:44:48 +0100
Russell King <rmk+lkml@arm.linux.org.uk> wrote:

> This guarantee must also exist on every other architecture, otherwise:
> 
> > ===== include/linux/hardirq.h 1.1 vs edited =====
> > --- 1.1/include/linux/hardirq.h	2004-09-08 08:32:57 +02:00
> > +++ edited/include/linux/hardirq.h	2004-09-11 21:26:28 +02:00
> > +#define irq_exit()						\
> > +do {								\
> > +	preempt_count() -= IRQ_EXIT_OFFSET;			\
> 
> would be buggy - it's an inherently non-atomic operation.

It works out actually, if we take an interrupt in the middle
of the operation, that's fine because the preemption count
will be precisely the same as we first read it by the time
we return from that interrupt, work out some example cases
as I think that makes it easier to understand.

  reply	other threads:[~2004-09-12 22:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-12 11:25 [PATCH] irq_enter/irq_exit consolidation Christoph Hellwig
2004-09-12 11:44 ` Russell King
2004-09-12 22:57   ` David S. Miller [this message]
2004-09-13  8:10     ` Russell King
  -- strict thread matches above, loose matches on Subject: below --
2004-09-13 13:02 Martin Schwidefsky
2004-09-14 18:31 ` Christoph Hellwig

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=20040912155720.34b188d7.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=akpm@osdl.org \
    --cc=hch@arm.linux.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux390@de.ibm.com \
    --cc=rmk+lkml@arm.linux.org.uk \
    --cc=spyro@f2s.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