forked from mirrors/linux
		
	writeback: disable periodic old data writeback for !dirty_writeback_centisecs
Prior to 2.6.32, setting /proc/sys/vm/dirty_writeback_centisecs disabled periodic dirty writeback from kupdate. This got broken and now causes excessive sys CPU usage if set to zero, as we'll keep beating on schedule(). Cc: stable@kernel.org Reported-by: Justin Maggard <jmaggard10@gmail.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
This commit is contained in:
		
							parent
							
								
									2395e463fe
								
							
						
					
					
						commit
						69b62d01ec
					
				
					 1 changed files with 12 additions and 2 deletions
				
			
		|  | @ -852,6 +852,12 @@ static long wb_check_old_data_flush(struct bdi_writeback *wb) | ||||||
| 	unsigned long expired; | 	unsigned long expired; | ||||||
| 	long nr_pages; | 	long nr_pages; | ||||||
| 
 | 
 | ||||||
|  | 	/*
 | ||||||
|  | 	 * When set to zero, disable periodic writeback | ||||||
|  | 	 */ | ||||||
|  | 	if (!dirty_writeback_interval) | ||||||
|  | 		return 0; | ||||||
|  | 
 | ||||||
| 	expired = wb->last_old_flush + | 	expired = wb->last_old_flush + | ||||||
| 			msecs_to_jiffies(dirty_writeback_interval * 10); | 			msecs_to_jiffies(dirty_writeback_interval * 10); | ||||||
| 	if (time_before(jiffies, expired)) | 	if (time_before(jiffies, expired)) | ||||||
|  | @ -947,8 +953,12 @@ int bdi_writeback_task(struct bdi_writeback *wb) | ||||||
| 				break; | 				break; | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| 		wait_jiffies = msecs_to_jiffies(dirty_writeback_interval * 10); | 		if (dirty_writeback_interval) { | ||||||
| 		schedule_timeout_interruptible(wait_jiffies); | 			wait_jiffies = msecs_to_jiffies(dirty_writeback_interval * 10); | ||||||
|  | 			schedule_timeout_interruptible(wait_jiffies); | ||||||
|  | 		} else | ||||||
|  | 			schedule(); | ||||||
|  | 
 | ||||||
| 		try_to_freeze(); | 		try_to_freeze(); | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue
	
	 Jens Axboe
						Jens Axboe