Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1581240pxb; Mon, 8 Mar 2021 00:46:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJy1ZPYhEDn1oWdUM+mce2HubD0MJi2aCeJrAcIWXSkkPgvpqX8b2jBrUAo02cCDm5QZNTMO X-Received: by 2002:a17:906:4993:: with SMTP id p19mr14029656eju.421.1615193160854; Mon, 08 Mar 2021 00:46:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615193160; cv=none; d=google.com; s=arc-20160816; b=nDEgiqj9SNLvX/Duj5oqAZWs3voQPuRiOevYGY4SRMZSyOKBrCSm5OWxjZwiLzd5/Q bJ7MLOL3K61kRPGSbdqAgRPNSqBSV4xe1ve3mLHnYmThhfE91LO2G2qyaV7JFd19N+sD 2wh8Dj42mWiUeq4u19fbIc4VeVt4eZ5ZBlQMi1bFkGRuc+BORfUOil22RiBNzm4wdCIU z1R+lztZo27YrHxlzi52Ww194yLlAGuS+eJNGO21p8tAuiUR2u7+m9zzlB0QzdFZ1Dq0 Mpi6K6p6G2VuaY6gsNTt1oZsyqelqf1PGAACAa7ispwSkVCVK4Mwm+msKYylpY0XhSAI RtfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=5zuLyIMtTu9vDSB4XkfAbZ0uX4PD6RfhA/3r6OaoQnI=; b=lYwgsDZL0sSpvqgvceG8W0gfpa47AwoSayzneSUoximGYLQhVJ2L2oinKbw8vhl8bx ujYs4wj4Awp0Vr3kyQIz7RsPLUmoB6jTB0OtStDx4nmZWgotnRVI25icJXtl0cKQvCzt ifW13dKqMClswXNw5AFleDYJTo4+l0QjFL7B8oZzuLY0KIU1EUqFS/DPlRYCXoTdL9dS iO8efuKr5qatDnjLfPPijiSlb4R0OMsfPWusnLuwBCBxuB7rHHNmEDHVqWEufA5HI+qC 2gQBOGF61AVZJg1wSbUlGJyaUZsYnqtJWEjwZEQVfCSoz9wPfq2gyqMY5k+7ATtnNDiz Hs0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="r6Qi4/4a"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j3si6448099ejc.508.2021.03.08.00.45.38; Mon, 08 Mar 2021 00:46:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="r6Qi4/4a"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234823AbhCHGNm (ORCPT + 99 others); Mon, 8 Mar 2021 01:13:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34506 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234795AbhCHGNU (ORCPT ); Mon, 8 Mar 2021 01:13:20 -0500 Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 068C3C06174A for ; Sun, 7 Mar 2021 22:13:19 -0800 (PST) Received: by mail-lf1-x12f.google.com with SMTP id m22so19146742lfg.5 for ; Sun, 07 Mar 2021 22:13:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=5zuLyIMtTu9vDSB4XkfAbZ0uX4PD6RfhA/3r6OaoQnI=; b=r6Qi4/4arJHvPgvhwoboibouvpk0NWSX8MipZS8QZ+BrdZdxwLBJKUDwMfgmWSW8Yu OZH2B04mSUrDBog35HKb+a26mrY/JSo/rqgSYqxxjkElj0TqI93KxvK8mDOdBk4yZ7J4 X/0C1ExrYOpYy5hiIVH9AbKIOyHIhFTpjKjr+hIOCJRuZ+ncLhH7CbLiEcOvouFEaks8 ShgECUbJ2CftJDm7mTfytGlC3iYLnz1LyTBoe8LmYjmUAUctAzwe0brhEZqv408a/h58 shgs2HrLbuotvQ96Mkx66y73Bhm7sRyhj8qZJ3j4bk8muAJ9YVm+P3RmqRFS57fU58zb pGIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=5zuLyIMtTu9vDSB4XkfAbZ0uX4PD6RfhA/3r6OaoQnI=; b=CKA7/DNtYk3uFDbbXZd/cFWIi4DGTRbSlUmsjdICr5rAvRr42swZO8Dq6cgrONEWAv Al8wJEDtMI6awxvB6F0DCrmLy8L/+rB1leGbqEJHbUuJoSxHoUonBdXNFjPacUaA3Wx2 BBmV+NR5zUi3AkDDyX3jrkbfMt9ueTA2sisWLFCCPVRGRYCoWlPk/CH27O4wV+cNxRrC SnAlqxGfACYz1grwY5EvVl0aMJblWJnnt8w9ysvNUqlrI18nRYYrHjsE3sfvk7oxSpBr V5Jj2oOvi1okYZ2fFi/AyTg0JIvisHwgDDhXtc7FZyYmI72fhjnP3xmuHSWRnQyQesPV xhfg== X-Gm-Message-State: AOAM533FOkasjkaWnFSBG3df9T8lutZMrj3d+fi1P021u3gBln4zqpKX eTXdILzYsiWJJgJy4WLwAe2nSTuIqDA/a2gezx3OcA== X-Received: by 2002:a05:6512:6c6:: with SMTP id u6mr13260075lff.347.1615183998124; Sun, 07 Mar 2021 22:13:18 -0800 (PST) MIME-Version: 1.0 References: <20210217001322.2226796-1-shy828301@gmail.com> <20210217001322.2226796-6-shy828301@gmail.com> In-Reply-To: <20210217001322.2226796-6-shy828301@gmail.com> From: Shakeel Butt Date: Sun, 7 Mar 2021 22:13:04 -0800 Message-ID: Subject: Re: [v8 PATCH 05/13] mm: vmscan: use kvfree_rcu instead of call_rcu To: Yang Shi , paulmck@kernel.org Cc: Roman Gushchin , Kirill Tkhai , Vlastimil Babka , Dave Chinner , Johannes Weiner , Michal Hocko , Andrew Morton , Linux MM , linux-fsdevel , LKML Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 16, 2021 at 4:13 PM Yang Shi 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 > --- > 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().