From: "Steve French" <smfrench@gmail.com>
To: "Jeff Layton" <jlayton@redhat.com>
Cc: linux-cifs-client@lists.samba.org, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH] cifs: remove dnotify thread code
Date: Thu, 8 Jan 2009 08:23:49 -0600 [thread overview]
Message-ID: <524f69650901080623s228c343eka791c089c878167@mail.gmail.com> (raw)
In-Reply-To: <1231424128-5598-1-git-send-email-jlayton@redhat.com>
We really need to revisit the dnotify/inotify code ... the SMB spec
lists what the protocol allows, but AFAIK no one has had a chance to
prototype this. It is among the highest priority features still
needed to implement in cifs.
As we have talked about before, dnotify (or inotify) is even more
useful for network file systems than local file systems (since the
alternative, polling, is too expensive to do over the network). CIFS
and SMB2 protocols, unlike NFS, has a mechanism to handle dnotify, but
mapping it to the VFS has not been investigated sufficiently
On Thu, Jan 8, 2009 at 8:15 AM, Jeff Layton <jlayton@redhat.com> wrote:
> Al Viro recently removed the dir_notify code from the kernel along with
> the CIFS code that used it. We can also get rid of the dnotify thread
> as well.
>
> In actuality, it never had anything to do with dir_notify anyway. All
> it did was unnecessarily wake up all the tasks waiting on the response
> queues every 15s. Previously that happened to prevent tasks from hanging
> indefinitely when the server went unresponsive, but we put those to
> sleep with proper timeouts now so there's no reason to keep this around.
>
> Signed-off-by: Jeff Layton <jlayton@redhat.com>
> ---
> fs/cifs/cifsfs.c | 47 -----------------------------------------------
> 1 files changed, 0 insertions(+), 47 deletions(-)
>
> diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
> index 13ea532..5626af2 100644
> --- a/fs/cifs/cifsfs.c
> +++ b/fs/cifs/cifsfs.c
> @@ -66,9 +66,6 @@ unsigned int sign_CIFS_PDUs = 1;
> extern struct task_struct *oplockThread; /* remove sparse warning */
> struct task_struct *oplockThread = NULL;
> /* extern struct task_struct * dnotifyThread; remove sparse warning */
> -#ifdef CONFIG_CIFS_EXPERIMENTAL
> -static struct task_struct *dnotifyThread = NULL;
> -#endif
> static const struct super_operations cifs_super_ops;
> unsigned int CIFSMaxBufSize = CIFS_MAX_MSGSIZE;
> module_param(CIFSMaxBufSize, int, 0);
> @@ -1039,34 +1036,6 @@ static int cifs_oplock_thread(void *dummyarg)
> return 0;
> }
>
> -#ifdef CONFIG_CIFS_EXPERIMENTAL
> -static int cifs_dnotify_thread(void *dummyarg)
> -{
> - struct list_head *tmp;
> - struct TCP_Server_Info *server;
> -
> - do {
> - if (try_to_freeze())
> - continue;
> - set_current_state(TASK_INTERRUPTIBLE);
> - schedule_timeout(15*HZ);
> - /* check if any stuck requests that need
> - to be woken up and wakeq so the
> - thread can wake up and error out */
> - read_lock(&cifs_tcp_ses_lock);
> - list_for_each(tmp, &cifs_tcp_ses_list) {
> - server = list_entry(tmp, struct TCP_Server_Info,
> - tcp_ses_list);
> - if (atomic_read(&server->inFlight))
> - wake_up_all(&server->response_q);
> - }
> - read_unlock(&cifs_tcp_ses_lock);
> - } while (!kthread_should_stop());
> -
> - return 0;
> -}
> -#endif
> -
> static int __init
> init_cifs(void)
> {
> @@ -1143,21 +1112,8 @@ init_cifs(void)
> goto out_unregister_dfs_key_type;
> }
>
> -#ifdef CONFIG_CIFS_EXPERIMENTAL
> - dnotifyThread = kthread_run(cifs_dnotify_thread, NULL, "cifsdnotifyd");
> - if (IS_ERR(dnotifyThread)) {
> - rc = PTR_ERR(dnotifyThread);
> - cERROR(1, ("error %d create dnotify thread", rc));
> - goto out_stop_oplock_thread;
> - }
> -#endif
> -
> return 0;
>
> -#ifdef CONFIG_CIFS_EXPERIMENTAL
> - out_stop_oplock_thread:
> -#endif
> - kthread_stop(oplockThread);
> out_unregister_dfs_key_type:
> #ifdef CONFIG_CIFS_DFS_UPCALL
> unregister_key_type(&key_type_dns_resolver);
> @@ -1195,9 +1151,6 @@ exit_cifs(void)
> cifs_destroy_inodecache();
> cifs_destroy_mids();
> cifs_destroy_request_bufs();
> -#ifdef CONFIG_CIFS_EXPERIMENTAL
> - kthread_stop(dnotifyThread);
> -#endif
> kthread_stop(oplockThread);
> }
>
> --
> 1.5.5.1
>
>
--
Thanks,
Steve
next prev parent reply other threads:[~2009-01-08 14:23 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-08 14:15 [PATCH] cifs: remove dnotify thread code Jeff Layton
2009-01-08 14:23 ` Steve French [this message]
2009-01-08 14:51 ` Jeff Layton
2009-01-09 0:07 ` Jamie Lokier
2009-01-09 1:28 ` Jeff Layton
2009-01-10 1:35 ` Jamie Lokier
2009-01-10 1:41 ` Jamie Lokier
2009-01-10 18:19 ` Steve French
2009-01-09 3:32 ` Steve French
2009-01-09 11:33 ` Jeff Layton
2009-01-09 16:18 ` Steve French
2009-01-09 18:07 ` Jeff Layton
2009-01-09 18:18 ` Al Viro
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=524f69650901080623s228c343eka791c089c878167@mail.gmail.com \
--to=smfrench@gmail.com \
--cc=jlayton@redhat.com \
--cc=linux-cifs-client@lists.samba.org \
--cc=linux-fsdevel@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 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).