Skip to content

Commit 1b430be

Browse files
Wu Fengguangtorvalds
authored andcommitted
writeback: remove nonblocking/encountered_congestion references
This removes more dead code that was somehow missed by commit 0d99519 (writeback: remove unused nonblocking and congestion checks). There are no behavior change except for the removal of two entries from one of the ext4 tracing interface. The nonblocking checks in ->writepages are no longer used because the flusher now prefer to block on get_request_wait() than to skip inodes on IO congestion. The latter will lead to more seeky IO. The nonblocking checks in ->writepage are no longer used because it's redundant with the WB_SYNC_NONE check. We no long set ->nonblocking in VM page out and page migration, because a) it's effectively redundant with WB_SYNC_NONE in current code b) it's old semantic of "Don't get stuck on request queues" is mis-behavior: that would skip some dirty inodes on congestion and page out others, which is unfair in terms of LRU age. Inspired by Christoph Hellwig. Thanks! Signed-off-by: Wu Fengguang <fengguang.wu@intel.com> Cc: Theodore Ts'o <tytso@mit.edu> Cc: David Howells <dhowells@redhat.com> Cc: Sage Weil <sage@newdream.net> Cc: Steve French <sfrench@samba.org> Cc: Chris Mason <chris.mason@oracle.com> Cc: Jens Axboe <axboe@kernel.dk> Cc: Christoph Hellwig <hch@infradead.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent d19d547 commit 1b430be

12 files changed

Lines changed: 11 additions & 52 deletions

File tree

