From: Christoph Hellwig <hch@lst.de>
To: Trond Myklebust <trond.myklebust@fys.uio.no>
Cc: torvalds@transmeta.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] remove useless MOD_{INC,DEC}_USE_COUNT from sunrpc
Date: Sun, 4 May 2003 20:53:06 +0200 [thread overview]
Message-ID: <20030504205306.A11647@lst.de> (raw)
In-Reply-To: <16053.24599.277205.64363@charged.uio.no>; from trond.myklebust@fys.uio.no on Sun, May 04, 2003 at 08:46:47PM +0200
On Sun, May 04, 2003 at 08:46:47PM +0200, Trond Myklebust wrote:
> > What do you thing about something like the following to wait on
> > the thread in module_exit()?
>
> I don't understand. That is still an interruptible wait, so how would
> that help?
It doesn't :) Sorry, the code should use wait_even(), the
_interruptible was a pasto..
> What is wrong with just assuming that the rpciod() thread might need
> to run independently of the calling module for a short period of time
> in order to kill/clean up the pending tasks?
That's fine and the patch doesn't change anything about the assumption.
If just changes how to make sure the sunrpc module can't be unloaded
during that period. Previously you incremented the usecount and now
we're waiting for the thread to finish in module_exit().
--- 1.10/include/linux/sunrpc/sched.h Sun Jan 12 16:40:13 2003
+++ edited/include/linux/sunrpc/sched.h Sun May 4 19:08:09 2003
@@ -188,6 +188,7 @@
int rpciod_up(void);
void rpciod_down(void);
void rpciod_wake_up(void);
+void wait_on_rpciod(void);
#ifdef RPC_DEBUG
void rpc_show_tasks(void);
#endif
--- 1.24/net/sunrpc/sched.c Thu Mar 27 12:42:11 2003
+++ edited/net/sunrpc/sched.c Sun May 4 19:07:42 2003
@@ -1097,6 +1092,12 @@
spin_unlock_irqrestore(¤t->sighand->siglock, flags);
out:
up(&rpciod_sema);
+}
+
+void
+wait_on_rpciod(void)
+{
+ wait_event(&rpciod_killer, !rpciod_pid);
}
#ifdef RPC_DEBUG
next prev parent reply other threads:[~2003-05-04 18:40 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-05-04 17:14 [PATCH] remove useless MOD_{INC,DEC}_USE_COUNT from sunrpc Christoph Hellwig
2003-05-04 17:37 ` Trond Myklebust
2003-05-04 18:36 ` Christoph Hellwig
2003-05-04 18:46 ` Trond Myklebust
2003-05-04 18:53 ` Christoph Hellwig [this message]
2003-05-04 19:00 ` Trond Myklebust
2003-05-04 19:06 ` David S. Miller
2003-05-04 19:56 ` Trond Myklebust
2003-05-04 20:14 ` Trond Myklebust
2003-05-04 21:00 ` Christoph Hellwig
2003-05-04 20:15 ` David S. Miller
2003-05-05 8:29 ` Christoph Hellwig
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=20030504205306.A11647@lst.de \
--to=hch@lst.de \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@transmeta.com \
--cc=trond.myklebust@fys.uio.no \
/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