From: "Steve French" <smfrench@gmail.com>
To: "Jeff Layton" <jlayton@redhat.com>
Cc: linux-kernel@vger.kernel.org, niallain@gmail.com,
linux-cifs-client@lists.samba.org
Subject: Re: [PATCH 2/5] cifs: eliminate usage of kthread_stop for cifsd
Date: Tue, 14 Oct 2008 20:29:31 -0500 [thread overview]
Message-ID: <524f69650810141829u2d708e4axe47a8a78a2b72941@mail.gmail.com> (raw)
In-Reply-To: <1224031267-17194-3-git-send-email-jlayton@redhat.com>
On Tue, Oct 14, 2008 at 7:41 PM, Jeff Layton <jlayton@redhat.com> wrote:
> When cifs_demultiplex_thread was converted to a kthread based kernel
> thread, great pains were taken to make it so that kthread_stop would be
> used to bring it down. This just added unnecessary complexity since we
> needed to use a signal anyway to break out of kernel_recvmsg.
>
> Also, cifs_demultiplex_thread does a bit of cleanup as it's exiting, and
> we need to be certain that this gets done. It's possible for a kthread
> to exit before its main function is ever run if kthread_stop is called
> soon after its creation. While I'm not sure that this is a real problem
> with cifsd now, it could be at some point in the future if cifs_mount is
> ever changed to bring down the thread quickly.
>
> The upshot here is that using kthread_stop to bring down the thread just
> adds extra complexity with no real benefit. This patch changes the code
> to use the original method to bring down the thread, but still leaves it
> so that the thread is actually started with kthread_run.
>
> This seems to fix the deadlock caused by the reproducer in this bug
> report:
>
> https://bugzilla.samba.org/show_bug.cgi?id=5720
I agree with what Jeff is suggesting in this patch, and have no
problem merging the patch, but want to make sure that those who wanted
cifs to switch all of cifs threads to kthread usage are also ok with
this.
I don't like the patch 1 (disabling a section of code code) and 5
(basically reenabling similar code fixing some problems) though - has
to be a better way to do this by rewriting the function once.
--
Thanks,
Steve
next prev parent reply other threads:[~2008-10-15 1:29 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-15 0:41 [PATCH 0/5] cifs: fix deadlocks, oopses and mem corruption with concurrent mount/umount (try #2 resend) Jeff Layton
2008-10-15 0:41 ` [PATCH 1/5] cifs: disable sharing of server, session and tcon Jeff Layton
2008-10-15 0:41 ` [PATCH 2/5] cifs: eliminate usage of kthread_stop for cifsd Jeff Layton
2008-10-15 1:29 ` Steve French [this message]
2008-10-15 10:33 ` Jeff Layton
2008-10-15 0:41 ` [PATCH 3/5] cifs: handle the TCP_Server_Info->tsk field more carefully Jeff Layton
2008-10-15 0:41 ` [PATCH 4/5] cifs: clean up server protocol handling for TCP_Server_Info Jeff Layton
2008-10-15 0:41 ` [PATCH 5/5] cifs: add global TCP session list and reenable TCP session sharing Jeff Layton
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=524f69650810141829u2d708e4axe47a8a78a2b72941@mail.gmail.com \
--to=smfrench@gmail.com \
--cc=jlayton@redhat.com \
--cc=linux-cifs-client@lists.samba.org \
--cc=linux-kernel@vger.kernel.org \
--cc=niallain@gmail.com \
/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®