lkml.org 
[lkml]   [2004]   [Sep]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] irq_enter/irq_exit consolidation
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.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:06    [W:0.044 / U:0.356 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site