Skip to contentSkip to conversation

cifs: wrap cifs_dnotify_thread in CONFIG_BROKEN

PATCH In review Jeff Layton 3 participants 8 messages Jan 22, 2009 – Jan 23, 2009 VFS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cifs: wrap cifs_dnotify_thread in CONFIG_BROKEN

This thread never actually did anything useful, so comment it out by #ifdef'ing it in CONFIG_BROKEN. My preference would be to remove it altogether, but it's not my call.

---
 fs/cifs/cifsfs.c |   13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)
fs/cifs/cifsfs.c +6 -7
index 13ea532..5a9ed5f 100644
@@ -65,9 +65,8 @@ unsigned int extended_security = CIFSSEC_DEF;
 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;
+#ifdef CONFIG_BROKEN
+static struct task_struct *dnotifyThread;
 #endif
 static const struct super_operations cifs_super_ops;
 unsigned int CIFSMaxBufSize = CIFS_MAX_MSGSIZE;
@@ -1039,7 +1038,7 @@ static int cifs_oplock_thread(void *dummyarg)
 	return 0;
 }
 
-#ifdef CONFIG_CIFS_EXPERIMENTAL
+#ifdef CONFIG_BROKEN
 static int cifs_dnotify_thread(void *dummyarg)
 {
 	struct list_head *tmp;
@@ -1143,7 +1142,7 @@ init_cifs(void)
 		goto out_unregister_dfs_key_type;
 	}
 
