linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
To: mhocko@kernel.org
Cc: linux-mm@kvack.org, akpm@linux-foundation.org,
	viro@zeniv.linux.org.uk, glauber@scylladb.com,
	syzkaller@googlegroups.com
Subject: Re: [PATCH v2 1/2] mm,vmscan: Make unregister_shrinker() no-op if register_shrinker() failed.
Date: Wed, 29 Nov 2017 22:44:45 +0900	[thread overview]
Message-ID: <201711292244.BHF26553.MOFQFtVJHOOFSL@I-love.SAKURA.ne.jp> (raw)
In-Reply-To: <20171127082936.27yt7sn2ucatvben@dhcp22.suse.cz>

Michal Hocko wrote:
> On Sat 25-11-17 10:40:13, Tetsuo Handa wrote:
> > Michal Hocko wrote:
> > > On Fri 24-11-17 22:21:55, Tetsuo Handa wrote:
> > > > Michal Hocko wrote:
> > > > > > Since we can encourage register_shrinker() callers to check for failure
> > > > > > by marking register_shrinker() as __must_check, unregister_shrinker()
> > > > > > can stay silent.
> > > > > 
> > > > > I am not sure __must_check is the right way. We already do get
> > > > > allocation warning if the registration fails so silent unregister is
> > > > > acceptable. Unchecked register_shrinker is a bug like any other
> > > > > unchecked error path.
> > > > 
> > > > I consider that __must_check is the simplest way to find all of
> > > > unchecked register_shrinker bugs. Why not to encourage users to fix?
> > > 
> > > because git grep doesn't require to patch the kernel and still provide
> > > the information you want.
> > 
> > I can't interpret this line. How git grep relevant?
> 
> you do not have to compile to see who is checking the return value.
> Seriously there is no need to overcomplicate this. Newly added shrinkers
> know the function returns might fail so we just have to handle existing
> users and there are not all that many of those.

Newly added shrinker users are not always careful. See commit f2517eb76f1f2f7f
("android: binder: Add global lru shrinker to binder") for example.
Unless we send __must_check change to linux.git, people won't notice it.

--
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:[~2017-11-29 13:44 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-24 11:36 Tetsuo Handa
2017-11-24 11:36 ` [PATCH v2 2/2] mm,vmscan: Mark register_shrinker() as __must_check Tetsuo Handa
2017-11-24 12:24   ` Michal Hocko
2017-11-24 13:26     ` Tetsuo Handa
2017-11-24 13:37       ` Michal Hocko
2017-11-24 12:21 ` [PATCH v2 1/2] mm,vmscan: Make unregister_shrinker() no-op if register_shrinker() failed Michal Hocko
2017-11-24 13:21   ` Tetsuo Handa
2017-11-24 13:28     ` Michal Hocko
2017-11-25  1:40       ` Tetsuo Handa
2017-11-27  8:29         ` Michal Hocko
2017-11-29 13:44           ` Tetsuo Handa [this message]
2017-11-29 13:55             ` Michal Hocko

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=201711292244.BHF26553.MOFQFtVJHOOFSL@I-love.SAKURA.ne.jp \
    --to=penguin-kernel@i-love.sakura.ne.jp \
    --cc=akpm@linux-foundation.org \
    --cc=glauber@scylladb.com \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.org \
    --cc=syzkaller@googlegroups.com \
    --cc=viro@zeniv.linux.org.uk \
    /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