lkml.org 
[lkml]   [2011]   [Feb]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 3/3][RESEND] Provide control over unmapped pages (v4)
On 02/01/2011 11:55 AM, Balbir Singh wrote:
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index 7b56473..2ac8549 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -1660,6 +1660,9 @@ zonelist_scan:
> unsigned long mark;
> int ret;
>
> + if (should_reclaim_unmapped_pages(zone))
> + wakeup_kswapd(zone, order, classzone_idx);
> +
> mark = zone->watermark[alloc_flags & ALLOC_WMARK_MASK];
> if (zone_watermark_ok(zone, order, mark,
> classzone_idx, alloc_flags))

<snip>

> +int sysctl_max_unmapped_ratio_sysctl_handler(ctl_table *table, int write,
> + void __user *buffer, size_t *length, loff_t *ppos)
> +{
> + struct zone *zone;
> + int rc;
> +
> + rc = proc_dointvec_minmax(table, write, buffer, length, ppos);
> + if (rc)
> + return rc;
> +
> + for_each_zone(zone)
> + zone->max_unmapped_pages = (zone->present_pages *
> + sysctl_max_unmapped_ratio) / 100;
> + return 0;
> +}
> +#endif
> +

<snip>

> +
> +bool should_reclaim_unmapped_pages(struct zone *zone)
> +{
> + if (unlikely(unmapped_page_control) &&
> + (zone_unmapped_file_pages(zone) > zone->max_unmapped_pages))
> + return true;
> + return false;
> +}
> +#endif

Why don't you limit the amount of unmapped pages for the whole system?
Current implementation, which limit unmapped pages per zone, may cause unnecessary
reclaiming. Because if memory access is not balanced among zones(or nodes),
the kernel may reclaim unmapped pages even though other zones/nodes have enough
spaces for them.

Anyway, I'm interested in this patchset. Because my customers in enterprise area
want this kind of feature for a long time to avoid direct reclaim completely
in a certain situation.

Regards,
Satoru


\
 
 \ /
  Last update: 2011-02-24 18:11    [W:0.055 / U:0.660 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site