-#ifdef CONFIG_CIFS_EXPERIMENTAL
+#ifdef CONFIG_BROKEN
 	dnotifyThread = kthread_run(cifs_dnotify_thread, NULL, "cifsdnotifyd");
 	if (IS_ERR(dnotifyThread)) {
 		rc = PTR_ERR(dnotifyThread);
@@ -1154,7 +1153,7 @@ init_cifs(void)
 
 	return 0;
 
-#ifdef CONFIG_CIFS_EXPERIMENTAL
+#ifdef CONFIG_BROKEN
  out_stop_oplock_thread:
 #endif
 	kthread_stop(oplockThread);
@@ -1195,7 +1194,7 @@ exit_cifs(void)
 	cifs_destroy_inodecache();
 	cifs_destroy_mids();
 	cifs_destroy_request_bufs();
-#ifdef CONFIG_CIFS_EXPERIMENTAL
+#ifdef CONFIG_BROKEN
 	kthread_stop(dnotifyThread);
 #endif
 	kthread_stop(oplockThread);
Signature · 1 line
1.5.5.6
#1 lore raw
Quoted 3 lines · Jeff Layton

This thread never actually did anything useful, so comment it out by #ifdef'ing it in CONFIG_BROKEN. My preference would be to remove it altogether, but it's not my call.

Please just kill it. It's not only useless but also ugly, so keeping it around it a double disservice to the mother nature.

#2 lore raw

The thread may be renamed/rewritten etc. - but we badly need to finish the dnotify / inotify code ... removing the start on this that someone wrote in the past isn't getting us any closer to this.

dnotify/inotify support was added to Linux in the first place because Samba used it to handle this common operation (it is commonly used by OTHER cifs clients) ... but none of the Linux cluster/network file systems have had time to finish the code ... we need to finish this - the network protocol portion of this is now well documented (and we presumably will need a thread to process the dnotify multishot notification responses so we don't clog up the demultiplex thread waiting on kde and gnoe)

Quoted 9 lines · Christoph Hellwig
Quoted 3 lines · Jeff Layton

This thread never actually did anything useful, so comment it out by #ifdef'ing it in CONFIG_BROKEN. My preference would be to remove it altogether, but it's not my call.

Please just kill it. It's not only useless but also ugly, so keeping it around it a double disservice to the mother nature.

Signature · 3 lines
Thanks,

Steve
#3 lore raw
Quoted 4 lines · On Thu, 22 Jan 2009 17:13:37 -0600 Steve French <[email protected]> wrote:

The thread may be renamed/rewritten etc. - but we badly need to finish the dnotify / inotify code ... removing the start on this that someone wrote in the past isn't getting us any closer to this.

Quoted 9 lines

dnotify/inotify support was added to Linux in the first place because Samba used it to handle this common operation (it is commonly used by OTHER cifs clients) ... but none of the Linux cluster/network file systems have had time to finish the code ... we need to finish this - the network protocol portion of this is now well documented (and we presumably will need a thread to process the dnotify multishot notification responses so we don't clog up the demultiplex thread waiting on kde and gnoe)

Removing this kthread won't measurably move us farther away from that goal either.

It's currently under CONFIG_CIFS_EXPERIMENTAL, which would be fine if it actually did something. It doesn't though -- it just wakes up tasks that don't need to be woken up.

I have no issue with a kthread that does useful work, but why not remove this kthread out of the mainline code for now and just plan to put it back when it actually has something useful to do?

The patch that removes it will live in perpetuity in git. It'll be a trivial matter to revert it when you're ready to have the kthread do real work.

Signature · 1 line
Jeff Layton <[email protected]>
#4 lore raw

IIRC ... the original suggestion that was made and partially implemented a few years ago (code was disabled at runtime, not just wrapped in an ifdef originally) was that cifs_demultiplex_thread would take the incoming responses from the server for cifs multishot notify
smbs and queue them to a dnotify queue. The cifs dnotify thread was
inteneded to -- only -- process the items in the dnotify queue, parse the response to see which of the inline worker functions (in include/linux/fsnotify.h e.g. fsnotify_create) ineeds to be called, check if we have a dnotify or inotify for the corresponding inode and call the generic hook (e.g. fsnotify_d_move or fsnotify_nameremove or
fsnotify_create etc.). Adding something like that back in would be
easy enough and wrapping inside an ifdef ... but the people who understand more about inotify presumably don't know about CIFS or SMB2 etc. so it is not likely to be implemented as one step ... but needs to be staged in.

Quoted 35 lines · Jeff Layton
Quoted 4 lines · On Thu, 22 Jan 2009 17:13:37 -0600 Steve French <[email protected]> wrote:

The thread may be renamed/rewritten etc. - but we badly need to finish the dnotify / inotify code ... removing the start on this that someone wrote in the past isn't getting us any closer to this.

Quoted 9 lines

dnotify/inotify support was added to Linux in the first place because Samba used it to handle this common operation (it is commonly used by OTHER cifs clients) ... but none of the Linux cluster/network file systems have had time to finish the code ... we need to finish this - the network protocol portion of this is now well documented (and we presumably will need a thread to process the dnotify multishot notification responses so we don't clog up the demultiplex thread waiting on kde and gnoe)

Removing this kthread won't measurably move us farther away from that goal either.

It's currently under CONFIG_CIFS_EXPERIMENTAL, which would be fine if it actually did something. It doesn't though -- it just wakes up tasks that don't need to be woken up.

I have no issue with a kthread that does useful work, but why not remove this kthread out of the mainline code for now and just plan to put it back when it actually has something useful to do?

The patch that removes it will live in perpetuity in git. It'll be a trivial matter to revert it when you're ready to have the kthread do real work.

--
Jeff Layton <[email protected]>

Signature · 3 lines
Thanks,

Steve
#5 lore raw

One of the obvious reasons that we could throw away the idea of a cifs dnotify thread for cifs is if we could guarantee that all of the functions in include/linux/fsnotify.h are nonblocking. If the fsnotify.h worker functions are nonblocking then we could safely process all of the notify responses in cifs_demultiplex_thread (since we wouldn't have to queue them) without clogging up response
processing for the socket. Note that notify responses are unusual -
they don't have an application thread waiting on them ("multishot" responses) typically (there is only one other type of SMB response that does not have an application thread associated with it).

Quoted 60 lines · Steve French

IIRC ... the original suggestion that was made and partially implemented a few years ago (code was disabled at runtime, not just wrapped in an ifdef originally) was that cifs_demultiplex_thread would take the incoming responses from the server for cifs multishot notify
smbs and queue them to a dnotify queue. The cifs dnotify thread was
inteneded to -- only -- process the items in the dnotify queue, parse the response to see which of the inline worker functions (in include/linux/fsnotify.h e.g. fsnotify_create) ineeds to be called, check if we have a dnotify or inotify for the corresponding inode and call the generic hook (e.g. fsnotify_d_move or fsnotify_nameremove or
fsnotify_create etc.). Adding something like that back in would be
easy enough and wrapping inside an ifdef ... but the people who understand more about inotify presumably don't know about CIFS or SMB2 etc. so it is not likely to be implemented as one step ... but needs to be staged in.

Quoted 28 lines · Jeff Layton
Quoted 4 lines · On Thu, 22 Jan 2009 17:13:37 -0600 Steve French <[email protected]> wrote:

The thread may be renamed/rewritten etc. - but we badly need to finish the dnotify / inotify code ... removing the start on this that someone wrote in the past isn't getting us any closer to this.

Quoted 9 lines

dnotify/inotify support was added to Linux in the first place because Samba used it to handle this common operation (it is commonly used by OTHER cifs clients) ... but none of the Linux cluster/network file systems have had time to finish the code ... we need to finish this - the network protocol portion of this is now well documented (and we presumably will need a thread to process the dnotify multishot notification responses so we don't clog up the demultiplex thread waiting on kde and gnoe)

Removing this kthread won't measurably move us farther away from that goal either.

It's currently under CONFIG_CIFS_EXPERIMENTAL, which would be fine if it actually did something. It doesn't though -- it just wakes up tasks that don't need to be woken up.

I have no issue with a kthread that does useful work, but why not remove this kthread out of the mainline code for now and just plan to put it back when it actually has something useful to do?

Quoted 7 lines

The patch that removes it will live in perpetuity in git. It'll be a trivial matter to revert it when you're ready to have the kthread do real work.

--
Jeff Layton <[email protected]>

--
Thanks,

Steve

Signature · 3 lines
Thanks,

Steve
#6 lore raw
Quoted 11 lines · On Thu, 22 Jan 2009 17:56:09 -0600 Steve French <[email protected]> wrote:

One of the obvious reasons that we could throw away the idea of a cifs dnotify thread for cifs is if we could guarantee that all of the functions in include/linux/fsnotify.h are nonblocking. If the fsnotify.h worker functions are nonblocking then we could safely process all of the notify responses in cifs_demultiplex_thread (since we wouldn't have to queue them) without clogging up response
processing for the socket. Note that notify responses are unusual -
they don't have an application thread waiting on them ("multishot" responses) typically (there is only one other type of SMB response that does not have an application thread associated with it).

I'm not arguing against the need for a kthread to handle notifications. Heck, I'm even ok with more than one thread if it's necessary.

We simply don't have such an implementation today. Until we do, this kthread is just dead weight. There's simply no need to keep this in place until we have working code that uses it.

Signature · 1 line
Jeff Layton <[email protected]>
#7 lore raw
In reply to Jeff Layton
Quoted 7 lines · Jeff Layton

Removing this kthread won't measurably move us farther away from that goal either.

It's currently under CONFIG_CIFS_EXPERIMENTAL, which would be fine if it actually did something. It doesn't though -- it just wakes up tasks that don't need to be woken up.

Quoted 7 lines

I have no issue with a kthread that does useful work, but why not remove this kthread out of the mainline code for now and just plan to put it back when it actually has something useful to do?

The patch that removes it will live in perpetuity in git. It'll be a trivial matter to revert it when you're ready to have the kthread do real work.

Yeah. Currently it's useless code. If a proper *notify implementation for cifs still needs a thread it can be added with that implementation, and I'm sure it'll look very different from the current one (at least after review..)