Re: shrinkers: Add node to indicate where to target shrinking

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Nov 13, 2010 at 11:10 PM, KOSAKI Motohiro
<kosaki.motohiro@xxxxxxxxxxxxxx> wrote:
>> On Thu, Oct 21, 2010 at 11:00 AM, Christoph Lameter <cl@xxxxxxxxx> wrote:
>> > @@ -218,6 +218,7 @@ unsigned long shrink_slab(unsigned long
>> >                unsigned long total_scan;
>> >                unsigned long max_pass;
>> >
>> > +               shrinker->node = node;
>> >                max_pass = (*shrinker->shrink)(shrinker, 0, gfp_mask);
>> >                delta = (4 * scanned) / shrinker->seeks;
>> >                delta *= max_pass;
>>
>> Apologies for coming late to the party, but I have to ask - is there
>> anything protecting shrinker->node from concurrent modification if
>> several threads are trying to reclaim memory at once ?
>
> shrinker_rwsem? :)

Doesn't work - it protects shrink_slab() from concurrent modifications
of the shrinker_list in register_shrinker() or unregister_shrinker(),
but several shirnk_slab() calls can still execute in parallel since
they only grab shrinker_rwsem in shared (read) mode.

-- 
Michel "Walken" Lespinasse
A program is never fully debugged until the last user dies.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxxx  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom policy in Canada: sign http://dissolvethecrtc.ca/
Don't email: <a href


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]