Re: [PATCH 1/2] mm: use sc->priority for slab shrink targets

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

 




On 08/22/2017 10:35 PM, josef@xxxxxxxxxxxxxx wrote:
> --- a/mm/vmscan.c
> +++ b/mm/vmscan.c
> @@ -306,9 +306,7 @@ EXPORT_SYMBOL(unregister_shrinker);
>  #define SHRINK_BATCH 128
>  
>  static unsigned long do_shrink_slab(struct shrink_control *shrinkctl,
> -				    struct shrinker *shrinker,
> -				    unsigned long nr_scanned,
> -				    unsigned long nr_eligible)
> +				    struct shrinker *shrinker, int priority)
>  {
>  	unsigned long freed = 0;
>  	unsigned long long delta;
> @@ -333,9 +331,8 @@ static unsigned long do_shrink_slab(struct shrink_control *shrinkctl,
>  	nr = atomic_long_xchg(&shrinker->nr_deferred[nid], 0);
>  
>  	total_scan = nr;
> -	delta = (4 * nr_scanned) / shrinker->seeks;
> -	delta *= freeable;
> -	do_div(delta, nr_eligible + 1);
> +	delta = freeable >> priority;
> +	delta = (4 * freeable) / shrinker->seeks;

Something is wrong. The first line does nothing.


>  	total_scan += delta;
>  	if (total_scan < 0) {
>  		pr_err("shrink_slab: %pF negative objects to delete nr=%ld\n",

--
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/ .
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 OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]
  Powered by Linux