linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: TeJun Huh <tejun@aratech.co.kr>
To: linux-kernel@vger.kernel.org
Subject: Re: Race condition in 2.4 tasklet handling (cli() broken?)
Date: Sat, 23 Aug 2003 14:26:34 +0900	[thread overview]
Message-ID: <20030823052633.GA4307@atj.dyndns.org> (raw)
In-Reply-To: <20030823040931.GA3872@atj.dyndns.org>

 Oops, Sorry.  Only bh handling is relevant.  Softirq and tasklet are
not of concern to cli().

On Sat, Aug 23, 2003 at 01:09:31PM +0900, TeJun Huh wrote:
>  Additional suspicious things.
> 
> 1. tasklet_kill() has similar race condition.  mb() required before
> tasklet_unlock_wait().

Corrected 2.

 global_bh_lock test inside wait_on_irq() suggests that cli() tries to
block not only interrupt handling but also bh handlings of all cpus;
however, current implementation does not guarantee that.

 Because global_bh_lock is acquired in bh_action() <call trace:
handle_IRQ_event()->do_softirq()->tasklet_action()->bh_action()> after
decrementing local_irq_count(), other cpus may happily begin bh
handling while a cpu is still inside cli() - sti() critical section.

 If bh hanlding is not guaranteed to be blocked during cli() - sti()
critical section, global_bh_lock test inside wait_on_irq() is
redundant and if it should be guaranteed, current implmentation seems
broken.

-- 
tejun

  reply	other threads:[~2003-08-23  5:24 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-23  2:54 Race condition in 2.4 tasklet handling TeJun Huh
2003-08-23  4:09 ` Race condition in 2.4 tasklet handling (cli() broken?) TeJun Huh
2003-08-23  5:26   ` TeJun Huh [this message]
2003-08-23 10:28     ` Stephan von Krawczynski
2003-08-23 15:13       ` TeJun Huh
2003-08-23 15:37         ` Stephan von Krawczynski
2003-08-25  6:31           ` TeJun Huh
2003-08-25  7:23             ` Stephan von Krawczynski
2003-08-26  0:27               ` TeJun Huh
2003-08-23 15:56         ` Stephan von Krawczynski
2003-08-23 16:36           ` TeJun Huh
2003-08-24  3:27           ` TeJun Huh
2003-08-23 15:04 ` Race condition in 2.4 tasklet handling Anton Blanchard
     [not found] <nKwX.1yy.17@gated-at.bofh.it>
2003-08-25  8:06 ` Race condition in 2.4 tasklet handling (cli() broken?) Peter T. Breuer

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=20030823052633.GA4307@atj.dyndns.org \
    --to=tejun@aratech.co.kr \
    --cc=linux-kernel@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).