linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] [fs-devel] the real needs of just_schedule
@ 2008-05-06 17:51 Denis Cheng
  2008-05-06 17:51 ` [PATCH 2/2] [GFS2] remove the duplicates " Denis Cheng
  2008-05-08 13:11 ` [PATCH 1/2] [fs-devel] the real needs " Steven Whitehouse
  0 siblings, 2 replies; 4+ messages in thread
From: Denis Cheng @ 2008-05-06 17:51 UTC (permalink / raw)
  To: Al Viro, Steven Whitehouse; +Cc: linux-fsdevel, cluster-devel, linux-kernel

there are some situations which really need a just schedule,
with int return value;
and this should be moved into lib/ in the future.

Signed-off-by: Denis Cheng <crquan@gmail.com>
---
 fs/inode.c                |    2 +-
 include/linux/writeback.h |   16 ++++++++++++----
 2 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/fs/inode.c b/fs/inode.c
index bf64781..b355a44 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -1291,7 +1291,7 @@ int inode_needs_sync(struct inode *inode)
 
 EXPORT_SYMBOL(inode_needs_sync);
 
-int inode_wait(void *word)
+int just_schedule(void *word)
 {
 	schedule();
 	return 0;
diff --git a/include/linux/writeback.h b/include/linux/writeback.h
index f462439..80ff5eb 100644
--- a/include/linux/writeback.h
+++ b/include/linux/writeback.h
@@ -67,23 +67,31 @@ struct writeback_control {
 
 /*
  * fs/fs-writeback.c
- */	
+ */
 void writeback_inodes(struct writeback_control *wbc);
-int inode_wait(void *);
 void sync_inodes_sb(struct super_block *, int wait);
 void sync_inodes(int wait);
 
+/*
+ * fs/inode.c
+ *
+ * there are some situations which really need a just schedule,
+ * with int return value;
+ * and this should be moved into lib/ in the future.
+ */
+int just_schedule(void *);
+
 /* writeback.h requires fs.h; it, too, is not included from here. */
 static inline void wait_on_inode(struct inode *inode)
 {
 	might_sleep();
-	wait_on_bit(&inode->i_state, __I_LOCK, inode_wait,
+	wait_on_bit(&inode->i_state, __I_LOCK, just_schedule,
 							TASK_UNINTERRUPTIBLE);
 }
 static inline void inode_sync_wait(struct inode *inode)
 {
 	might_sleep();
-	wait_on_bit(&inode->i_state, __I_SYNC, inode_wait,
+	wait_on_bit(&inode->i_state, __I_SYNC, just_schedule,
 							TASK_UNINTERRUPTIBLE);
 }
 
-- 
1.5.5.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] [GFS2] remove the duplicates of just_schedule
  2008-05-06 17:51 [PATCH 1/2] [fs-devel] the real needs of just_schedule Denis Cheng
@ 2008-05-06 17:51 ` Denis Cheng
  2008-05-08 13:11 ` [PATCH 1/2] [fs-devel] the real needs " Steven Whitehouse
  1 sibling, 0 replies; 4+ messages in thread
From: Denis Cheng @ 2008-05-06 17:51 UTC (permalink / raw)
  To: Al Viro, Steven Whitehouse; +Cc: linux-fsdevel, cluster-devel, linux-kernel

Accroding to the former patch, just_schedule is available from fs/inode.c

Signed-off-by: Denis Cheng <crquan@gmail.com>
---
 fs/gfs2/glock.c                |    7 +------
 fs/gfs2/locking/dlm/lock.c     |    9 ++-------
 fs/gfs2/locking/dlm/lock_dlm.h |    1 +
 3 files changed, 4 insertions(+), 13 deletions(-)

diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
index d636b3e..b39d827 100644
--- a/fs/gfs2/glock.c
+++ b/fs/gfs2/glock.c
@@ -29,6 +29,7 @@
 #include <linux/freezer.h>
 #include <linux/workqueue.h>
 #include <linux/jiffies.h>
+#include <linux/writeback.h>
 
 #include "gfs2.h"
 #include "incore.h"
@@ -454,12 +455,6 @@ static void gfs2_holder_wake(struct gfs2_holder *gh)
 	wake_up_bit(&gh->gh_iflags, HIF_WAIT);
 }
 
-static int just_schedule(void *word)
-{
-        schedule();
-        return 0;
-}
-
 static void wait_on_holder(struct gfs2_holder *gh)
 {
 	might_sleep();
diff --git a/fs/gfs2/locking/dlm/lock.c b/fs/gfs2/locking/dlm/lock.c
index cf7ea8a..2fb91a4 100644
--- a/fs/gfs2/locking/dlm/lock.c
+++ b/fs/gfs2/locking/dlm/lock.c
@@ -399,12 +399,6 @@ static void gdlm_del_lvb(struct gdlm_lock *lp)
 	lp->lksb.sb_lvbptr = NULL;
 }
 
-static int gdlm_ast_wait(void *word)
-{
-	schedule();
-	return 0;
-}
-
 /* This can do a synchronous dlm request (requiring a lock_dlm thread to get
    the completion) because gfs won't call hold_lvb() during a callback (from
    the context of a lock_dlm thread). */
@@ -433,7 +427,8 @@ static int hold_null_lock(struct gdlm_lock *lp)
 	set_bit(LFL_AST_WAIT, &lpn->flags);
 
 	gdlm_do_lock(lpn);
-	wait_on_bit(&lpn->flags, LFL_AST_WAIT, gdlm_ast_wait, TASK_UNINTERRUPTIBLE);
+	wait_on_bit(&lpn->flags, LFL_AST_WAIT, just_schedule,
+			TASK_UNINTERRUPTIBLE);
 	error = lpn->lksb.sb_status;
 	if (error) {
 		printk(KERN_INFO "lock_dlm: hold_null_lock dlm error %d\n",
diff --git a/fs/gfs2/locking/dlm/lock_dlm.h b/fs/gfs2/locking/dlm/lock_dlm.h
index a243cf6..407d00d 100644
--- a/fs/gfs2/locking/dlm/lock_dlm.h
+++ b/fs/gfs2/locking/dlm/lock_dlm.h
@@ -22,6 +22,7 @@
 #include <linux/kobject.h>
 #include <linux/fcntl.h>
 #include <linux/wait.h>
+#include <linux/writeback.h>
 #include <net/sock.h>
 
 #include <linux/dlm.h>
-- 
1.5.5.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] [fs-devel] the real needs of just_schedule
  2008-05-06 17:51 [PATCH 1/2] [fs-devel] the real needs of just_schedule Denis Cheng
  2008-05-06 17:51 ` [PATCH 2/2] [GFS2] remove the duplicates " Denis Cheng
@ 2008-05-08 13:11 ` Steven Whitehouse
  2008-05-08 18:30   ` rae l
  1 sibling, 1 reply; 4+ messages in thread
From: Steven Whitehouse @ 2008-05-08 13:11 UTC (permalink / raw)
  To: Denis Cheng; +Cc: Al Viro, linux-fsdevel, cluster-devel, linux-kernel

Hi,

On Wed, 2008-05-07 at 01:51 +0800, Denis Cheng wrote:
> there are some situations which really need a just schedule,
> with int return value;
> and this should be moved into lib/ in the future.
> 
> Signed-off-by: Denis Cheng <crquan@gmail.com>
> ---
>  fs/inode.c                |    2 +-
>  include/linux/writeback.h |   16 ++++++++++++----
>  2 files changed, 13 insertions(+), 5 deletions(-)
> 
> diff --git a/fs/inode.c b/fs/inode.c
> index bf64781..b355a44 100644
> --- a/fs/inode.c
> +++ b/fs/inode.c
> @@ -1291,7 +1291,7 @@ int inode_needs_sync(struct inode *inode)
>  
>  EXPORT_SYMBOL(inode_needs_sync);
>  
> -int inode_wait(void *word)
> +int just_schedule(void *word)
>  {
>  	schedule();
>  	return 0;
> diff --git a/include/linux/writeback.h b/include/linux/writeback.h
> index f462439..80ff5eb 100644
> --- a/include/linux/writeback.h
> +++ b/include/linux/writeback.h
> @@ -67,23 +67,31 @@ struct writeback_control {
>  
>  /*
>   * fs/fs-writeback.c
> - */	
> + */
>  void writeback_inodes(struct writeback_control *wbc);
> -int inode_wait(void *);
>  void sync_inodes_sb(struct super_block *, int wait);
>  void sync_inodes(int wait);
>  
> +/*
> + * fs/inode.c
> + *
> + * there are some situations which really need a just schedule,
> + * with int return value;
> + * and this should be moved into lib/ in the future.
> + */
> +int just_schedule(void *);
> +
Why is now not a good time? :-)

The patches look ok to me otherwise, but I wonder whether I should put
them in my tree (since they affect core code) or whether they'd be
better in -mm and/or linux-next?

Steve.



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] [fs-devel] the real needs of just_schedule
  2008-05-08 13:11 ` [PATCH 1/2] [fs-devel] the real needs " Steven Whitehouse
@ 2008-05-08 18:30   ` rae l
  0 siblings, 0 replies; 4+ messages in thread
From: rae l @ 2008-05-08 18:30 UTC (permalink / raw)
  To: Steven Whitehouse; +Cc: Al Viro, linux-fsdevel, cluster-devel, linux-kernel

On Thu, May 8, 2008 at 9:11 PM, Steven Whitehouse <swhiteho@redhat.com> wrote:
> Hi,
>
>  On Wed, 2008-05-07 at 01:51 +0800, Denis Cheng wrote:
>  > there are some situations which really need a just schedule,
>  > with int return value;
>  > and this should be moved into lib/ in the future.
>  >
>  > Signed-off-by: Denis Cheng <crquan@gmail.com>
>  > ---
>  >  fs/inode.c                |    2 +-
>  >  include/linux/writeback.h |   16 ++++++++++++----
>  >  2 files changed, 13 insertions(+), 5 deletions(-)
>  >
>  > diff --git a/fs/inode.c b/fs/inode.c
>  > index bf64781..b355a44 100644
>  > --- a/fs/inode.c
>  > +++ b/fs/inode.c
>  > @@ -1291,7 +1291,7 @@ int inode_needs_sync(struct inode *inode)
>  >
>  >  EXPORT_SYMBOL(inode_needs_sync);
>  >
>  > -int inode_wait(void *word)
>  > +int just_schedule(void *word)
>  >  {
>  >       schedule();
>  >       return 0;
>  > diff --git a/include/linux/writeback.h b/include/linux/writeback.h
>  > index f462439..80ff5eb 100644
>  > --- a/include/linux/writeback.h
>  > +++ b/include/linux/writeback.h
>  > @@ -67,23 +67,31 @@ struct writeback_control {
>  >
>  >  /*
>  >   * fs/fs-writeback.c
>  > - */
>  > + */
>  >  void writeback_inodes(struct writeback_control *wbc);
>  > -int inode_wait(void *);
>  >  void sync_inodes_sb(struct super_block *, int wait);
>  >  void sync_inodes(int wait);
>  >
>  > +/*
>  > + * fs/inode.c
>  > + *
>  > + * there are some situations which really need a just schedule,
>  > + * with int return value;
>  > + * and this should be moved into lib/ in the future.
>  > + */
>  > +int just_schedule(void *);
>  > +
>  Why is now not a good time? :-)
>
>  The patches look ok to me otherwise, but I wonder whether I should put
>  them in my tree (since they affect core code) or whether they'd be
>  better in -mm and/or linux-next?
The inode_wait in fs core code(fs/inode.c) is really just_schedule, so
is the gdlm_ast_wait, and they are all fs related code;

But inode_wait is not a better name for its work, instead just_schedule won.

So I should ask for opinions from fs core crew,

BTW, today I did a grep among the whole kernel tree and found that
just_schedule is also useful to other code, such as:

key_wait_bit(security/keys/request_key.c:25)

It's also really a just_schedule.

So just_schedule should go to lib/ ? Or we just append it into kernel/sched.c?

>
>  Steve.

-- 
Denis Cheng

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-05-08 18:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-06 17:51 [PATCH 1/2] [fs-devel] the real needs of just_schedule Denis Cheng
2008-05-06 17:51 ` [PATCH 2/2] [GFS2] remove the duplicates " Denis Cheng
2008-05-08 13:11 ` [PATCH 1/2] [fs-devel] the real needs " Steven Whitehouse
2008-05-08 18:30   ` rae l

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).