linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@suse.com>
To: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Cc: linux-mm@kvack.org, Dave Chinner <dchinner@redhat.com>,
	Mel Gorman <mgorman@suse.de>, Glauber Costa <glommer@gmail.com>
Subject: Re: [PATCH] mm,vmscan: don't pretend forward progress upon shrinker_rwsem contention
Date: Tue, 13 Feb 2018 11:13:29 +0100	[thread overview]
Message-ID: <20180213101329.GN3443@dhcp22.suse.cz> (raw)
In-Reply-To: <1518184544-3293-1-git-send-email-penguin-kernel@I-love.SAKURA.ne.jp>

[Fix Glauber's email]

On Fri 09-02-18 22:55:44, Tetsuo Handa wrote:
> Since we no longer use return value of shrink_slab() for normal reclaim,
> the comment is no longer true. If some do_shrink_slab() call takes
> unexpectedly long (root cause of stall is currently unknown) when
> register_shrinker()/unregister_shrinker() is pending, trying to drop
> caches via /proc/sys/vm/drop_caches could become infinite cond_resched()
> loop if many mem_cgroup are defined. For safety, let's not pretend forward
> progress.
> 
> Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
> Cc: Dave Chinner <dchinner@redhat.com>
> Cc: Glauber Costa <glommer@parallels.com>
> Cc: Mel Gorman <mgorman@suse.de>

Yes, this makes sense to me. The whole "let's pretend we made some
progress" was an ugly hack IMHO.

Acked-by: Michal Hocko <mhocko@suse.ccom>

> ---
>  mm/vmscan.c | 10 +---------
>  1 file changed, 1 insertion(+), 9 deletions(-)
> 
> diff --git a/mm/vmscan.c b/mm/vmscan.c
> index 4447496..17da5a5 100644
> --- a/mm/vmscan.c
> +++ b/mm/vmscan.c
> @@ -442,16 +442,8 @@ static unsigned long shrink_slab(gfp_t gfp_mask, int nid,
>  	if (memcg && (!memcg_kmem_enabled() || !mem_cgroup_online(memcg)))
>  		return 0;
>  
> -	if (!down_read_trylock(&shrinker_rwsem)) {
> -		/*
> -		 * If we would return 0, our callers would understand that we
> -		 * have nothing else to shrink and give up trying. By returning
> -		 * 1 we keep it going and assume we'll be able to shrink next
> -		 * time.
> -		 */
> -		freed = 1;
> +	if (!down_read_trylock(&shrinker_rwsem))
>  		goto out;
> -	}
>  
>  	list_for_each_entry(shrinker, &shrinker_list, list) {
>  		struct shrink_control sc = {
> -- 
> 1.8.3.1
> 
> --
> 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>

-- 
Michal Hocko
SUSE Labs

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

  reply	other threads:[~2018-02-13 10:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-09 13:55 [PATCH] mm,vmscan: don't pretend forward progress upon shrinker_rwsem contention Tetsuo Handa
2018-02-13 10:13 ` Michal Hocko [this message]
2018-02-20 13:29   ` Tetsuo Handa

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=20180213101329.GN3443@dhcp22.suse.cz \
    --to=mhocko@suse.com \
    --cc=dchinner@redhat.com \
    --cc=glommer@gmail.com \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@suse.de \
    --cc=penguin-kernel@I-love.SAKURA.ne.jp \
    /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).