From: Andrea Arcangeli <andrea@suse.de>
To: Mathijs Mohlmann <mathijs@knoware.nl>
Cc: "David S. Miller" <davem@redhat.com>,
jgarzik@mandrakesoft.com, linux-kernel@vger.kernel.org,
torvalds@transmeta.com
Subject: Re: [PATCH] fix loop with disabled tasklets
Date: Sat, 10 Nov 2001 17:37:51 +0100 [thread overview]
Message-ID: <20011110173751.C1381@athlon.random> (raw)
In-Reply-To: <20011110122141.B2C68231A4@brand.mmohlmann.demon.nl> <20011110.053720.55510115.davem@redhat.com> <20011110160301.B1381@athlon.random> <20011110152845.8328F231A4@brand.mmohlmann.demon.nl>
In-Reply-To: <20011110152845.8328F231A4@brand.mmohlmann.demon.nl>; from mathijs@knoware.nl on Sat, Nov 10, 2001 at 04:29:00PM +0100
On Sat, Nov 10, 2001 at 04:29:00PM +0100, Mathijs Mohlmann wrote:
> On Saturday 10 November 2001 16:03, Andrea Arcangeli wrote:
> > just playing with the "softirq_raise" would be much simpler but I can
> > see only one problem: we don't know what cpu the tasklet is scheduled
> > into, so we don't know where to signal the local softirq.
> >
> > So it seems to fix the looping problem of disabled tasklets we should
> > really dschedule the tasklet in tasklet_disable (and of course to forbid
> > it to be scheduled when disabled in tasklet_schedule) and later to
> > reschedule it in tasklet_enable.
>
> Or add a cpu field to struct tasklet_struct.
of course, but that has to be maintained with locking too that
invalidates the simplicity of such approch. My point was that if we have
to play with the tasklet locking I guess we can as well drop the tasklet
from the queue and be more scalable so you can schedule thousand of
disabled tasklets at zero do_softirq cost (that was first Dave
suggestion).
> > Infact at the moment it's even impossible to remove a tasklet from the
> > queue if it remains disabled forever. tasklet_kill will deadlock on a
> > tasklet that is disabled.
> I think this is the responsability of the device driver writer (or who ever
> uses it). AFAIK there is no defined behavior for this case. I vote for
> removing the tasklet without it ever being run.
yes, dropping it only after it run is an implementation detail, it can
delay a bit but it doesn't matter much. If we change the "disabled
tasklet" case (also for tasklet_kill, so you can kill also a disabled
tasklet) it may end to be more handy to also kill a scheduled tasklet
before it run, these will be more implementation details too and I agree
with you and Alan that here the semantics of running the tasklet before
killing it or not doesn't matter and should be considered undefined
behaviour. The only semantics of tasklet_kill are that the tasklet will
stop running after tasklet_kill returned and as Alan noted it depends on
the timing anyways.
btw, the patches I seen floating around checking the ->count before
tasking are racy.
Andrea
next prev parent reply other threads:[~2001-11-10 16:39 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-11-10 12:21 [PATCH] fix loop with disabled tasklets Mathijs Mohlmann
2001-11-10 13:37 ` David S. Miller
2001-11-10 15:03 ` Andrea Arcangeli
2001-11-10 15:29 ` Mathijs Mohlmann
2001-11-10 16:02 ` Alan Cox
2001-11-10 16:37 ` Andrea Arcangeli [this message]
2001-11-12 1:11 ` Andrea Arcangeli
2001-11-12 7:42 ` Mathijs Mohlmann
2001-11-12 7:59 ` David S. Miller
2001-11-12 14:03 ` Andrea Arcangeli
2001-11-12 13:57 ` Andrea Arcangeli
2001-11-12 8:03 ` David S. Miller
2001-11-12 14:04 ` Andrea Arcangeli
2001-11-12 14:20 ` Andrea Arcangeli
2001-11-12 17:10 ` Thorsten Kukuk
2001-11-12 19:03 ` Mathijs Mohlmann
2001-11-11 2:32 ` Mathijs Mohlmann
-- strict thread matches above, loose matches on Subject: below --
2001-11-11 15:56 Momchil Velikov
2001-11-12 7:46 ` Mathijs Mohlmann
2001-11-12 8:00 ` David S. Miller
2001-11-12 8:07 ` Momchil Velikov
2001-11-12 9:11 ` Mathijs Mohlmann
2001-11-12 9:41 ` Momchil Velikov
2001-11-12 9:54 ` Mathijs Mohlmann
2001-11-12 15:33 Petr Vandrovec
2001-11-12 14:48 ` Andrea Arcangeli
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=20011110173751.C1381@athlon.random \
--to=andrea@suse.de \
--cc=davem@redhat.com \
--cc=jgarzik@mandrakesoft.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mathijs@knoware.nl \
--cc=torvalds@transmeta.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