linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] Subtract min_free_kbytes from dirtyable memory
@ 2013-01-25  9:53 paul.szabo
  2013-01-25 13:01 ` Bug#695182: " Ben Hutchings
  2013-01-28  6:23 ` Minchan Kim
  0 siblings, 2 replies; 17+ messages in thread
From: paul.szabo @ 2013-01-25  9:53 UTC (permalink / raw)
  To: minchan, psz; +Cc: 695182, linux-kernel, linux-mm

Dear Minchan,

> So what's the effect for user?
> ...
> It seems you saw old kernel.
> ...
> Current kernel includes ...
> So I think we don't need this patch.

As I understand now, my patch is "right" and needed for older kernels;
for newer kernels, the issue has been fixed in equivalent ways; it was
an oversight that the change was not backported; and any justification
you need, you can get from those "later better" patches.

I asked:

  A question: what is the use or significance of vm_highmem_is_dirtyable?
  It seems odd that it would be used in setting limits or threshholds, but
  not used in decisions where to put dirty things. Is that so, is that as
  should be? What is the recommended setting of highmem_is_dirtyable?

The silence is deafening. I guess highmem_is_dirtyable is an aberration.

Thanks, Paul

Paul Szabo   psz@maths.usyd.edu.au   http://www.maths.usyd.edu.au/u/psz/
School of Mathematics and Statistics   University of Sydney    Australia

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 17+ messages in thread
* [PATCH] Subtract min_free_kbytes from dirtyable memory
@ 2013-01-21  3:15 paul.szabo
  2013-01-21 17:49 ` Rik van Riel
                   ` (2 more replies)
  0 siblings, 3 replies; 17+ messages in thread
From: paul.szabo @ 2013-01-21  3:15 UTC (permalink / raw)
  To: linux-mm; +Cc: 695182, linux-kernel

When calculating amount of dirtyable memory, min_free_kbytes should be
subtracted because it is not intended for dirty pages.

Using an "extern int" because that is the only interface to some such
sysctl values.

(This patch does not solve the PAE OOM issue.)

Paul Szabo   psz@maths.usyd.edu.au   http://www.maths.usyd.edu.au/u/psz/
School of Mathematics and Statistics   University of Sydney    Australia

Reported-by: Paul Szabo <psz@maths.usyd.edu.au>
Reference: http://bugs.debian.org/695182
Signed-off-by: Paul Szabo <psz@maths.usyd.edu.au>

--- mm/page-writeback.c.old	2012-12-06 22:20:40.000000000 +1100
+++ mm/page-writeback.c	2013-01-21 13:57:05.000000000 +1100
@@ -343,12 +343,16 @@
 unsigned long determine_dirtyable_memory(void)
 {
 	unsigned long x;
+	extern int min_free_kbytes;
 
 	x = global_page_state(NR_FREE_PAGES) + global_reclaimable_pages();
 
 	if (!vm_highmem_is_dirtyable)
 		x -= highmem_dirtyable_memory(x);
 
+	/* Subtract min_free_kbytes */
+	x -= min(x, min_free_kbytes >> (PAGE_SHIFT - 10));
+
 	return x + 1;	/* Ensure that we never return 0 */
 }

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2013-01-28  6:23 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-25  9:53 [PATCH] Subtract min_free_kbytes from dirtyable memory paul.szabo
2013-01-25 13:01 ` Bug#695182: " Ben Hutchings
2013-01-25 23:49   ` paul.szabo
2013-01-26  0:10     ` Ben Hutchings
2013-01-26  3:05       ` paul.szabo
2013-01-26  3:07       ` paul.szabo
2013-01-26  3:17         ` Ben Hutchings
2013-01-26  0:14     ` Jonathan Nieder
2013-01-26 15:43       ` Theodore Ts'o
2013-01-26  7:44   ` Bug#695182: " Jonathan Nieder
2013-01-26 20:23     ` paul.szabo
2013-01-28  6:23 ` Minchan Kim
  -- strict thread matches above, loose matches on Subject: below --
2013-01-21  3:15 paul.szabo
2013-01-21 17:49 ` Rik van Riel
2013-01-22 23:38 ` Andrew Morton
2013-01-23  1:49 ` Minchan Kim
2013-01-23  3:11   ` paul.szabo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).