From: Davide Libenzi <davidel@xmailserver.org>
To: Rusty Russell <rusty@rustcorp.com.au>
Cc: mingo@redhat.com,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/2] kthread_create
Date: Sun, 4 Jan 2004 21:06:06 -0800 (PST) [thread overview]
Message-ID: <Pine.LNX.4.44.0401042100510.15831-100000@bigblue.dev.mdolabs.com> (raw)
In-Reply-To: <20040105043139.B8D642C10E@lists.samba.org>
On Mon, 5 Jan 2004, Rusty Russell wrote:
> In message <Pine.LNX.4.44.0401041501510.12666-100000@bigblue.dev.mdolabs.com> you write:
> > I can see two options:
> >
> > 1) We do not allow do_exit() from kthreads
> >
> > 2) We give kthread_exit()
> >
> > What do you think?
>
> Well, I've now got a patch which works without any global
> datastructures, but still allows the same semantics. Includes some
> fixes in the previous code, and test code.
>
> Also includes a longstanding fix in workqueue.c: we never get SIGCHLD
> if signal handler is SIG_IGN.
>
> I'm not sure it's neater, though. We don't have WIFEXITED() in the
> kernel, so lots of manual shifting, probably should add that
> somewhere.
>
> Thoughts?
Honestly I do not like playing with SIGCLD/waitpid for things that do not
concern real task exits. But I think it can be avoided, and actually I
don't know why I did not think about this before. We don't need to return
a struct task_struct* for kthread_create(). We can have:
struct kthread_struct {
struct task_struct *tsk;
int ret;
struct semaphore ack; /* Or completion if you like */
};
This structure is allocated in kthread_create() and propagated to the
kthread() void* data. Then they (the creator and the kthread) will have a
common ground to exchange acks w/out playing with SIGCLD/waitpid. Heh ?
- Davide
next prev parent reply other threads:[~2004-01-05 5:06 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-12-31 3:31 [PATCH 1/2] kthread_create Rusty Russell
2003-12-31 4:33 ` Jeff Garzik
2003-12-31 5:28 ` Rusty Russell
2003-12-31 6:34 ` Jeff Garzik
2003-12-31 8:47 ` Benjamin Herrenschmidt
2004-01-01 23:51 ` Rusty Russell
2003-12-31 4:49 ` Andrew Morton
2003-12-31 5:18 ` Rusty Russell
2003-12-31 5:06 ` Davide Libenzi
2003-12-31 5:34 ` Rusty Russell
2003-12-31 5:56 ` Davide Libenzi
2003-12-31 6:27 ` Rusty Russell
2004-01-01 3:45 ` Davide Libenzi
2004-01-02 7:09 ` Rusty Russell
2004-01-02 16:58 ` Davide Libenzi
2004-01-03 3:05 ` Rusty Russell
2004-01-03 3:43 ` Davide Libenzi
2004-01-03 11:47 ` Rusty Russell
2004-01-04 4:23 ` Davide Libenzi
2004-03-29 15:42 ` Davide Libenzi
2004-01-03 19:00 ` Davide Libenzi
2004-01-03 23:53 ` Davide Libenzi
2004-01-04 2:34 ` Rusty Russell
2004-01-04 4:42 ` Davide Libenzi
2004-01-04 4:55 ` Davide Libenzi
2004-01-04 9:35 ` Rusty Russell
2004-01-04 23:03 ` Davide Libenzi
2004-01-05 4:09 ` Rusty Russell
2004-01-05 5:06 ` Davide Libenzi [this message]
2004-01-05 6:38 ` Rusty Russell
2004-01-05 6:52 ` Davide Libenzi
2004-01-07 7:00 ` Rusty Russell
2004-01-07 7:25 ` Davide Libenzi
2004-01-08 0:33 ` Rusty Russell
2004-03-29 15:42 ` Davide Libenzi
2004-03-29 15:42 ` Davide Libenzi
2004-03-29 15:41 ` Davide Libenzi
2004-03-29 15:42 ` Rusty Russell
2004-03-29 15:40 ` Davide Libenzi
2004-03-29 15:41 ` Rusty Russell
2004-03-29 15:39 ` Davide Libenzi
2004-03-29 15:39 ` Rusty Russell
2004-03-29 15:38 ` Davide Libenzi
2003-12-31 6:31 ` Srivatsa Vaddagiri
2003-12-31 7:12 ` Davide Libenzi
2003-12-31 23:25 ` Rusty Russell
2003-12-31 18:02 Albert Cahalan
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=Pine.LNX.4.44.0401042100510.15831-100000@bigblue.dev.mdolabs.com \
--to=davidel@xmailserver.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=rusty@rustcorp.com.au \
/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).