linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] writeback: remove .nonblocking and .encountered_congestion
@ 2011-05-05 13:30 Wu Fengguang
  2011-05-05 13:37 ` Jan Kara
  0 siblings, 1 reply; 3+ messages in thread
From: Wu Fengguang @ 2011-05-05 13:30 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Trond Myklebust, Andrew Morton, Jan Kara, Dave Chinner, LKML,
	linux-fsdevel@vger.kernel.org

[allyesconfig compile tested]
[it modifies 3 filesystems all at once, is it OK?]

Remove two unused struct writeback_control fields:

	.encountered_congestion	(completley unused)
	.nonblocking		(never set, checked/showed in XFS,NFS/btrfs)

Proposed-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
---
 fs/nfs/write.c               |    3 +--
 fs/xfs/linux-2.6/xfs_aops.c  |    2 +-
 include/linux/writeback.h    |    2 --
 include/trace/events/btrfs.h |    6 ++----
 4 files changed, 4 insertions(+), 9 deletions(-)

--- linux-next.orig/fs/xfs/linux-2.6/xfs_aops.c	2011-05-05 21:10:01.000000000 +0800
+++ linux-next/fs/xfs/linux-2.6/xfs_aops.c	2011-05-05 21:10:37.000000000 +0800
@@ -970,7 +970,7 @@ xfs_vm_writepage(
 	offset = page_offset(page);
 	type = IO_OVERWRITE;
 
-	if (wbc->sync_mode == WB_SYNC_NONE && wbc->nonblocking)
+	if (wbc->sync_mode == WB_SYNC_NONE)
 		nonblocking = 1;
 
 	do {
--- linux-next.orig/include/trace/events/btrfs.h	2011-05-05 21:07:31.000000000 +0800
+++ linux-next/include/trace/events/btrfs.h	2011-05-05 21:09:47.000000000 +0800
@@ -284,7 +284,6 @@ DECLARE_EVENT_CLASS(btrfs__writepage,
 		__field(	long,   pages_skipped		)
 		__field(	loff_t, range_start		)
 		__field(	loff_t, range_end		)
-		__field(	char,   nonblocking		)
 		__field(	char,   for_kupdate		)
 		__field(	char,   for_reclaim		)
 		__field(	char,   range_cyclic		)
@@ -299,7 +298,6 @@ DECLARE_EVENT_CLASS(btrfs__writepage,
 		__entry->pages_skipped	= wbc->pages_skipped;
 		__entry->range_start	= wbc->range_start;
 		__entry->range_end	= wbc->range_end;
-		__entry->nonblocking	= wbc->nonblocking;
 		__entry->for_kupdate	= wbc->for_kupdate;
 		__entry->for_reclaim	= wbc->for_reclaim;
 		__entry->range_cyclic	= wbc->range_cyclic;
@@ -310,13 +308,13 @@ DECLARE_EVENT_CLASS(btrfs__writepage,
 
 	TP_printk("root = %llu(%s), ino = %lu, page_index = %lu, "
 		  "nr_to_write = %ld, pages_skipped = %ld, range_start = %llu, "
-		  "range_end = %llu, nonblocking = %d, for_kupdate = %d, "
+		  "range_end = %llu, for_kupdate = %d, "
 		  "for_reclaim = %d, range_cyclic = %d, writeback_index = %lu",
 		  show_root_type(__entry->root_objectid),
 		  (unsigned long)__entry->ino, __entry->index,
 		  __entry->nr_to_write, __entry->pages_skipped,
 		  __entry->range_start, __entry->range_end,
-		  __entry->nonblocking, __entry->for_kupdate,
+		  __entry->for_kupdate,
 		  __entry->for_reclaim, __entry->range_cyclic,
 		  (unsigned long)__entry->writeback_index)
 );
--- linux-next.orig/fs/nfs/write.c	2011-05-05 21:10:52.000000000 +0800
+++ linux-next/fs/nfs/write.c	2011-05-05 21:11:19.000000000 +0800
@@ -1564,8 +1564,7 @@ int nfs_write_inode(struct inode *inode,
 		int status;
 		bool sync = true;
 
-		if (wbc->sync_mode == WB_SYNC_NONE || wbc->nonblocking ||
-		    wbc->for_background)
+		if (wbc->sync_mode == WB_SYNC_NONE)
 			sync = false;
 
 		status = pnfs_layoutcommit_inode(inode, sync);
--- linux-next.orig/include/linux/writeback.h	2011-05-05 21:07:16.000000000 +0800
+++ linux-next/include/linux/writeback.h	2011-05-05 21:13:20.000000000 +0800
@@ -36,8 +36,6 @@ struct writeback_control {
 	loff_t range_start;
 	loff_t range_end;
 
-	unsigned nonblocking:1;		/* Don't get stuck on request queues */
-	unsigned encountered_congestion:1; /* An output: a queue is full */
 	unsigned for_kupdate:1;		/* A kupdate writeback */
 	unsigned for_background:1;	/* A background writeback */
 	unsigned tagged_sync:1;		/* do livelock prevention for sync */

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

* Re: [PATCH] writeback: remove .nonblocking and .encountered_congestion
  2011-05-05 13:30 [PATCH] writeback: remove .nonblocking and .encountered_congestion Wu Fengguang
@ 2011-05-05 13:37 ` Jan Kara
  2011-05-05 13:59   ` Wu Fengguang
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Kara @ 2011-05-05 13:37 UTC (permalink / raw)
  To: Wu Fengguang
  Cc: Christoph Hellwig, Trond Myklebust, Andrew Morton, Jan Kara,
	Dave Chinner, LKML, linux-fsdevel@vger.kernel.org

On Thu 05-05-11 21:30:02, Wu Fengguang wrote:
> [allyesconfig compile tested]
> [it modifies 3 filesystems all at once, is it OK?]
> 
> Remove two unused struct writeback_control fields:
> 
> 	.encountered_congestion	(completley unused)
> 	.nonblocking		(never set, checked/showed in XFS,NFS/btrfs)
> 
> Proposed-by: Christoph Hellwig <hch@infradead.org>
> Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
  Yep. Makes sense.
Reviewed-by: Jan Kara <jack@suse.cz>
  BTW: I've noticed you removed ->for_background check from
nfs_write_inode(). That's OK because for_background => WB_SYNC_NONE but I
guess you should mention it in the changelog.

								Honza
> ---
>  fs/nfs/write.c               |    3 +--
>  fs/xfs/linux-2.6/xfs_aops.c  |    2 +-
>  include/linux/writeback.h    |    2 --
>  include/trace/events/btrfs.h |    6 ++----
>  4 files changed, 4 insertions(+), 9 deletions(-)
> 
> --- linux-next.orig/fs/xfs/linux-2.6/xfs_aops.c	2011-05-05 21:10:01.000000000 +0800
> +++ linux-next/fs/xfs/linux-2.6/xfs_aops.c	2011-05-05 21:10:37.000000000 +0800
> @@ -970,7 +970,7 @@ xfs_vm_writepage(
>  	offset = page_offset(page);
>  	type = IO_OVERWRITE;
>  
> -	if (wbc->sync_mode == WB_SYNC_NONE && wbc->nonblocking)
> +	if (wbc->sync_mode == WB_SYNC_NONE)
>  		nonblocking = 1;
>  
>  	do {
> --- linux-next.orig/include/trace/events/btrfs.h	2011-05-05 21:07:31.000000000 +0800
> +++ linux-next/include/trace/events/btrfs.h	2011-05-05 21:09:47.000000000 +0800
> @@ -284,7 +284,6 @@ DECLARE_EVENT_CLASS(btrfs__writepage,
>  		__field(	long,   pages_skipped		)
>  		__field(	loff_t, range_start		)
>  		__field(	loff_t, range_end		)
> -		__field(	char,   nonblocking		)
>  		__field(	char,   for_kupdate		)
>  		__field(	char,   for_reclaim		)
>  		__field(	char,   range_cyclic		)
> @@ -299,7 +298,6 @@ DECLARE_EVENT_CLASS(btrfs__writepage,
>  		__entry->pages_skipped	= wbc->pages_skipped;
>  		__entry->range_start	= wbc->range_start;
>  		__entry->range_end	= wbc->range_end;
> -		__entry->nonblocking	= wbc->nonblocking;
>  		__entry->for_kupdate	= wbc->for_kupdate;
>  		__entry->for_reclaim	= wbc->for_reclaim;
>  		__entry->range_cyclic	= wbc->range_cyclic;
> @@ -310,13 +308,13 @@ DECLARE_EVENT_CLASS(btrfs__writepage,
>  
>  	TP_printk("root = %llu(%s), ino = %lu, page_index = %lu, "
>  		  "nr_to_write = %ld, pages_skipped = %ld, range_start = %llu, "
> -		  "range_end = %llu, nonblocking = %d, for_kupdate = %d, "
> +		  "range_end = %llu, for_kupdate = %d, "
>  		  "for_reclaim = %d, range_cyclic = %d, writeback_index = %lu",
>  		  show_root_type(__entry->root_objectid),
>  		  (unsigned long)__entry->ino, __entry->index,
>  		  __entry->nr_to_write, __entry->pages_skipped,
>  		  __entry->range_start, __entry->range_end,
> -		  __entry->nonblocking, __entry->for_kupdate,
> +		  __entry->for_kupdate,
>  		  __entry->for_reclaim, __entry->range_cyclic,
>  		  (unsigned long)__entry->writeback_index)
>  );
> --- linux-next.orig/fs/nfs/write.c	2011-05-05 21:10:52.000000000 +0800
> +++ linux-next/fs/nfs/write.c	2011-05-05 21:11:19.000000000 +0800
> @@ -1564,8 +1564,7 @@ int nfs_write_inode(struct inode *inode,
>  		int status;
>  		bool sync = true;
>  
> -		if (wbc->sync_mode == WB_SYNC_NONE || wbc->nonblocking ||
> -		    wbc->for_background)
> +		if (wbc->sync_mode == WB_SYNC_NONE)
>  			sync = false;
>  
>  		status = pnfs_layoutcommit_inode(inode, sync);
> --- linux-next.orig/include/linux/writeback.h	2011-05-05 21:07:16.000000000 +0800
> +++ linux-next/include/linux/writeback.h	2011-05-05 21:13:20.000000000 +0800
> @@ -36,8 +36,6 @@ struct writeback_control {
>  	loff_t range_start;
>  	loff_t range_end;
>  
> -	unsigned nonblocking:1;		/* Don't get stuck on request queues */
> -	unsigned encountered_congestion:1; /* An output: a queue is full */
>  	unsigned for_kupdate:1;		/* A kupdate writeback */
>  	unsigned for_background:1;	/* A background writeback */
>  	unsigned tagged_sync:1;		/* do livelock prevention for sync */
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

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

* Re: [PATCH] writeback: remove .nonblocking and .encountered_congestion
  2011-05-05 13:37 ` Jan Kara
@ 2011-05-05 13:59   ` Wu Fengguang
  0 siblings, 0 replies; 3+ messages in thread
From: Wu Fengguang @ 2011-05-05 13:59 UTC (permalink / raw)
  To: Jan Kara
  Cc: Christoph Hellwig, Trond Myklebust, Chris Mason, Andrew Morton,
	Dave Chinner, LKML, linux-fsdevel@vger.kernel.org

On Thu, May 05, 2011 at 09:37:43PM +0800, Jan Kara wrote:
> On Thu 05-05-11 21:30:02, Wu Fengguang wrote:
> > [allyesconfig compile tested]
> > [it modifies 3 filesystems all at once, is it OK?]
> > 
> > Remove two unused struct writeback_control fields:
> > 
> > 	.encountered_congestion	(completley unused)
> > 	.nonblocking		(never set, checked/showed in XFS,NFS/btrfs)
> > 
> > Proposed-by: Christoph Hellwig <hch@infradead.org>
> > Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
>   Yep. Makes sense.
> Reviewed-by: Jan Kara <jack@suse.cz>
>   BTW: I've noticed you removed ->for_background check from
> nfs_write_inode(). That's OK because for_background => WB_SYNC_NONE but I
> guess you should mention it in the changelog.

Good point!

Thanks,
Fengguang
---
Subject: writeback: remove .nonblocking and .encountered_congestion
Date: Thu May 05 21:10:38 CST 2011

Remove two unused struct writeback_control fields:

	.encountered_congestion	(completley unused)
	.nonblocking		(never set, checked/showed in XFS,NFS/btrfs)

The .for_background check in nfs_write_inode() is also removed btw,
as .for_background implies WB_SYNC_NONE.

Reviewed-by: Jan Kara <jack@suse.cz>
Proposed-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
---
 fs/nfs/write.c               |    3 +--
 fs/xfs/linux-2.6/xfs_aops.c  |    2 +-
 include/linux/writeback.h    |    2 --
 include/trace/events/btrfs.h |    6 ++----
 4 files changed, 4 insertions(+), 9 deletions(-)

--- linux-next.orig/fs/xfs/linux-2.6/xfs_aops.c	2011-05-05 21:10:01.000000000 +0800
+++ linux-next/fs/xfs/linux-2.6/xfs_aops.c	2011-05-05 21:10:37.000000000 +0800
@@ -970,7 +970,7 @@ xfs_vm_writepage(
 	offset = page_offset(page);
 	type = IO_OVERWRITE;
 
-	if (wbc->sync_mode == WB_SYNC_NONE && wbc->nonblocking)
+	if (wbc->sync_mode == WB_SYNC_NONE)
 		nonblocking = 1;
 
 	do {
--- linux-next.orig/include/trace/events/btrfs.h	2011-05-05 21:07:31.000000000 +0800
+++ linux-next/include/trace/events/btrfs.h	2011-05-05 21:09:47.000000000 +0800
@@ -284,7 +284,6 @@ DECLARE_EVENT_CLASS(btrfs__writepage,
 		__field(	long,   pages_skipped		)
 		__field(	loff_t, range_start		)
 		__field(	loff_t, range_end		)
-		__field(	char,   nonblocking		)
 		__field(	char,   for_kupdate		)
 		__field(	char,   for_reclaim		)
 		__field(	char,   range_cyclic		)
@@ -299,7 +298,6 @@ DECLARE_EVENT_CLASS(btrfs__writepage,
 		__entry->pages_skipped	= wbc->pages_skipped;
 		__entry->range_start	= wbc->range_start;
 		__entry->range_end	= wbc->range_end;
-		__entry->nonblocking	= wbc->nonblocking;
 		__entry->for_kupdate	= wbc->for_kupdate;
 		__entry->for_reclaim	= wbc->for_reclaim;
 		__entry->range_cyclic	= wbc->range_cyclic;
@@ -310,13 +308,13 @@ DECLARE_EVENT_CLASS(btrfs__writepage,
 
 	TP_printk("root = %llu(%s), ino = %lu, page_index = %lu, "
 		  "nr_to_write = %ld, pages_skipped = %ld, range_start = %llu, "
-		  "range_end = %llu, nonblocking = %d, for_kupdate = %d, "
+		  "range_end = %llu, for_kupdate = %d, "
 		  "for_reclaim = %d, range_cyclic = %d, writeback_index = %lu",
 		  show_root_type(__entry->root_objectid),
 		  (unsigned long)__entry->ino, __entry->index,
 		  __entry->nr_to_write, __entry->pages_skipped,
 		  __entry->range_start, __entry->range_end,
-		  __entry->nonblocking, __entry->for_kupdate,
+		  __entry->for_kupdate,
 		  __entry->for_reclaim, __entry->range_cyclic,
 		  (unsigned long)__entry->writeback_index)
 );
--- linux-next.orig/fs/nfs/write.c	2011-05-05 21:10:52.000000000 +0800
+++ linux-next/fs/nfs/write.c	2011-05-05 21:11:19.000000000 +0800
@@ -1564,8 +1564,7 @@ int nfs_write_inode(struct inode *inode,
 		int status;
 		bool sync = true;
 
-		if (wbc->sync_mode == WB_SYNC_NONE || wbc->nonblocking ||
-		    wbc->for_background)
+		if (wbc->sync_mode == WB_SYNC_NONE)
 			sync = false;
 
 		status = pnfs_layoutcommit_inode(inode, sync);
--- linux-next.orig/include/linux/writeback.h	2011-05-05 21:07:16.000000000 +0800
+++ linux-next/include/linux/writeback.h	2011-05-05 21:13:20.000000000 +0800
@@ -36,8 +36,6 @@ struct writeback_control {
 	loff_t range_start;
 	loff_t range_end;
 
-	unsigned nonblocking:1;		/* Don't get stuck on request queues */
-	unsigned encountered_congestion:1; /* An output: a queue is full */
 	unsigned for_kupdate:1;		/* A kupdate writeback */
 	unsigned for_background:1;	/* A background writeback */
 	unsigned tagged_sync:1;		/* do livelock prevention for sync */

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

end of thread, other threads:[~2011-05-05 13:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-05 13:30 [PATCH] writeback: remove .nonblocking and .encountered_congestion Wu Fengguang
2011-05-05 13:37 ` Jan Kara
2011-05-05 13:59   ` Wu Fengguang

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