Re: [PATCH] remove throttle_vm_writeout()

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Miklos Szeredi
Date: Thursday, October 4, 2007 - 4:26 pm

> This is a somewhat general problem: a userspace process is in the IO path. 

No, and that's a rather important feature, that I'd rather not give
up.  But with the dirty limiting, the memory cleaning really shouldn't
be a problem, as there is plenty of memory _not_ used for dirty file
data, that the filesystem can use during the writeback.

So the only thing the kernel should be careful about, is not to block
on an allocation if not strictly necessary.

Actually a trivial fix for this problem could be to just tweak the
thresholds, so to make the above scenario impossible.  Although I'm
still not convinced, this patch is perfect, because the dirty
threshold can actually change in time...

Index: linux/mm/page-writeback.c
===================================================================
--- linux.orig/mm/page-writeback.c      2007-10-05 00:31:01.000000000 +0200
+++ linux/mm/page-writeback.c   2007-10-05 00:50:11.000000000 +0200
@@ -515,6 +515,12 @@ void throttle_vm_writeout(gfp_t gfp_mask
         for ( ; ; ) {
                get_dirty_limits(&background_thresh, &dirty_thresh, NULL, NULL);

+               /*
+                * Make sure the theshold is over the hard limit of
+                * dirty_thresh + ratelimit_pages * nr_cpus
+                */
+               dirty_thresh += ratelimit_pages * num_online_cpus();
+
                 /*
                  * Boost the allowable dirty threshold a bit for page
                  * allocators so they don't get DoS'ed by heavy writers


-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] remove throttle_vm_writeout(), Miklos Szeredi, (Thu Oct 4, 5:25 am)
Re: [PATCH] remove throttle_vm_writeout(), Peter Zijlstra, (Thu Oct 4, 5:40 am)
Re: [PATCH] remove throttle_vm_writeout(), Miklos Szeredi, (Thu Oct 4, 6:00 am)
Re: [PATCH] remove throttle_vm_writeout(), Peter Zijlstra, (Thu Oct 4, 6:23 am)
Re: [PATCH] remove throttle_vm_writeout(), Miklos Szeredi, (Thu Oct 4, 6:49 am)
Re: [PATCH] remove throttle_vm_writeout(), Peter Zijlstra, (Thu Oct 4, 9:47 am)
Re: [PATCH] remove throttle_vm_writeout(), Andrew Morton, (Thu Oct 4, 10:46 am)
Re: [PATCH] remove throttle_vm_writeout(), Peter Zijlstra, (Thu Oct 4, 11:10 am)
Re: [PATCH] remove throttle_vm_writeout(), Andrew Morton, (Thu Oct 4, 11:54 am)
Re: [PATCH] remove throttle_vm_writeout(), Miklos Szeredi, (Thu Oct 4, 2:07 pm)
Re: [PATCH] remove throttle_vm_writeout(), Andrew Morton, (Thu Oct 4, 2:56 pm)
Re: [PATCH] remove throttle_vm_writeout(), Miklos Szeredi, (Thu Oct 4, 3:39 pm)
Re: [PATCH] remove throttle_vm_writeout(), Andrew Morton, (Thu Oct 4, 4:09 pm)
Re: [PATCH] remove throttle_vm_writeout(), Miklos Szeredi, (Thu Oct 4, 4:26 pm)
Re: [PATCH] remove throttle_vm_writeout(), Andrew Morton, (Thu Oct 4, 4:48 pm)
Re: [PATCH] remove throttle_vm_writeout(), Miklos Szeredi, (Thu Oct 4, 5:12 pm)
Re: [PATCH] remove throttle_vm_writeout(), Andrew Morton, (Thu Oct 4, 5:48 pm)
Re: [PATCH] remove throttle_vm_writeout(), Peter Zijlstra, (Fri Oct 5, 12:32 am)
Re: [PATCH] remove throttle_vm_writeout(), Peter Zijlstra, (Fri Oct 5, 1:22 am)
Re: [PATCH] remove throttle_vm_writeout(), Miklos Szeredi, (Fri Oct 5, 2:22 am)
Re: [PATCH] remove throttle_vm_writeout(), Peter Zijlstra, (Fri Oct 5, 2:47 am)
Re: [PATCH] remove throttle_vm_writeout(), Miklos Szeredi, (Fri Oct 5, 3:27 am)
Re: [PATCH] remove throttle_vm_writeout(), Miklos Szeredi, (Fri Oct 5, 3:32 am)
Re: [PATCH] remove throttle_vm_writeout(), Peter Zijlstra, (Fri Oct 5, 3:57 am)
Re: [PATCH] remove throttle_vm_writeout(), Miklos Szeredi, (Fri Oct 5, 4:27 am)
Re: [PATCH] remove throttle_vm_writeout(), Fengguang Wu, (Fri Oct 5, 5:30 am)
Re: [PATCH] remove throttle_vm_writeout(), John Stoffel, (Fri Oct 5, 8:43 am)
Re: [PATCH] remove throttle_vm_writeout(), Andrew Morton, (Fri Oct 5, 10:20 am)
Re: [PATCH] remove throttle_vm_writeout(), Trond Myklebust, (Fri Oct 5, 10:50 am)
Re: [PATCH] remove throttle_vm_writeout(), Peter Zijlstra, (Fri Oct 5, 11:32 am)
Re: [PATCH] remove throttle_vm_writeout(), Trond Myklebust, (Fri Oct 5, 12:20 pm)
Re: [PATCH] remove throttle_vm_writeout(), Trond Myklebust, (Fri Oct 5, 12:23 pm)
Re: [PATCH] remove throttle_vm_writeout(), Rik van Riel, (Fri Oct 5, 12:54 pm)
Re: [PATCH] remove throttle_vm_writeout(), Peter Zijlstra, (Fri Oct 5, 2:07 pm)
Re: [PATCH] remove throttle_vm_writeout(), Fengguang Wu, (Fri Oct 5, 5:40 pm)
Re: [PATCH] remove throttle_vm_writeout(), Fengguang Wu, (Fri Oct 5, 7:32 pm)