‎fs/afs/write.c‎

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,6 @@ static int afs_write_back_from_locked_page(struct afs_writeback *wb,
438438
*/
439439
int afs_writepage(struct page *page, struct writeback_control *wbc)
440440
{
441-
struct backing_dev_info *bdi = page->mapping->backing_dev_info;
442441
struct afs_writeback *wb;
443442
int ret;
444443

@@ -455,8 +454,6 @@ int afs_writepage(struct page *page, struct writeback_control *wbc)
455454
}
456455

457456
wbc->nr_to_write -= ret;
458-
if (wbc->nonblocking && bdi_write_congested(bdi))
459-
wbc->encountered_congestion = 1;
460457

461458
_leave(" = 0");
462459
return 0;
@@ -469,7 +466,6 @@ static int afs_writepages_region(struct address_space *mapping,
469466
struct writeback_control *wbc,
470467
pgoff_t index, pgoff_t end, pgoff_t *_next)
471468
{
472-
struct backing_dev_info *bdi = mapping->backing_dev_info;
473469
struct afs_writeback *wb;
474470
struct page *page;
475471
int ret, n;
@@ -529,11 +525,6 @@ static int afs_writepages_region(struct address_space *mapping,
529525

530526
wbc->nr_to_write -= ret;
531527

532-
if (wbc->nonblocking && bdi_write_congested(bdi)) {
533-
wbc->encountered_congestion = 1;
534-
break;
535-
}
536-
537528
cond_resched();
538529
} while (index < end && wbc->nr_to_write > 0);
539530

@@ -548,24 +539,16 @@ static int afs_writepages_region(struct address_space *mapping,
548539
int afs_writepages(struct address_space *mapping,
549540
struct writeback_control *wbc)
550541
{
551-
struct backing_dev_info *bdi = mapping->backing_dev_info;
552542
pgoff_t start, end, next;
553543
int ret;
554544

555545
_enter("");
556546

557-
if (wbc->nonblocking && bdi_write_congested(bdi)) {
558-
wbc->encountered_congestion = 1;
559-
_leave(" = 0 [congest]");
560-
return 0;
561-
}
562-
563547
if (wbc->range_cyclic) {
564548
start = mapping->writeback_index;
565549
end = -1;
566550
ret = afs_writepages_region(mapping, wbc, start, end, &next);
567-
if (start > 0 && wbc->nr_to_write > 0 && ret == 0 &&
568-
!(wbc->nonblocking && wbc->encountered_congestion))
551+
if (start > 0 && wbc->nr_to_write > 0 && ret == 0)
569552
ret = afs_writepages_region(mapping, wbc, 0, start,
570553
&next);
571554
mapping->writeback_index = next;

‎fs/buffer.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1706,7 +1706,7 @@ static int __block_write_full_page(struct inode *inode, struct page *page,
17061706
* and kswapd activity, but those code paths have their own
17071707
* higher-level throttling.
17081708
*/
1709-
if (wbc->sync_mode != WB_SYNC_NONE || !wbc->nonblocking) {
1709+
if (wbc->sync_mode != WB_SYNC_NONE) {
17101710
lock_buffer(bh);
17111711
} else if (!trylock_buffer(bh)) {
17121712
redirty_page_for_writepage(wbc, page);

‎fs/ceph/addr.c‎

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,6 @@ static int ceph_writepages_start(struct address_space *mapping,
591591
struct writeback_control *wbc)
592592
{
593593
struct inode *inode = mapping->host;
594-
struct backing_dev_info *bdi = mapping->backing_dev_info;
595594
struct ceph_inode_info *ci = ceph_inode(inode);
596595
struct ceph_fs_client *fsc;
597596
pgoff_t index, start, end;
@@ -633,13 +632,6 @@ static int ceph_writepages_start(struct address_space *mapping,
633632

634633
pagevec_init(&pvec, 0);
635634

636-
/* ?? */
637-
if (wbc->nonblocking && bdi_write_congested(bdi)) {
638-
dout(" writepages congested\n");
639-
wbc->encountered_congestion = 1;
640-
goto out_final;
641-
}
642-
643635
/* where to start/end? */
644636
if (wbc->range_cyclic) {
645637
start = mapping->writeback_index; /* Start from prev offset */
@@ -885,7 +877,6 @@ static int ceph_writepages_start(struct address_space *mapping,
885877
rc = 0; /* vfs expects us to return 0 */
886878
ceph_put_snap_context(snapc);
887879
dout("writepages done, rc = %d\n", rc);
888-
out_final:
889880
return rc;
890881
}
891882

‎fs/cifs/file.c‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1303,7 +1303,6 @@ static int cifs_partialpagewrite(struct page *page, unsigned from, unsigned to)
13031303
static int cifs_writepages(struct address_space *mapping,
13041304
struct writeback_control *wbc)
13051305
{
1306-
struct backing_dev_info *bdi = mapping->backing_dev_info;
13071306
unsigned int bytes_to_write;
13081307
unsigned int bytes_written;
13091308
struct cifs_sb_info *cifs_sb;
@@ -1326,15 +1325,6 @@ static int cifs_writepages(struct address_space *mapping,
13261325
int scanned = 0;
13271326
int xid, long_op;
13281327

1329-
/*
1330-
* BB: Is this meaningful for a non-block-device file system?
1331-
* If it is, we should test it again after we do I/O
1332-
*/
1333-
if (wbc->nonblocking && bdi_write_congested(bdi)) {
1334-
wbc->encountered_congestion = 1;
1335-
return 0;
1336-
}
1337-
13381328
cifs_sb = CIFS_SB(mapping->host->i_sb);
13391329

13401330
/*

‎fs/gfs2/meta_io.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ static int gfs2_aspace_writepage(struct page *page, struct writeback_control *wb
5555
* activity, but those code paths have their own higher-level
5656
* throttling.
5757
*/
58-
if (wbc->sync_mode != WB_SYNC_NONE || !wbc->nonblocking) {
58+
if (wbc->sync_mode != WB_SYNC_NONE) {
5959
lock_buffer(bh);
6060
} else if (!trylock_buffer(bh)) {
6161
redirty_page_for_writepage(wbc, page);

‎fs/nfs/write.c‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -290,9 +290,7 @@ static int nfs_do_writepage(struct page *page, struct writeback_control *wbc, st
290290
nfs_add_stats(inode, NFSIOS_WRITEPAGES, 1);
291291

292292
nfs_pageio_cond_complete(pgio, page->index);
293-
ret = nfs_page_async_flush(pgio, page,
294-
wbc->sync_mode == WB_SYNC_NONE ||
295-
wbc->nonblocking != 0);
293+
ret = nfs_page_async_flush(pgio, page, wbc->sync_mode == WB_SYNC_NONE);
296294
if (ret == -EAGAIN) {
297295
redirty_page_for_writepage(wbc, page);
298296
ret = 0;

‎fs/reiserfs/inode.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2438,7 +2438,7 @@ static int reiserfs_write_full_page(struct page *page,
24382438
/* from this point on, we know the buffer is mapped to a
24392439
* real block and not a direct item
24402440
*/
2441-
if (wbc->sync_mode != WB_SYNC_NONE || !wbc->nonblocking) {
2441+
if (wbc->sync_mode != WB_SYNC_NONE) {
24422442
lock_buffer(bh);
24432443
} else {
24442444
if (!trylock_buffer(bh)) {

‎fs/xfs/linux-2.6/xfs_aops.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1139,8 +1139,7 @@ xfs_vm_writepage(
11391139
type = IO_DELAY;
11401140
flags = BMAPI_ALLOCATE;
11411141

1142-
if (wbc->sync_mode == WB_SYNC_NONE &&
1143-
wbc->nonblocking)
1142+
if (wbc->sync_mode == WB_SYNC_NONE)
11441143
flags |= BMAPI_TRYLOCK;
11451144
}
11461145

‎include/trace/events/ext4.h‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -242,18 +242,20 @@ TRACE_EVENT(ext4_da_writepages,
242242
__entry->pages_skipped = wbc->pages_skipped;
243243
__entry->range_start = wbc->range_start;
244244
__entry->range_end = wbc->range_end;
245-
__entry->nonblocking = wbc->nonblocking;
246245
__entry->for_kupdate = wbc->for_kupdate;
247246
__entry->for_reclaim = wbc->for_reclaim;
248247
__entry->range_cyclic = wbc->range_cyclic;
249248
__entry->writeback_index = inode->i_mapping->writeback_index;
250249
),
251250

252-
TP_printk("dev %s ino %lu nr_to_write %ld pages_skipped %ld range_start %llu range_end %llu nonblocking %d for_kupdate %d for_reclaim %d range_cyclic %d writeback_index %lu",
251+
TP_printk("dev %s ino %lu nr_to_write %ld pages_skipped %ld "
252+
"range_start %llu range_end %llu "
253+
"for_kupdate %d for_reclaim %d "
254+
"range_cyclic %d writeback_index %lu",
253255
jbd2_dev_to_name(__entry->dev),
254256
(unsigned long) __entry->ino, __entry->nr_to_write,
255257
__entry->pages_skipped, __entry->range_start,
256-
__entry->range_end, __entry->nonblocking,
258+
__entry->range_end,
257259
__entry->for_kupdate, __entry->for_reclaim,
258260
__entry->range_cyclic,
259261
(unsigned long) __entry->writeback_index)

‎include/trace/events/writeback.h‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,6 @@ DECLARE_EVENT_CLASS(wbc_class,
9696
__field(long, nr_to_write)
9797
__field(long, pages_skipped)
9898
__field(int, sync_mode)
99-
__field(int, nonblocking)
100-
__field(int, encountered_congestion)
10199
__field(int, for_kupdate)
102100
__field(int, for_background)
103101
__field(int, for_reclaim)

0 commit comments

Comments
 (0)