Re: [PATCH 2/2] vmscan: use atomic-long for shrinker batching

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

 



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@xxxxxxxxxx>
> ---
>  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@xxxxxxxxxxxxx

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>


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