From: David Woodhouse <dwmw2@infradead.org>
To: Andrew Morton <akpm@osdl.org>
Cc: torvalds@osdl.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC][PATCH] Kernel thread signal handling.
Date: Mon, 13 Oct 2003 12:55:03 +0100 [thread overview]
Message-ID: <1066046102.14783.11.camel@hades.cambridge.redhat.com> (raw)
In-Reply-To: <20031013044042.23ab7f69.akpm@osdl.org>
On Mon, 2003-10-13 at 04:40 -0700, Andrew Morton wrote:
> People think "I need to send a message to a kernel thread" and then,
> immediately, "ah-hah! I'll use a signal!"
I've seen relatively little of this. Most of the problems I've been
aware of have been kernel threads _not_ handling signals (or handling
only SIGKILL) and going into endless loops of bouncing straight back out
of schedule().
That problem is almost unrelated -- it happens because driver writes
want to sleep in TASK_INTERRUPTIBLE state rather than
TASK_UNINTERRUPTIBLE. The fix for that is to have a per-task
'uninterruptible_count' along much the same lines as preempt_count,
where each function which is unable to handle an -EINTR return
increments the count before calling down to another function which may
have done that. But that's a 2.7 thing and mostly not related to this
particular bug.
> Sounds like the GC should have been performed by a userspace process in the
> first place?
Well, it would have to actually be done in kernel space but I suppose
there could be an ioctl or syscall or something which causes a call to
jffs2_garbage_collect_pass() to happen in the context of the caller, and
the variables which are used to decide when to wake up could be exposed
to userspace via sysfs, and the userspace daemon itself could register
with the JFFS2 code so that it gets woken when those variables change...
or maybe I could poll() on the sysfs file which contains them I
suppose...
Er, no :)
> How does userspace identify the JFFS2 process to which to send the
> signal?
daemonize("jffs2_gcd_mtd%d", c->mtd->index);
> > I don't any the benefit in changing this practice.
>
> Well I know I'm going to lose this one, but at least I get to bitch about
> stuff.
Fair enough :)
Bitching accomplished; now can we fix the bug?
--
dwmw2
next prev parent reply other threads:[~2003-10-13 11:55 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-10-13 10:31 David Woodhouse
2003-10-13 11:02 ` Andrew Morton
2003-10-13 11:08 ` Russell King
2003-10-13 11:29 ` David Woodhouse
2003-10-13 11:21 ` David Woodhouse
2003-10-13 11:40 ` Andrew Morton
2003-10-13 11:55 ` David Woodhouse [this message]
2003-10-13 12:11 ` Andrew Morton
2003-10-13 12:30 ` David Woodhouse
2003-10-13 16:36 ` Linus Torvalds
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=1066046102.14783.11.camel@hades.cambridge.redhat.com \
--to=dwmw2@infradead.org \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@osdl.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
all inboxes | Powered by JetHome®