linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andrey Ryabinin <aryabinin@virtuozzo.com>
To: josef@toxicpanda.com, minchan@kernel.org, linux-mm@kvack.org,
	hannes@cmpxchg.org, riel@redhat.com, akpm@linux-foundation.org,
	david@fromorbit.com, kernel-team@fb.com
Cc: Josef Bacik <jbacik@fb.com>
Subject: Re: [PATCH 1/2] mm: use sc->priority for slab shrink targets
Date: Thu, 24 Aug 2017 17:29:59 +0300	[thread overview]
Message-ID: <a6a68b0b-4138-2563-fa53-ad8406dc6e34@virtuozzo.com> (raw)
In-Reply-To: <1503430539-2878-1-git-send-email-jbacik@fb.com>



On 08/22/2017 10:35 PM, josef@toxicpanda.com 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@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  parent reply	other threads:[~2017-08-24 14:27 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-22 19:35 [PATCH 1/2] mm: use sc->priority for slab shrink targets josef
2017-08-22 19:35 ` [PATCH 2/2][v2] mm: make kswapd try harder to keep active pages in cache josef
2017-08-24  7:22   ` Minchan Kim
2017-08-24  7:08 ` [PATCH 1/2] mm: use sc->priority for slab shrink targets Minchan Kim
2017-08-24 14:29 ` Andrey Ryabinin [this message]
2017-08-24 14:49   ` Josef Bacik
2017-08-24 22:15     ` Dave Chinner
2017-08-24 22:45       ` Josef Bacik
2017-08-25  1:40         ` Dave Chinner
  -- strict thread matches above, loose matches on Subject: below --
2017-07-20 18:45 [PATCH 0/2][V3] slab and general reclaim improvements josef
2017-07-20 18:45 ` [PATCH 1/2] mm: use sc->priority for slab shrink targets josef
2017-07-27 23:53   ` Andrew Morton
2017-07-28 23:52     ` Josef Bacik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a6a68b0b-4138-2563-fa53-ad8406dc6e34@virtuozzo.com \
    --to=aryabinin@virtuozzo.com \
    --cc=akpm@linux-foundation.org \
    --cc=david@fromorbit.com \
    --cc=hannes@cmpxchg.org \
    --cc=jbacik@fb.com \
    --cc=josef@toxicpanda.com \
    --cc=kernel-team@fb.com \
    --cc=linux-mm@kvack.org \
    --cc=minchan@kernel.org \
    --cc=riel@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).