[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110822232650.GU3162@dastard>
Date: Tue, 23 Aug 2011 09:26:50 +1000
From: Dave Chinner <david@...morbit.com>
To: Konstantin Khlebnikov <khlebnikov@...nvz.org>
Cc: linux-mm@...ck.org, Andrew Morton <akpm@...ux-foundation.org>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] vmscan: use atomic-long for shrinker batching
On Mon, Aug 22, 2011 at 02:17:27PM +0300, Konstantin Khlebnikov wrote:
> Use atomic-long operations instead of looping around cmpxchg().
>
> Signed-off-by: Konstantin Khlebnikov <khlebnikov@...nvz.org>
> ---
> include/linux/shrinker.h | 2 +-
> mm/vmscan.c | 17 +++++++----------
> 2 files changed, 8 insertions(+), 11 deletions(-)
>
> diff --git a/include/linux/shrinker.h b/include/linux/shrinker.h
> index 790651b..ac6b8ee 100644
> --- a/include/linux/shrinker.h
> +++ b/include/linux/shrinker.h
> @@ -34,7 +34,7 @@ struct shrinker {
>
> /* These are for internal use */
> struct list_head list;
> - long nr; /* objs pending delete */
> + atomic_long_t nr_in_batch; /* objs pending delete */
It's not really the number in a batch - we use the "batch" term to
refer to the value we set sc->nr_to_scan for each shrinker scan call.
This is more the overflow of unscanned objects - objects pending
delete, as the comment says. So renaming it "nr_pending" might be
better.
As it is, this is a good change - I'll fold it into the series I
already have.
Cheers,
Dave.
--
Dave Chinner
david@...morbit.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists