From: Yang Shi <shy828301@gmail.com>
To: Roman Gushchin <guro@fb.com>
Cc: Shakeel Butt <shakeelb@google.com>,
paulmck@kernel.org, Kirill Tkhai <ktkhai@virtuozzo.com>,
Vlastimil Babka <vbabka@suse.cz>,
Dave Chinner <david@fromorbit.com>,
Johannes Weiner <hannes@cmpxchg.org>,
Michal Hocko <mhocko@suse.com>,
Andrew Morton <akpm@linux-foundation.org>,
Linux MM <linux-mm@kvack.org>,
linux-fsdevel <linux-fsdevel@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [v8 PATCH 05/13] mm: vmscan: use kvfree_rcu instead of call_rcu
Date: Mon, 8 Mar 2021 12:22:20 -0800 [thread overview]
Message-ID: <CAHbLzkr2KWZA2e34DNjqnK6H-Ai8ox-f7iOET6OumZArYTB8JQ@mail.gmail.com> (raw)
In-Reply-To: <YEZVhNhGqV33lPo9@carbon.dhcp.thefacebook.com>
On Mon, Mar 8, 2021 at 8:49 AM Roman Gushchin <guro@fb.com> wrote:
>
> On Sun, Mar 07, 2021 at 10:13:04PM -0800, Shakeel Butt wrote:
> > On Tue, Feb 16, 2021 at 4:13 PM Yang Shi <shy828301@gmail.com> wrote:
> > >
> > > Using kvfree_rcu() to free the old shrinker_maps instead of call_rcu().
> > > We don't have to define a dedicated callback for call_rcu() anymore.
> > >
> > > Signed-off-by: Yang Shi <shy828301@gmail.com>
> > > ---
> > > mm/vmscan.c | 7 +------
> > > 1 file changed, 1 insertion(+), 6 deletions(-)
> > >
> > > diff --git a/mm/vmscan.c b/mm/vmscan.c
> > > index 2e753c2516fa..c2a309acd86b 100644
> > > --- a/mm/vmscan.c
> > > +++ b/mm/vmscan.c
> > > @@ -192,11 +192,6 @@ static inline int shrinker_map_size(int nr_items)
> > > return (DIV_ROUND_UP(nr_items, BITS_PER_LONG) * sizeof(unsigned long));
> > > }
> > >
> > > -static void free_shrinker_map_rcu(struct rcu_head *head)
> > > -{
> > > - kvfree(container_of(head, struct memcg_shrinker_map, rcu));
> > > -}
> > > -
> > > static int expand_one_shrinker_map(struct mem_cgroup *memcg,
> > > int size, int old_size)
> > > {
> > > @@ -219,7 +214,7 @@ static int expand_one_shrinker_map(struct mem_cgroup *memcg,
> > > memset((void *)new->map + old_size, 0, size - old_size);
> > >
> > > rcu_assign_pointer(memcg->nodeinfo[nid]->shrinker_map, new);
> > > - call_rcu(&old->rcu, free_shrinker_map_rcu);
> > > + kvfree_rcu(old);
> >
> > Please use kvfree_rcu(old, rcu) instead of kvfree_rcu(old). The single
> > param can call synchronize_rcu().
>
> Oh, I didn't know about this difference. Thank you for noticing!
BTW, I think I could keep you and Kirill's acked-by with this change
(using two params form kvfree_rcu) since the change seems trivial.
next prev parent reply other threads:[~2021-03-08 20:23 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-17 0:13 [v8 PATCH 00/13] Make shrinker's nr_deferred memcg aware Yang Shi
2021-02-17 0:13 ` [v8 PATCH 01/13] mm: vmscan: use nid from shrink_control for tracepoint Yang Shi
2021-02-17 0:13 ` [v8 PATCH 02/13] mm: vmscan: consolidate shrinker_maps handling code Yang Shi
2021-02-17 0:13 ` [v8 PATCH 03/13] mm: vmscan: use shrinker_rwsem to protect shrinker_maps allocation Yang Shi
2021-03-08 6:40 ` Shakeel Butt
2021-02-17 0:13 ` [v8 PATCH 04/13] mm: vmscan: remove memcg_shrinker_map_size Yang Shi
2021-03-08 6:49 ` Shakeel Butt
2021-02-17 0:13 ` [v8 PATCH 05/13] mm: vmscan: use kvfree_rcu instead of call_rcu Yang Shi
2021-02-17 1:59 ` Roman Gushchin
2021-02-17 6:25 ` Kirill Tkhai
2021-03-08 6:13 ` Shakeel Butt
2021-03-08 14:54 ` Paul E. McKenney
2021-03-08 18:15 ` Yang Shi
2021-03-08 16:49 ` Roman Gushchin
2021-03-08 20:22 ` Yang Shi [this message]
2021-03-08 21:11 ` Shakeel Butt
2021-02-17 0:13 ` [v8 PATCH 06/13] mm: memcontrol: rename shrinker_map to shrinker_info Yang Shi
2021-03-08 6:50 ` Shakeel Butt
2021-02-17 0:13 ` [v8 PATCH 07/13] mm: vmscan: add shrinker_info_protected() helper Yang Shi
2021-03-08 6:52 ` Shakeel Butt
2021-02-17 0:13 ` [v8 PATCH 08/13] mm: vmscan: use a new flag to indicate shrinker is registered Yang Shi
2021-02-17 2:00 ` Roman Gushchin
2021-03-08 17:48 ` Shakeel Butt
2021-02-17 0:13 ` [v8 PATCH 09/13] mm: vmscan: add per memcg shrinker nr_deferred Yang Shi
2021-02-17 2:09 ` Roman Gushchin
2021-02-17 6:34 ` Kirill Tkhai
2021-03-08 19:12 ` Shakeel Butt
2021-03-08 20:30 ` Yang Shi
2021-03-08 21:11 ` Shakeel Butt
2021-02-17 0:13 ` [v8 PATCH 10/13] mm: vmscan: use per memcg nr_deferred of shrinker Yang Shi
2021-02-17 2:10 ` Roman Gushchin
2021-02-17 6:39 ` Kirill Tkhai
2021-03-08 19:14 ` Shakeel Butt
2021-02-17 0:13 ` [v8 PATCH 11/13] mm: vmscan: don't need allocate shrinker->nr_deferred for memcg aware shrinkers Yang Shi
2021-03-08 21:57 ` Shakeel Butt
2021-02-17 0:13 ` [v8 PATCH 12/13] mm: memcontrol: reparent nr_deferred when memcg offline Yang Shi
2021-03-08 23:42 ` Shakeel Butt
2021-02-17 0:13 ` [v8 PATCH 13/13] mm: vmscan: shrink deferred objects proportional to priority Yang Shi
2021-02-25 17:00 ` [v8 PATCH 00/13] Make shrinker's nr_deferred memcg aware Yang Shi
2021-03-01 15:05 ` Johannes Weiner
2021-03-01 17:03 ` Yang Shi
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=CAHbLzkr2KWZA2e34DNjqnK6H-Ai8ox-f7iOET6OumZArYTB8JQ@mail.gmail.com \
--to=shy828301@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=david@fromorbit.com \
--cc=guro@fb.com \
--cc=hannes@cmpxchg.org \
--cc=ktkhai@virtuozzo.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.com \
--cc=paulmck@kernel.org \
--cc=shakeelb@google.com \
--cc=vbabka@suse.cz \
/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).