From: Paul Collins <paul@briny.ondioline.org>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: kjournald keeps reference to namespace
Date: Fri, 24 Feb 2006 21:28:19 +0000 [thread overview]
Message-ID: <873bi88n0s.fsf@briny.internal.ondioline.org> (raw)
In-Reply-To: <20060218033031.GB32706@MAIL.13thfloor.at> (Herbert Poetzl's message of "Sat, 18 Feb 2006 04:30:31 +0100")
Herbert Poetzl <herbert@13thfloor.at> writes:
> On Fri, Feb 17, 2006 at 05:54:28PM -0800, Andrew Morton wrote:
>> I think it'd be better to convert ext3 to use the kthread API which
>> appears to accidentally not have this problem, because such threads
>> are parented by keventd, which were parented by init.
>
> sounds like a plan!
Here's my attempt at such a conversion. Since jbd doesn't seem to
want to collect an exit status, I didn't bother with kthread_stop().
I got overexcited and also embedded the journal device in the process
name, but that's probably useless churn. Looks nice in pstree though:
|-kthread-+-kblockd/0
| |-khubd
| |-2*[pdflush]
| |-aio/0
| |-v9fs/0
| |-cqueue/0
| |-kfand
| |-kcryptd/0
| |-kjournald/3:3
| |-kjournald/3:8
| |-kjournald/3:4
| |-kjournald/3:5
| `-kjournald/254:1
Signed-off-by: Paul Collins <paul@ondioline.org>
diff --git a/fs/jbd/journal.c b/fs/jbd/journal.c
index e4b516a..e33d993 100644
--- a/fs/jbd/journal.c
+++ b/fs/jbd/journal.c
@@ -33,6 +33,8 @@
#include <linux/mm.h>
#include <linux/suspend.h>
#include <linux/pagemap.h>
+#include <linux/kthread.h>
+#include <linux/kdev_t.h>
#include <asm/uaccess.h>
#include <asm/page.h>
#include <linux/proc_fs.h>
@@ -115,8 +117,6 @@ static int kjournald(void *arg)
transaction_t *transaction;
struct timer_list timer;
- daemonize("kjournald");
-
/* Set up an interval timer which can be used to trigger a
commit wakeup after the commit interval expires */
init_timer(&timer);
@@ -207,12 +207,14 @@ end_loop:
journal->j_task = NULL;
wake_up(&journal->j_wait_done_commit);
jbd_debug(1, "Journal thread exiting.\n");
- return 0;
+ do_exit(0);
}
static void journal_start_thread(journal_t *journal)
{
- kernel_thread(kjournald, journal, CLONE_VM|CLONE_FS|CLONE_FILES);
+ dev_t jdev = journal->j_dev->bd_dev;
+ kthread_run(kjournald, journal, "kjournald/%d:%d",
+ MAJOR(jdev), MINOR(jdev), NULL);
wait_event(journal->j_wait_done_commit, journal->j_task != 0);
}
--
Dag vijandelijk luchtschip de huismeester is dood
next prev parent reply other threads:[~2006-02-24 21:28 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-02-18 1:35 kjournald keeps reference to namespace Herbert Poetzl
2006-02-18 1:54 ` Andrew Morton
2006-02-18 3:30 ` Herbert Poetzl
2006-02-24 21:28 ` Paul Collins [this message]
2006-02-24 21:36 ` Andrew Morton
2006-02-24 22:01 ` Paul Collins
2006-02-18 13:36 ` Björn Steinbrink
2006-02-18 16:32 ` Björn Steinbrink
2006-02-18 17:12 ` Björn Steinbrink
2006-02-19 2:32 ` Eric W. Biederman
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=873bi88n0s.fsf@briny.internal.ondioline.org \
--to=paul@briny.ondioline.org \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.