Re: [PATCH] Pass priority to shrink_slab

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

 



On Mon, Nov 22, 2010 at 3:06 PM, Andrew Morton
<akpm@xxxxxxxxxxxxxxxxxxxx> wrote:
> On Fri, 19 Nov 2010 19:23:22 -0800
> Ying Han <yinghan@xxxxxxxxxx> wrote:
>> Yes, and it would be much easier later to add a small feature (like this
>> one) w/o
>> touching so many files of the shrinkers. I am thinking if we can extend the
>> scan_control
>> from page reclaim and pass it down to the shrinker ?
>
> Yes, that might work.  All callers of shrink_slab() already have a
> scan_control on the stack, so passing all that extra info to the
> shrinkers (along with some extra fields if needed) is pretty cheap, and
> I don't see a great downside to exposing unneeded fields to the
> shrinkers, given they're already on the stack somewhere.

The only downside I can see is that it makes struct scan_control
public - it'll need to be declared in a public header file so that all
shrinkers can access it.

Maybe one way to mitigate this would be if we can make the shrinker
api take a *const* struct scan_control pointer as an argument, so that
it'll be clear that we expect the shrinkers to only read the
information in that struct.

-- 
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]