From: Roland Dreier <roland@topspin.com>
To: Andrew Morton <akpm@digeo.com>
Cc: "Shawn Starr" <spstarr@sh0n.net>,
rml@tech9.net, linux-kernel@vger.kernel.org
Subject: Re: [OOPS][2.5.66bk3+] run_timer_softirq - IRQ Mishandlings - New OOPS w/ timer
Date: 30 Mar 2003 16:00:51 -0800 [thread overview]
Message-ID: <52d6k84d70.fsf@topspin.com> (raw)
In-Reply-To: <20030330151746.4394dd2e.akpm@digeo.com>
> --- 25/drivers/char/tty_io.c~a 2003-03-30 15:12:37.000000000 -0800
> +++ 25-akpm/drivers/char/tty_io.c 2003-03-30 15:16:59.000000000 -0800
> @@ -1288,6 +1288,8 @@ static void release_dev(struct file * fi
> /*
> * Make sure that the tty's task queue isn't activated.
> */
> + clear_bit(TTY_DONT_FLIP, &tty->flags);
> + del_timer_sync(&tty->flip.work.timer);
> flush_scheduled_work();
I'm confused by this for two reasons:
First, from looking at workqueue.c (especially the comment in
queue_delayed_work() that says "Increase nr_queued so that the flush
function knows that there's something pending."), it seems like
flush_scheduled_work() should wait until even delayed work is done.
Given that, I don't think the del_timer_sync() should be there --
wouldn't flush_scheduled_work() block forever, since nr_queued can
never reach 0 now?
(I guess I'm assuming the real race is that tty_io.c calls
schedule_delayed_work() between flush_scheduled_work() and
release_mem() in release_dev())
Second, I don't see how it's _ever_ safe to call
flush_scheduled_work(). The comment in workqueue.c before
flush_workqueue() says "NOTE: if work is being added to the queue
constantly by some other context then this function might block
indefinitely." But flush_scheduled_work() is flushing the keventd_wq,
which other code will definitely add work to. If we're unlucky,
flush_scheduled_work() could block forever. Am I just being paranoid?
- Roland
next prev parent reply other threads:[~2003-03-30 23:49 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-03-30 16:10 [OOPS][2.5.66bk3+] run_timer_softirq - IRQ Mishandlings - New OOPS w/ timer Shawn Starr
2003-03-30 17:12 ` Petr Vandrovec
2003-03-30 21:02 ` Roland Dreier
2003-03-30 21:28 ` Shawn Starr
2003-03-30 23:17 ` Andrew Morton
2003-03-31 0:00 ` Roland Dreier [this message]
2003-03-31 14:08 ` Shawn Starr
2003-04-06 0:35 ` [OOPS][2.5.66bk9+] " Shawn Starr
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=52d6k84d70.fsf@topspin.com \
--to=roland@topspin.com \
--cc=akpm@digeo.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rml@tech9.net \
--cc=spstarr@sh0n.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