Message ID | 1238088937-10994-3-git-send-email-jlayton@redhat.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
It is a much higher priority to add dnotify code back in (it is long overdue), but if I don't hear back from anyone trying to add it back in (I agree that the thread would change) then I will remove this last piece of the dnotify code (but it is important that we don't forget to add it back in - dnotify or inotify is important for kde and gnome) On Thu, Mar 26, 2009 at 12:35 PM, 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.6 > >
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); }
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(-)