lkml.org 
[lkml]   [2010]   [Dec]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH 20/47] writeback: use do_div in bw calculation
cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
---
mm/page-writeback.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

--- linux-next.orig/mm/page-writeback.c 2010-12-08 22:44:28.000000000 +0800
+++ linux-next/mm/page-writeback.c 2010-12-08 22:44:28.000000000 +0800
@@ -658,10 +658,10 @@ static void balance_dirty_pages(struct a
*/
bw = bdi->write_bandwidth;
bw = bw * (bdi_thresh - bdi_dirty);
- bw = bw / (bdi_thresh / BDI_SOFT_DIRTY_LIMIT + 1);
+ do_div(bw, bdi_thresh / BDI_SOFT_DIRTY_LIMIT + 1);

bw = bw * (task_thresh - bdi_dirty);
- bw = bw / (bdi_thresh / TASK_SOFT_DIRTY_LIMIT + 1);
+ do_div(bw, bdi_thresh / TASK_SOFT_DIRTY_LIMIT + 1);

pause = HZ * (pages_dirtied << PAGE_CACHE_SHIFT) / (bw + 1);
pause = clamp_val(pause, 1, HZ/10);



\
 
 \ /
  Last update: 2010-12-13 07:53    [W:0.716 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site