lkml.org 
[lkml]   [2013]   [Mar]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v6 1/2] mm: limit growth of 3% hardcoded other user reserve
On Mon, 18 Mar 2013 17:44:42 -0400 Andrew Shewmaker <agshew@gmail.com> wrote:

> Add user_reserve_kbytes knob.
>
> Limit the growth of the memory reserved for other user
> processes to min(3% current process size, user_reserve_pages).
>
> user_reserve_pages defaults to min(3% free pages, 128MB)

That was an epic changelog ;)

>
> ...
>
> +int __meminit init_user_reserve(void)
> +{
> + unsigned long free_kbytes;
> +
> + free_kbytes = global_page_state(NR_FREE_PAGES) << (PAGE_SHIFT - 10);
> +
> + sysctl_user_reserve_kbytes = min(free_kbytes / 32, 1UL << 17);
> + return 0;
> +}
> +module_init(init_user_reserve)

Problem is, the initial default values will become wrong if memory if
hot-added or hot-removed.

That could be fixed up by appropriate use of
register_memory_notifier(), but what would the notification handler do
if the operator has modified the value? Proportionally scale it?


\
 
 \ /
  Last update: 2013-03-27 23:01    [from the cache]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and my Meterkast|Read the blog