Re: writeout stalls in current -git

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Peter Zijlstra
Date: Tuesday, November 6, 2007 - 3:20 am

On Mon, 2007-11-05 at 15:57 -0800, Andrew Morton wrote:


Not really hastily, I think it was written before the stuff hit
mainline. Inadequately tested, perhaps, its been in my and probably Wu's
kernels for a while. Granted that's not a lot of testing in the face of
those who have problems atm.


I'm perfectly happy with this patch earning its credits in -mm for a
while and maybe going in around -rc4 or something like that (hoping that
by then we've fixed these nagging issues).

Another patch I did come up with yesterday - not driven by any problems
in that area - could perhaps join this one on that path:

---
Subject: mm: bdi: tweak task dirty penalty

Penalizing heavy dirtiers with 1/8-th the total dirty limit might be rather
excessive on large memory machines. Use sqrt to scale it sub-linearly.

Update the comment while we're there.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
---
 mm/page-writeback.c |   12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

Index: linux-2.6-2/mm/page-writeback.c
===================================================================
--- linux-2.6-2.orig/mm/page-writeback.c
+++ linux-2.6-2/mm/page-writeback.c
@@ -213,17 +213,21 @@ static inline void task_dirties_fraction
 }
 
 /*
- * scale the dirty limit
+ * Task specific dirty limit:
  *
- * task specific dirty limit:
+ *   dirty -= 8 * sqrt(dirty) * p_{t}
  *
- *   dirty -= (dirty/8) * p_{t}
+ * Penalize tasks that dirty a lot of pages by lowering their dirty limit. This
+ * avoids infrequent dirtiers from getting stuck in this other guys dirty
+ * pages.
+ *
+ * Use a sub-linear function to scale the penalty, we only need a little room.
  */
 void task_dirty_limit(struct task_struct *tsk, long *pdirty)
 {
 	long numerator, denominator;
 	long dirty = *pdirty;
-	u64 inv = dirty >> 3;
+	u64 inv = 8*int_sqrt(dirty);
 
 	task_dirties_fraction(tsk, &numerator, &denominator);
 	inv *= numerator;


-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: writeout stalls in current -git, Peter Zijlstra, (Fri Nov 2, 3:15 am)
Re: writeout stalls in current -git, Fengguang Wu, (Fri Nov 2, 3:33 am)
Re: writeout stalls in current -git, Torsten Kaiser, (Fri Nov 2, 12:22 pm)
Re: writeout stalls in current -git, David Chinner, (Fri Nov 2, 1:43 pm)
Re: writeout stalls in current -git, Torsten Kaiser, (Fri Nov 2, 2:02 pm)
Re: writeout stalls in current -git, Torsten Kaiser, (Sun Nov 4, 4:19 am)
Re: writeout stalls in current -git, David Chinner, (Sun Nov 4, 6:45 pm)
Re: writeout stalls in current -git, Torsten Kaiser, (Mon Nov 5, 12:01 am)
Re: writeout stalls in current -git, Torsten Kaiser, (Mon Nov 5, 11:27 am)
Re: writeout stalls in current -git, Andrew Morton, (Mon Nov 5, 4:57 pm)
Re: writeout stalls in current -git, David Chinner, (Mon Nov 5, 9:25 pm)
Re: writeout stalls in current -git, Torsten Kaiser, (Tue Nov 6, 12:10 am)
Re: writeout stalls in current -git, Fengguang Wu, (Tue Nov 6, 2:17 am)
Re: writeout stalls in current -git, Peter Zijlstra, (Tue Nov 6, 3:20 am)
Re: writeout stalls in current -git, Peter Zijlstra, (Tue Nov 6, 12:01 pm)
Re: writeout stalls in current -git, Torsten Kaiser, (Tue Nov 6, 1:26 pm)
Re: writeout stalls in current -git, Torsten Kaiser, (Tue Nov 6, 2:53 pm)
Re: writeout stalls in current -git, David Chinner, (Tue Nov 6, 4:31 pm)
Re: writeout stalls in current -git, David Chinner, (Tue Nov 6, 7:13 pm)
Re: writeout stalls in current -git, Torsten Kaiser, (Wed Nov 7, 12:15 am)
Re: writeout stalls in current -git, David Chinner, (Wed Nov 7, 5:38 pm)
Re: writeout stalls in current -git, Damien Wyart, (Tue Nov 20, 6:16 am)
Re: writeout stalls in current -git, David Chinner, (Tue Nov 20, 2:09 pm)