Re: [PATCH v10 12/35] shrinker: add node awareness

Glauber Costa
2013-06-06T08:23:26Z

On 06/06/2013 03:08 AM, Andrew Morton wrote:
> On Mon, 3 Jun 2013 23:29:41 +0400 Glauber Costa <glommer-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org> wrote:
>
>> From: Dave Chinner <dchinner-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
>>
>> Pass the node of the current zone being reclaimed to shrink_slab(),
>> allowing the shrinker control nodemask to be set appropriately for
>> node aware shrinkers.
>
> Again, some musings on node hotplug would be interesting.
>
>> --- a/drivers/staging/android/ashmem.c
>> +++ b/drivers/staging/android/ashmem.c
>> @@ -692,6 +692,9 @@ static long ashmem_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
>> .gfp_mask = GFP_KERNEL,
>> .nr_to_scan = 0,
>> };
>> +
>> + nodes_setall(sc.nodes_to_scan);
>
> hm, is there some way to do this within the initializer? ie:
>
> .nodes_to_scan = magic_goes_here(),
>
> Also, it's a bit sad to set bits for not-present and not-online nodes.
>

Unfortunately there is no "nodes_setpresent" or anything like that in
nodemask.h. Maybe I should just go ahead and write them.