public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: William Lee Irwin III <wli@holomorphy.com>
To: linux-kernel@vger.kernel.org, rml@tech9.net
Subject: Re: NUMA-Q breakage 5/7 in_interrupt() race
Date: Sat, 13 Jul 2002 01:28:14 -0700	[thread overview]
Message-ID: <20020713082814.GE21551@holomorphy.com> (raw)
In-Reply-To: <20020712224003.GC25360@holomorphy.com>

> ===== include/asm-i386/hardirq.h 1.7 vs edited =====
> +	preempt_disable();
> +
> +	return retval;
> +}

Not sure how it survived running. That should be a preempt_enable() on
the way out. Maybe I should have used the get_cpu()/put_cpu() stuff.

Amended patch follows.


Cheers,
Bill


===== include/asm-i386/hardirq.h 1.7 vs edited =====
--- 1.7/include/asm-i386/hardirq.h	Mon May 20 10:51:17 2002
+++ edited/include/asm-i386/hardirq.h	Thu Jul 11 19:51:02 2002
@@ -22,8 +22,24 @@
  * Are we in an interrupt context? Either doing bottom half
  * or hardware interrupt processing?
  */
-#define in_interrupt() ({ int __cpu = smp_processor_id(); \
-	(local_irq_count(__cpu) + local_bh_count(__cpu) != 0); })
+static inline int in_interrupt(void)
+{
+	int total_count, retval, cpu;
+
+	preempt_disable();
+	cpu = smp_processor_id();
+
+	total_count = local_irq_count(cpu) + local_bh_count(cpu);
+
+	if (total_count)
+		retval = 1;
+	else
+		retval = 0;
+
+	preempt_enable();
+
+	return retval;
+}
 
 #define in_irq() (local_irq_count(smp_processor_id()) != 0)
 

      parent reply	other threads:[~2002-07-13  8:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-12 22:40 NUMA-Q breakage 5/7 in_interrupt() race William Lee Irwin III
2002-07-12 22:53 ` William Lee Irwin III
2002-07-12 23:02   ` Thunder from the hill
2002-07-13  8:28 ` William Lee Irwin III [this message]

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=20020713082814.GE21551@holomorphy.com \
    --to=wli@holomorphy.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rml@tech9.net \
    /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