From patchwork Sun Feb 7 15:21:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shakeel Butt X-Patchwork-Id: 12073041 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_INVALID,DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 68C87C433DB for ; Sun, 7 Feb 2021 15:22:05 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id DD0C164E49 for ; Sun, 7 Feb 2021 15:22:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DD0C164E49 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 24C036B0006; Sun, 7 Feb 2021 10:22:04 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 1FBF26B006C; Sun, 7 Feb 2021 10:22:04 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 112E06B006E; Sun, 7 Feb 2021 10:22:04 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0076.hostedemail.com [216.40.44.76]) by kanga.kvack.org (Postfix) with ESMTP id EF3116B0006 for ; Sun, 7 Feb 2021 10:22:03 -0500 (EST) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id AFF54181AEF09 for ; Sun, 7 Feb 2021 15:22:03 +0000 (UTC) X-FDA: 77791837326.18.bulb59_520a84b275f7 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin18.hostedemail.com (Postfix) with ESMTP id 91D91100ED0D0 for ; Sun, 7 Feb 2021 15:22:03 +0000 (UTC) X-HE-Tag: bulb59_520a84b275f7 X-Filterd-Recvd-Size: 4414 Received: from mail-pf1-f202.google.com (mail-pf1-f202.google.com [209.85.210.202]) by imf41.hostedemail.com (Postfix) with ESMTP for ; Sun, 7 Feb 2021 15:22:02 +0000 (UTC) Received: by mail-pf1-f202.google.com with SMTP id t12so2293561pfe.11 for ; Sun, 07 Feb 2021 07:22:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:date:message-id:mime-version:subject:from:to:cc; bh=LwrzzUOqvk7nQXNMsXvC9PLN9Jy02gm7UHyjOCvTH/w=; b=qPmlvXJSc8bIT6hbfFnv1+yDNzerJMSANr63wbcNfBh43VbJiYiAxQvI7xw+iJnMl5 d0GZRjEC/sOJiBr1patZSeDTTwK5Dcjvr4Qf6PLHgLo1Pq+Gp3EOVVmcbZIrJAe7Bqr7 Ny10J+rVytml1qdMeHYSD33XQY7M3/Jo7m6OPh7wZVyuaM+5Xrun86IY29p5M+iA/J98 b6af/ohF1+RaDhlmrCX5J3wH/d423U5pxEQFrTzPy8kGa0XKm4n912W65Oa5qV90gZRq xC45SIIklGT5mSngAfGK1wUPHagYKZ3hHRbx+yrSPQxyXe6Pu2Q/VgpnDDh+Yb58x4xE AxKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:message-id:mime-version:subject:from :to:cc; bh=LwrzzUOqvk7nQXNMsXvC9PLN9Jy02gm7UHyjOCvTH/w=; b=BGNjM6ds0n3n9BLzH2iby7xM3oy/Qnntrgd9AhKJ2BVwTIhW/01EBqe9+Okwj/xw++ ubf3pHlm94tmq2ii2cDKDqjazQjH59jBjk4eBeFFSRxs9TlojPinj4jlQcOADbY9nvJE 2l7n7Tm94lPm7cpj+ce7MTEhSbBgwbZQXbQeD9ECFj5QjAwLfBtr5tE/3H80RCAxlfiD qt3GXN8k81hA3O94KlQC3dLc56nVZl+Nr9u1rKiTG5S1GtLfheZu7tOB7WyIP5mDwpGd Sd013j3oAwFTWO1cNZ9xxVkTv/J+OyQhXuEdZ15alKvrHvdS9naQtFJ1YmcS1QCjl3JB zxzg== X-Gm-Message-State: AOAM532lWUH2RrtewHNpzlC/8pMYFfLGolCd6KEy2AjPNeNErUFAXEzX 5n/3QYWdAHxY0A8RP28ByKTyW3TcmVS0/A== X-Google-Smtp-Source: ABdhPJzEoqAkDISvW4T1npZCil6IfrXD0/PuwQsWrgAJNG8LDrjN93B1viaKvHDAwgXLfezciuVHGJ03Ldganw== X-Received: from shakeelb.svl.corp.google.com ([2620:15c:2cd:202:193e:fc7f:b382:cc9f]) (user=shakeelb job=sendgmr) by 2002:a17:90a:780c:: with SMTP id w12mr8190290pjk.135.1612711321765; Sun, 07 Feb 2021 07:22:01 -0800 (PST) Date: Sun, 7 Feb 2021 07:21:48 -0800 Message-Id: <20210207152148.1285842-1-shakeelb@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.30.0.478.g8a0d178c01-goog Subject: [PATCH] mm/list_lru.c: remove kvfree_rcu_local() From: Shakeel Butt To: Uladzislau Rezki , "Paul E . McKenney" , Andrew Morton Cc: Kirill Tkhai , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Shakeel Butt X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: The list_lru file used to have local kvfree_rcu() which was renamed by commit e0feed08ab41 ("mm/list_lru.c: Rename kvfree_rcu() to local variant") to introduce the globally visible kvfree_rcu(). Now we have global kvfree_rcu(), so remove the local kvfree_rcu_local() and just use the global one. Signed-off-by: Shakeel Butt Reviewed-by: Uladzislau Rezki Reviewed-by: Kirill Tkhai --- mm/list_lru.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/mm/list_lru.c b/mm/list_lru.c index fe230081690b..6f067b6b935f 100644 --- a/mm/list_lru.c +++ b/mm/list_lru.c @@ -373,21 +373,13 @@ static void memcg_destroy_list_lru_node(struct list_lru_node *nlru) struct list_lru_memcg *memcg_lrus; /* * This is called when shrinker has already been unregistered, - * and nobody can use it. So, there is no need to use kvfree_rcu_local(). + * and nobody can use it. So, there is no need to use kvfree_rcu(). */ memcg_lrus = rcu_dereference_protected(nlru->memcg_lrus, true); __memcg_destroy_list_lru_node(memcg_lrus, 0, memcg_nr_cache_ids); kvfree(memcg_lrus); } -static void kvfree_rcu_local(struct rcu_head *head) -{ - struct list_lru_memcg *mlru; - - mlru = container_of(head, struct list_lru_memcg, rcu); - kvfree(mlru); -} - static int memcg_update_list_lru_node(struct list_lru_node *nlru, int old_size, int new_size) { @@ -419,7 +411,7 @@ static int memcg_update_list_lru_node(struct list_lru_node *nlru, rcu_assign_pointer(nlru->memcg_lrus, new); spin_unlock_irq(&nlru->lock); - call_rcu(&old->rcu, kvfree_rcu_local); + kvfree_rcu(old, rcu); return 0; }