xfs
[Top] [All Lists]

Re: [PATCH 05/19] shrinker: convert superblock shrinkers to new API

To: Dave Chinner <david@xxxxxxxxxxxxx>
Subject: Re: [PATCH 05/19] shrinker: convert superblock shrinkers to new API
From: Glauber Costa <glommer@xxxxxxxxxxxxx>
Date: Thu, 20 Dec 2012 15:06:42 +0400
Cc: <linux-kernel@xxxxxxxxxxxxxxx>, <linux-fsdevel@xxxxxxxxxxxxxxx>, <linux-mm@xxxxxxxxx>, <xfs@xxxxxxxxxxx>
In-reply-to: <1354058086-27937-6-git-send-email-david@xxxxxxxxxxxxx>
References: <1354058086-27937-1-git-send-email-david@xxxxxxxxxxxxx> <1354058086-27937-6-git-send-email-david@xxxxxxxxxxxxx>
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0
On 11/28/2012 03:14 AM, Dave Chinner wrote:
> +static long super_cache_count(struct shrinker *shrink, struct shrink_control 
> *sc)
> +{
> +     struct super_block *sb;
> +     long    total_objects = 0;
> +
> +     sb = container_of(shrink, struct super_block, s_shrink);
> +
> +     if (!grab_super_passive(sb))
> +             return -1;
> +


You're missing the GFP_FS check here. This leads to us doing all the
counting only to find out later, in the scanner, that we won't be able
to free it. Better exit early.

<Prev in Thread] Current Thread [Next in Thread>