Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'writeback-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/wfg/linux

* 'writeback-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/wfg/linux:
writeback: set max_pause to lowest value on zero bdi_dirty
writeback: permit through good bdi even when global dirty exceeded
writeback: comment on the bdi dirty threshold
fs: Make write(2) interruptible by a fatal signal
writeback: Fix issue on make htmldocs

+37 -6
+5
fs/fs-writeback.c
··· 156 156 * bdi_start_writeback - start writeback 157 157 * @bdi: the backing device to write from 158 158 * @nr_pages: the number of pages to write 159 + * @reason: reason why some writeback work was initiated 159 160 * 160 161 * Description: 161 162 * This does WB_SYNC_NONE opportunistic writeback. The IO is only ··· 1224 1223 * writeback_inodes_sb_nr - writeback dirty inodes from given super_block 1225 1224 * @sb: the superblock 1226 1225 * @nr: the number of pages to write 1226 + * @reason: reason why some writeback work initiated 1227 1227 * 1228 1228 * Start writeback on some inodes on this super_block. No guarantees are made 1229 1229 * on how many (if any) will be written, and this function does not wait ··· 1253 1251 /** 1254 1252 * writeback_inodes_sb - writeback dirty inodes from given super_block 1255 1253 * @sb: the superblock 1254 + * @reason: reason why some writeback work was initiated 1256 1255 * 1257 1256 * Start writeback on some inodes on this super_block. No guarantees are made 1258 1257 * on how many (if any) will be written, and this function does not wait ··· 1268 1265 /** 1269 1266 * writeback_inodes_sb_if_idle - start writeback if none underway 1270 1267 * @sb: the superblock 1268 + * @reason: reason why some writeback work was initiated 1271 1269 * 1272 1270 * Invoke writeback_inodes_sb if no writeback is currently underway. 1273 1271 * Returns 1 if writeback was started, 0 if not. ··· 1289 1285 * writeback_inodes_sb_if_idle - start writeback if none underway 1290 1286 * @sb: the superblock 1291 1287 * @nr: the number of pages to write 1288 + * @reason: reason why some writeback work was initiated 1292 1289 * 1293 1290 * Invoke writeback_inodes_sb if no writeback is currently underway. 1294 1291 * Returns 1 if writeback was started, 0 if not.
+4 -2
mm/filemap.c
··· 2407 2407 iov_iter_count(i)); 2408 2408 2409 2409 again: 2410 - 2411 2410 /* 2412 2411 * Bring in the user page that we will copy from _first_. 2413 2412 * Otherwise there's a nasty deadlock on copying from the ··· 2462 2463 written += copied; 2463 2464 2464 2465 balance_dirty_pages_ratelimited(mapping); 2465 - 2466 + if (fatal_signal_pending(current)) { 2467 + status = -EINTR; 2468 + break; 2469 + } 2466 2470 } while (iov_iter_count(i)); 2467 2471 2468 2472 return written ? written : status;
+28 -4
mm/page-writeback.c
··· 411 411 * 412 412 * Returns @bdi's dirty limit in pages. The term "dirty" in the context of 413 413 * dirty balancing includes all PG_dirty, PG_writeback and NFS unstable pages. 414 - * And the "limit" in the name is not seriously taken as hard limit in 415 - * balance_dirty_pages(). 414 + * 415 + * Note that balance_dirty_pages() will only seriously take it as a hard limit 416 + * when sleeping max_pause per page is not enough to keep the dirty pages under 417 + * control. For example, when the device is completely stalled due to some error 418 + * conditions, or when there are 1000 dd tasks writing to a slow 10MB/s USB key. 419 + * In the other normal situations, it acts more gently by throttling the tasks 420 + * more (rather than completely block them) when the bdi dirty pages go high. 416 421 * 417 422 * It allocates high/low dirty limits to fast/slow devices, in order to prevent 418 423 * - starving fast devices ··· 599 594 */ 600 595 if (unlikely(bdi_thresh > thresh)) 601 596 bdi_thresh = thresh; 597 + /* 598 + * It's very possible that bdi_thresh is close to 0 not because the 599 + * device is slow, but that it has remained inactive for long time. 600 + * Honour such devices a reasonable good (hopefully IO efficient) 601 + * threshold, so that the occasional writes won't be blocked and active 602 + * writes can rampup the threshold quickly. 603 + */ 602 604 bdi_thresh = max(bdi_thresh, (limit - dirty) / 8); 603 605 /* 604 606 * scale global setpoint to bdi's: ··· 989 977 * 990 978 * 8 serves as the safety ratio. 991 979 */ 992 - if (bdi_dirty) 993 - t = min(t, bdi_dirty * HZ / (8 * bw + 1)); 980 + t = min(t, bdi_dirty * HZ / (8 * bw + 1)); 994 981 995 982 /* 996 983 * The pause time will be settled within range (max_pause/4, max_pause). ··· 1145 1134 * also keep "1000+ dd on a slow USB stick" under control. 1146 1135 */ 1147 1136 if (task_ratelimit) 1137 + break; 1138 + 1139 + /* 1140 + * In the case of an unresponding NFS server and the NFS dirty 1141 + * pages exceeds dirty_thresh, give the other good bdi's a pipe 1142 + * to go through, so that tasks on them still remain responsive. 1143 + * 1144 + * In theory 1 page is enough to keep the comsumer-producer 1145 + * pipe going: the flusher cleans 1 page => the task dirties 1 1146 + * more page. However bdi_dirty has accounting errors. So use 1147 + * the larger and more IO friendly bdi_stat_error. 1148 + */ 1149 + if (bdi_dirty <= bdi_stat_error(bdi)) 1148 1150 break; 1149 1151 1150 1152 if (fatal_signal_pending(current))