mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
page-writeback.c: subtract min_free_kbytes from dirtyable memory
When calculating amount of dirtyable memory, min_free_kbytes should be subtracted because it is not intended for dirty pages. Addresses http://bugs.debian.org/695182 [[email protected]: fix up min_free_kbytes extern declarations] [[email protected]: fix min() warning] Signed-off-by: Paul Szabo <[email protected]> Acked-by: Rik van Riel <[email protected]> Cc: Wu Fengguang <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
08b52706d5
commit
75f7ad8e04
4 changed files with 6 additions and 2 deletions
|
|
@ -241,6 +241,9 @@ static unsigned long global_dirtyable_memory(void)
|
|||
if (!vm_highmem_is_dirtyable)
|
||||
x -= highmem_dirtyable_memory(x);
|
||||
|
||||
/* Subtract min_free_kbytes */
|
||||
x -= min_t(unsigned long, x, min_free_kbytes >> (PAGE_SHIFT - 10));
|
||||
|
||||
return x + 1; /* Ensure that we never return 0 */
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue