From: Davide Libenzi <davidel@xmailserver.org>
To: Rusty Russell <rusty@rustcorp.com.au>
Cc: Linus Torvalds <torvalds@osdl.org>, Andrew Morton <akpm@osdl.org>,
<mingo@redhat.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/2] kthread_create
Date: Sat, 3 Jan 2004 11:00:55 -0800 (PST) [thread overview]
Message-ID: <Pine.LNX.4.44.0401031021280.1678-100000@bigblue.dev.mdolabs.com> (raw)
In-Reply-To: <Pine.LNX.4.44.0401021919240.825-100000@bigblue.dev.mdolabs.com>
On Fri, 2 Jan 2004, Davide Libenzi wrote:
> On Sat, 3 Jan 2004, Rusty Russell wrote:
>
> > In message <Pine.LNX.4.44.0401020856150.2278-100000@bigblue.dev.mdolabs.com> you write:
> > > Rusty, you still have to use global static data when there is no need.
> >
> > And you're still putting obscure crap in the task struct when there's
> > no need. Honestly, I'd be ashamed to post such a patch.
>
> Ashamed !? Take a look at your original patch and then define shame. You
> had a communication mechanism that whilst being a private 1<->1
> communication among two tasks, relied on a single global message
> strucure, lock and mutex. Honestly I do not like myself to add stuff
> inside a strcture for one-time use. Not because of adding 12 bytes to the
> struct, that are laughable. But because it is used by a small piece of
> code w/out a re-use ability for other things.
Rusty, I took a better look at the patch and I think we can have
per-kthread stuff w/out littering the task_struct and by making the thing
more robust. We keep a global list_head protected by a global spinlock. We
define a structure that contain all the per-kthread stuff we need
(including a task_struct* to the kthread itself). When a kthread starts it
will add itself to the list, and when it will die it will remove itself
from the list. The start/stop functions will lookup the list (or hash,
depending on how much stuff you want to drop in) with the target
task_struct*, and if the lookup fails, it means the task already quit
(another task already did kthread_stop() ??, natural death ????). This is
too bad, but at least there won't be deadlock (or crash) beacause of this.
This because currently we keep the kthread task_struct* lingering around
w/out a method that willl inform us if the task goes away for some reason
(so that we can avoid signaling it and waiting for some interaction). The
list/hash will be able to tell us this. What do you think?
- Davide
next prev parent reply other threads:[~2004-01-03 19:00 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 [this message]
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
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.0401031021280.1678-100000@bigblue.dev.mdolabs.com \
--to=davidel@xmailserver.org \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=rusty@rustcorp.com.au \
--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;
as well as URLs for NNTP newsgroup(s).