From patchwork Tue Sep 14 07:28:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12491851 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_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 50A11C433EF for ; Tue, 14 Sep 2021 07:33:05 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D035061056 for ; Tue, 14 Sep 2021 07:33:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org D035061056 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 7759A940007; Tue, 14 Sep 2021 03:33:04 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 74C436B0071; Tue, 14 Sep 2021 03:33:04 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 614CA940007; Tue, 14 Sep 2021 03:33:04 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0212.hostedemail.com [216.40.44.212]) by kanga.kvack.org (Postfix) with ESMTP id 534556B006C for ; Tue, 14 Sep 2021 03:33:04 -0400 (EDT) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 1A31E181355FB for ; Tue, 14 Sep 2021 07:33:04 +0000 (UTC) X-FDA: 78585362688.23.CCA8D0E Received: from mail-pg1-f175.google.com (mail-pg1-f175.google.com [209.85.215.175]) by imf30.hostedemail.com (Postfix) with ESMTP id D9B29E001982 for ; Tue, 14 Sep 2021 07:33:03 +0000 (UTC) Received: by mail-pg1-f175.google.com with SMTP id e7so11937440pgk.2 for ; Tue, 14 Sep 2021 00:33:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=gWCb9mX5Tccbd9CST9przEKxw+x/XOfn2zfVE9J87jE=; b=gt93lYs0v6WgNM7WwrP6n5fC0cnWuhYjHWP5ts7TA1kWd1STI2P9UTp4wCFszZaY6P DN/+6d4qFvixYVGP/2yCdaPcxRIQRH8Ecy+RtUMRiTQVSfp3Et36RMJoZR1xY5uYiJ5k iSjuu8vqQxPjxQOBCFMFMCwR7CnjUTGY8CgeeEc6s1nhstrlQG/Y94OeeAro0vR8WnFz Yj0gns/NpEwYPxjKuWKEeRQStLOT6m3DoutxVOgqLtU60JHoAq5mco39Y0lDHVWYwgt1 sHwPDxp+ast9TcqJP+owH12ttPCvkChcWwxVCaskkOLiZHhgoRAqYd+PKDjF7rrjxWRJ 00tA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=gWCb9mX5Tccbd9CST9przEKxw+x/XOfn2zfVE9J87jE=; b=O/Bs0LJFUNiAwFWAfEQcTaWrwlLQRAdlCzCI6yVyqGJXJAnaSqMqLydXFeH61Ik4Qu xTTVMNyYlFEa7ZINhADedwVPA5JmTCP1NnMdMwD7yJggwxkMcIhkQMLTlUw4dBl1jW8o 82DZjjM5ODKA8/HaQZxtzDRPNQIlKJTKvNmZjWJPC6N6UhgN/mXWnjnmBKXtmm3pOBfR K7LogGY0AbyOKWBvlx09p4vHI88oFaUqbD9WBIFoHK/lLGOBQ5+Jwy9kRTsUOvKmIzNq wHZ96OqMmOWOLxsS9yYr7oQVwNSB1X6T0WIPG7k8Z5hrIYYSSVqC5vgApHZKxnQkpsja vk+A== X-Gm-Message-State: AOAM532mXZqtATVm+mehBm1P8BhzNUytnT+tj7VT/Pa5UKICRJOHah/J VOv85pEwRuHCxvxANXIlizuJxA== X-Google-Smtp-Source: ABdhPJxskCh3uAqwW44HafdpZET2ZOfsNGGneakGYVgU3YZLmwPaFGYlMvKICArQQ4Dg52CAuCfOiQ== X-Received: by 2002:a63:4344:: with SMTP id q65mr14370885pga.364.1631604782954; Tue, 14 Sep 2021 00:33:02 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.244]) by smtp.gmail.com with ESMTPSA id s3sm9377839pfd.188.2021.09.14.00.32.55 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Sep 2021 00:33:02 -0700 (PDT) From: Muchun Song To: willy@infradead.org, akpm@linux-foundation.org, hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, shakeelb@google.com, guro@fb.com, shy828301@gmail.com, alexs@kernel.org, richard.weiyang@gmail.com, david@fromorbit.com, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, zhengqi.arch@bytedance.com, duanxiongchun@bytedance.com, fam.zheng@bytedance.com, smuchun@gmail.com, Muchun Song Subject: [PATCH v3 01/76] mm: list_lru: fix the return value of list_lru_count_one() Date: Tue, 14 Sep 2021 15:28:23 +0800 Message-Id: <20210914072938.6440-2-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20210914072938.6440-1-songmuchun@bytedance.com> References: <20210914072938.6440-1-songmuchun@bytedance.com> MIME-Version: 1.0 Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=gt93lYs0; spf=pass (imf30.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.215.175 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: D9B29E001982 X-Stat-Signature: tnt4ost55ofjbetspofmbqg15aqg7cjf X-HE-Tag: 1631604783-524737 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: Since commit 2788cf0c401c ("memcg: reparent list_lrus and free kmemcg_id on css offline"), ->nr_items can be negative during memory cgroup reparenting. In this case, list_lru_count_one() returns an unusual and huge value, which will surprise users. So let it returns zero when ->nr_items is negative. Signed-off-by: Muchun Song --- mm/list_lru.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mm/list_lru.c b/mm/list_lru.c index cd58790d0fb3..4962d48d4410 100644 --- a/mm/list_lru.c +++ b/mm/list_lru.c @@ -176,13 +176,16 @@ unsigned long list_lru_count_one(struct list_lru *lru, { struct list_lru_node *nlru = &lru->node[nid]; struct list_lru_one *l; - unsigned long count; + long count; rcu_read_lock(); l = list_lru_from_memcg_idx(nlru, memcg_cache_id(memcg)); count = READ_ONCE(l->nr_items); rcu_read_unlock(); + if (unlikely(count < 0)) + count = 0; + return count; } EXPORT_SYMBOL_GPL(list_lru_count_one); From patchwork Tue Sep 14 07:28:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12491853 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_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 8F566C4332F for ; Tue, 14 Sep 2021 07:33:12 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 45D0A61056 for ; Tue, 14 Sep 2021 07:33:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 45D0A61056 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id E2C08940008; Tue, 14 Sep 2021 03:33:11 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DDB9D6B0071; Tue, 14 Sep 2021 03:33:11 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CCC76940008; Tue, 14 Sep 2021 03:33:11 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0249.hostedemail.com [216.40.44.249]) by kanga.kvack.org (Postfix) with ESMTP id BEA686B006C for ; Tue, 14 Sep 2021 03:33:11 -0400 (EDT) Received: from smtpin31.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 711CA8249980 for ; Tue, 14 Sep 2021 07:33:11 +0000 (UTC) X-FDA: 78585362982.31.678895F Received: from mail-pj1-f46.google.com (mail-pj1-f46.google.com [209.85.216.46]) by imf28.hostedemail.com (Postfix) with ESMTP id 36F9490000A2 for ; Tue, 14 Sep 2021 07:33:11 +0000 (UTC) Received: by mail-pj1-f46.google.com with SMTP id me5-20020a17090b17c500b0019af76b7bb4so777451pjb.2 for ; Tue, 14 Sep 2021 00:33:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=q+aIm9+GM4emS27x0YwVh2nGeYKtoN9v9qJyVZ5TBac=; b=tcVTQvhIix8U0yHs7BLHxZMEPABn2dsISnmA+yZSjfp2ev8MDXF7eDdHAJvKPJ4xkX PNr4ylRUrZ34B88F2kvtAUWfVN/EBD5BtpS3HZkEZR7BfQzT4p6Y06tR5/9VG6+Aodei kRVGcb0pqYSCsfsEgkErotCWrmEoNZD3PSjBW5Y1YAHYtiI/6gja9Wn4fePBE7onrQvH XAJ9td79+7/0McQCwSWs8BQRVLW9G2c19R0KmRwiF3B0GmMMCIdbZo5u6p4o2Eey12cL A5JPRu3pkpDV34iUR4H0LYryP9pdO/oldTjF/MRuJrzVq0xtrcya5/P41feW2Vomf4bo xiMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=q+aIm9+GM4emS27x0YwVh2nGeYKtoN9v9qJyVZ5TBac=; b=MrZdVAtp5J2cLA8swUEYxGO2lJd5pfSbXUkbSXaneirSPxXour+dc0aWtz7Vh2agQU DA16FoqmKONCuL/eqNbwYnGAeyrk2B8xgD6q9UVnZWR8teBnEJLiALn0YndyDjMIqztz izBtC6cK0Yh8rUCAdQ5Y/NF0mE3PtDTq8FXMty3O8+2idn7LJYcplyy+jQVvWSxia8a9 AtBLB9H8cUiXmswWaw2p/QLErTLHoUc+3huK5739cdLCTlVUsNWtVbejoSxI+ogYKgLc 0FPug5IO/+bXTW9oKsj+MnyayfbkLOBvq6eFrOeMsceYjkm1jrQsBp7bzoibGNvpFMsi nUpA== X-Gm-Message-State: AOAM533xZMXK1Y6OUSflBt6PniG9rleBk/f2+WqPK/RSwOu6tCJGh+7N Kff6AaXu8HVp0KIgIImB9DQY6g== X-Google-Smtp-Source: ABdhPJy5yp11xZApIkE1Vn113OINJsFeyKeaalsWeRxGnUmKvHenQWNNl7bwBD87nXmQEd1XiYqflQ== X-Received: by 2002:a17:90a:7f85:: with SMTP id m5mr510983pjl.185.1631604790353; Tue, 14 Sep 2021 00:33:10 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.244]) by smtp.gmail.com with ESMTPSA id s3sm9377839pfd.188.2021.09.14.00.33.03 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Sep 2021 00:33:10 -0700 (PDT) From: Muchun Song To: willy@infradead.org, akpm@linux-foundation.org, hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, shakeelb@google.com, guro@fb.com, shy828301@gmail.com, alexs@kernel.org, richard.weiyang@gmail.com, david@fromorbit.com, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, zhengqi.arch@bytedance.com, duanxiongchun@bytedance.com, fam.zheng@bytedance.com, smuchun@gmail.com, Muchun Song Subject: [PATCH v3 02/76] mm: memcontrol: remove kmemcg_id reparenting Date: Tue, 14 Sep 2021 15:28:24 +0800 Message-Id: <20210914072938.6440-3-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20210914072938.6440-1-songmuchun@bytedance.com> References: <20210914072938.6440-1-songmuchun@bytedance.com> MIME-Version: 1.0 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 36F9490000A2 X-Stat-Signature: 6psyh4x49ercfcqfinrz4141ooeo6djt Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=tcVTQvhI; spf=pass (imf28.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.216.46 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com X-HE-Tag: 1631604791-252731 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: Since slab objects and kmem pages are charged to object cgroup instead of memory cgroup, memcg_reparent_objcgs() will reparent this cgroup and all its descendants to its parent cgroup. This already makes further list_lru_add()'s add elements to the parent's list. So it is unnecessary to change kmemcg_id of an offline cgroup to its parent's id. It just wastes CPU cycles. Just to remove those redundant code. Signed-off-by: Muchun Song --- mm/memcontrol.c | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 999e626f4111..e0d7ceb0db26 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -3635,8 +3635,7 @@ static int memcg_online_kmem(struct mem_cgroup *memcg) static void memcg_offline_kmem(struct mem_cgroup *memcg) { - struct cgroup_subsys_state *css; - struct mem_cgroup *parent, *child; + struct mem_cgroup *parent; int kmemcg_id; if (memcg->kmem_state != KMEM_ONLINE) @@ -3653,22 +3652,7 @@ static void memcg_offline_kmem(struct mem_cgroup *memcg) kmemcg_id = memcg->kmemcg_id; BUG_ON(kmemcg_id < 0); - /* - * Change kmemcg_id of this cgroup and all its descendants to the - * parent's id, and then move all entries from this cgroup's list_lrus - * to ones of the parent. After we have finished, all list_lrus - * corresponding to this cgroup are guaranteed to remain empty. The - * ordering is imposed by list_lru_node->lock taken by - * memcg_drain_all_list_lrus(). - */ - rcu_read_lock(); /* can be called from css_free w/o cgroup_mutex */ - css_for_each_descendant_pre(css, &memcg->css) { - child = mem_cgroup_from_css(css); - BUG_ON(child->kmemcg_id != kmemcg_id); - child->kmemcg_id = parent->kmemcg_id; - } - rcu_read_unlock(); - + /* memcg_reparent_objcgs() must be called before this. */ memcg_drain_all_list_lrus(kmemcg_id, parent); memcg_free_cache_id(kmemcg_id); From patchwork Tue Sep 14 07:28:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12491855 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_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 4B79EC433F5 for ; Tue, 14 Sep 2021 07:33:19 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id EFD3760F4A for ; Tue, 14 Sep 2021 07:33:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org EFD3760F4A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 8FBB1940009; Tue, 14 Sep 2021 03:33:18 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8ABD26B0071; Tue, 14 Sep 2021 03:33:18 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 773C9940009; Tue, 14 Sep 2021 03:33:18 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0201.hostedemail.com [216.40.44.201]) by kanga.kvack.org (Postfix) with ESMTP id 693B36B006C for ; Tue, 14 Sep 2021 03:33:18 -0400 (EDT) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 10F3A2D3A5 for ; Tue, 14 Sep 2021 07:33:18 +0000 (UTC) X-FDA: 78585363276.28.DEB6D24 Received: from mail-pg1-f181.google.com (mail-pg1-f181.google.com [209.85.215.181]) by imf15.hostedemail.com (Postfix) with ESMTP id D2566D000099 for ; Tue, 14 Sep 2021 07:33:17 +0000 (UTC) Received: by mail-pg1-f181.google.com with SMTP id n18so11899110pgm.12 for ; Tue, 14 Sep 2021 00:33:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Vnv6075e5xDpDmjVmdi7yoSCEZdGGyfQtI+r26s3BY0=; b=MXKF76sadscNWBEDPyWQ6ydw7qu1qu4KQ08PzoC25+M2nyogxyvWh6Vo6e6fuT9KjJ EPHFNIl5glwAj56Ghs9GNUoPI5ErOuZk44qv75QztfuFwjeTeG1L4pSr8kFop1qlM185 nk/1J905u3EnKNBvCR6k/ukz51CCK3AScv60qazmh0X2omMmZGLRYGVBjaHI6si1YQBK VUQfLSZXq0wr0J2vgQZzlelhA5p8DH2WQpGrCT5TqlNJuj0rsY5ZNP0OE4RjwPJZ51Ib uuB3dT4G7NTTtGEU2UY7ZoxlHFdq57sVDFnJ6bgKQPwrdgqyd+PSzTju40UnVnea5lLX aPfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Vnv6075e5xDpDmjVmdi7yoSCEZdGGyfQtI+r26s3BY0=; b=up0HYhhGuGzHmGUgzjr1TwuzU9lGXVK9jW/afIng+dMGVJqsFKBg3FUHGk6ta4KxzL dZqBCUxqn4T/V3qqAbe1c3kcFT2sJHe+1COwtZyDLMraA+T/SW2Z657i4lSc51D8eHme 3lIZpfxF7eklvnT8hO2r5MkEn5lcYJtClt/W+AL1THj82YcnhdyFEYUfDad9E7zluhEw P856KVcjqE1y/ZJsOJc7I47K9zE2hbmVfStLtgAVrv3U22cmH9nuPuh6ZXGLSNVhuYE+ A+R8nMOk9hbHp/cjmMR0J5+R4QD8m7DcDgitjIk2slF9OzzWfxOH5BJM32yB0DPX4Vum YtWA== X-Gm-Message-State: AOAM530dfrSZjkhY6XLuKgBfFWAcveHIiDPKBPOIwUjBErHHb4nPpm/S lNwn7VSQAAoBhEn2YoFum5CkVQ== X-Google-Smtp-Source: ABdhPJyTYPgvYnhqECa/3pKjPwUP5/+kEmpd9Rxi8q+BV0aFN3ZhNlHMttkuLtRDk2VCixzj2EEC1Q== X-Received: by 2002:a63:da49:: with SMTP id l9mr14246393pgj.277.1631604797007; Tue, 14 Sep 2021 00:33:17 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.244]) by smtp.gmail.com with ESMTPSA id s3sm9377839pfd.188.2021.09.14.00.33.10 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Sep 2021 00:33:16 -0700 (PDT) From: Muchun Song To: willy@infradead.org, akpm@linux-foundation.org, hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, shakeelb@google.com, guro@fb.com, shy828301@gmail.com, alexs@kernel.org, richard.weiyang@gmail.com, david@fromorbit.com, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, zhengqi.arch@bytedance.com, duanxiongchun@bytedance.com, fam.zheng@bytedance.com, smuchun@gmail.com, Muchun Song Subject: [PATCH v3 03/76] mm: memcontrol: remove the kmem states Date: Tue, 14 Sep 2021 15:28:25 +0800 Message-Id: <20210914072938.6440-4-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20210914072938.6440-1-songmuchun@bytedance.com> References: <20210914072938.6440-1-songmuchun@bytedance.com> MIME-Version: 1.0 X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: D2566D000099 X-Stat-Signature: dqcfcqa841trobawnrajt7cnafaa7xdd Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=MXKF76sa; spf=pass (imf15.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.215.181 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com X-HE-Tag: 1631604797-833472 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: Now the kmem states is only used to indicate whether the kmem is offline. Because css_alloc() could fail, then we didn't make the kmem offline. In this case, we need the kmem state to mark this so that memcg_free_kmem() can make the kmem offline. However, we can set ->kmemcg_id to -1 to indicate the kmem is offline. Actually, we can remove the kmem states to simplify the code. Signed-off-by: Muchun Song --- include/linux/memcontrol.h | 7 ------- mm/memcontrol.c | 9 +++------ 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index 3a0ce40090c6..7267cf9d1f3d 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h @@ -180,12 +180,6 @@ struct mem_cgroup_thresholds { struct mem_cgroup_threshold_ary *spare; }; -enum memcg_kmem_state { - KMEM_NONE, - KMEM_ALLOCATED, - KMEM_ONLINE, -}; - #if defined(CONFIG_SMP) struct memcg_padding { char x[0]; @@ -318,7 +312,6 @@ struct mem_cgroup { #ifdef CONFIG_MEMCG_KMEM int kmemcg_id; - enum memcg_kmem_state kmem_state; struct obj_cgroup __rcu *objcg; struct list_head objcg_list; /* list of inherited objcgs */ #endif diff --git a/mm/memcontrol.c b/mm/memcontrol.c index e0d7ceb0db26..6844d8b511d8 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -3611,7 +3611,6 @@ static int memcg_online_kmem(struct mem_cgroup *memcg) return 0; BUG_ON(memcg->kmemcg_id >= 0); - BUG_ON(memcg->kmem_state); memcg_id = memcg_alloc_cache_id(); if (memcg_id < 0) @@ -3628,7 +3627,6 @@ static int memcg_online_kmem(struct mem_cgroup *memcg) static_branch_enable(&memcg_kmem_enabled_key); memcg->kmemcg_id = memcg_id; - memcg->kmem_state = KMEM_ONLINE; return 0; } @@ -3638,11 +3636,9 @@ static void memcg_offline_kmem(struct mem_cgroup *memcg) struct mem_cgroup *parent; int kmemcg_id; - if (memcg->kmem_state != KMEM_ONLINE) + if (cgroup_memory_nokmem) return; - memcg->kmem_state = KMEM_ALLOCATED; - parent = parent_mem_cgroup(memcg); if (!parent) parent = root_mem_cgroup; @@ -3656,12 +3652,13 @@ static void memcg_offline_kmem(struct mem_cgroup *memcg) memcg_drain_all_list_lrus(kmemcg_id, parent); memcg_free_cache_id(kmemcg_id); + memcg->kmemcg_id = -1; } static void memcg_free_kmem(struct mem_cgroup *memcg) { /* css_alloc() failed, offlining didn't happen */ - if (unlikely(memcg->kmem_state == KMEM_ONLINE)) + if (unlikely(memcg->kmemcg_id != -1)) memcg_offline_kmem(memcg); } #else From patchwork Tue Sep 14 07:28:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12491857 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_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 0BE85C433EF for ; Tue, 14 Sep 2021 07:33:26 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id AD93361056 for ; Tue, 14 Sep 2021 07:33:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org AD93361056 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 48EB96B006C; Tue, 14 Sep 2021 03:33:25 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 43F3894000B; Tue, 14 Sep 2021 03:33:25 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2E0B094000A; Tue, 14 Sep 2021 03:33:25 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0223.hostedemail.com [216.40.44.223]) by kanga.kvack.org (Postfix) with ESMTP id 206486B006C for ; Tue, 14 Sep 2021 03:33:25 -0400 (EDT) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id C8B5B18043651 for ; Tue, 14 Sep 2021 07:33:24 +0000 (UTC) X-FDA: 78585363528.07.B1A951D Received: from mail-pj1-f50.google.com (mail-pj1-f50.google.com [209.85.216.50]) by imf11.hostedemail.com (Postfix) with ESMTP id 80C53F0000B4 for ; Tue, 14 Sep 2021 07:33:24 +0000 (UTC) Received: by mail-pj1-f50.google.com with SMTP id k23-20020a17090a591700b001976d2db364so2057941pji.2 for ; Tue, 14 Sep 2021 00:33:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=i9dWAQT9MnFNTmopLa7uI8hnCzKur7mFh/tgOEsG0ak=; b=tvtI2oh7KRqjHCGIC33vHZ0eTeCepMMOZzXUpOe8B0d52bMkBme0jt/iAIH+WSxPrU bmQxXDU5jsRQtJpLnGyCh7yW3S9qM2hCZqV3O4vqTbI16BR8EagQaj5prtkzuF1OLCgQ rSpGZHDgWCEWqYpkz+G07cHTCU35NTg5bhnq73sgywUxy1uC+y4xFqljbevKplx0vCIF 8ewaaJ6a04UMwXac4zqf+HlKhbM7u5HD+IrzirICPUWi3cVzIFEd1tQcvxmSw3M9EAPW qB4HE29noctkhSzKmIGAKTzrJn/qPJIViF3DVha1y4XA0qZ5Cx2vgipV5a+eR5V6n/N8 WzvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=i9dWAQT9MnFNTmopLa7uI8hnCzKur7mFh/tgOEsG0ak=; b=3SiAIlpwtLews6PAWDJwl0N5Y28SBPAMb7Y0Blj+LKHfzp6OIDjnuQbfFWaO1SQ7cw mSw0SFIJpkg2dKXfx8+P8q3kK+NPfdLXYMpucyzjWB5/Ngq08kJfifwOGe5UHALreoZ+ BFZxp/YQy3wFLvW+gJXtCegJP++4YRCOC0cihbC53TNR+IUPaPuAKZ8f/2WDax7nsKau nfLO2ZF2NSj5vb5J39S5pZh6zracaT09XoZ7mxXR0r944MZ9ydsItQWctm9GlN1w9Xir ky94IG0rLudpNwlEPvnSsV87RBtGlC0XUJN11tR77f1BYL7nBqpHF1kSCuXVCgZ9CebR 6/pw== X-Gm-Message-State: AOAM531TMCsjSvzHfJY5lfI2SQ8p61dO1EhezUFREEV8u5+828X+WTpN OaFvD1qZ4MhG44rQiyYa/h3lnw== X-Google-Smtp-Source: ABdhPJw9AsHD8axsXPLJrDHn4xQlPyJpmiPLXcwCJC6VSXKd8nsAkTIpKAaLCtfS9+xfnNlqvB4zfg== X-Received: by 2002:a17:90b:2243:: with SMTP id hk3mr507259pjb.203.1631604803701; Tue, 14 Sep 2021 00:33:23 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.244]) by smtp.gmail.com with ESMTPSA id s3sm9377839pfd.188.2021.09.14.00.33.17 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Sep 2021 00:33:23 -0700 (PDT) From: Muchun Song To: willy@infradead.org, akpm@linux-foundation.org, hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, shakeelb@google.com, guro@fb.com, shy828301@gmail.com, alexs@kernel.org, richard.weiyang@gmail.com, david@fromorbit.com, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, zhengqi.arch@bytedance.com, duanxiongchun@bytedance.com, fam.zheng@bytedance.com, smuchun@gmail.com, Muchun Song Subject: [PATCH v3 04/76] mm: memcontrol: move memcg_online_kmem() to mem_cgroup_css_online() Date: Tue, 14 Sep 2021 15:28:26 +0800 Message-Id: <20210914072938.6440-5-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20210914072938.6440-1-songmuchun@bytedance.com> References: <20210914072938.6440-1-songmuchun@bytedance.com> MIME-Version: 1.0 Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=tvtI2oh7; spf=pass (imf11.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.216.50 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com X-Stat-Signature: c5fcgx7zew6f3dh3a84iwfm4z4teqdn6 X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 80C53F0000B4 X-HE-Tag: 1631604804-803184 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: It will simplify code if moving work of making kmem online to the place where making memcg online. It is unnecessary to set ->kmemcg_id when the kmem is offline, memcg_free_kmem() can go away as well. Signed-off-by: Muchun Song --- mm/memcontrol.c | 42 +++++++++++++++--------------------------- 1 file changed, 15 insertions(+), 27 deletions(-) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 6844d8b511d8..a85b52968666 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -3610,7 +3610,8 @@ static int memcg_online_kmem(struct mem_cgroup *memcg) if (cgroup_memory_nokmem) return 0; - BUG_ON(memcg->kmemcg_id >= 0); + if (unlikely(mem_cgroup_is_root(memcg))) + return 0; memcg_id = memcg_alloc_cache_id(); if (memcg_id < 0) @@ -3639,6 +3640,9 @@ static void memcg_offline_kmem(struct mem_cgroup *memcg) if (cgroup_memory_nokmem) return; + if (unlikely(mem_cgroup_is_root(memcg))) + return; + parent = parent_mem_cgroup(memcg); if (!parent) parent = root_mem_cgroup; @@ -3646,20 +3650,11 @@ static void memcg_offline_kmem(struct mem_cgroup *memcg) memcg_reparent_objcgs(memcg, parent); kmemcg_id = memcg->kmemcg_id; - BUG_ON(kmemcg_id < 0); /* memcg_reparent_objcgs() must be called before this. */ memcg_drain_all_list_lrus(kmemcg_id, parent); memcg_free_cache_id(kmemcg_id); - memcg->kmemcg_id = -1; -} - -static void memcg_free_kmem(struct mem_cgroup *memcg) -{ - /* css_alloc() failed, offlining didn't happen */ - if (unlikely(memcg->kmemcg_id != -1)) - memcg_offline_kmem(memcg); } #else static int memcg_online_kmem(struct mem_cgroup *memcg) @@ -3669,9 +3664,6 @@ static int memcg_online_kmem(struct mem_cgroup *memcg) static void memcg_offline_kmem(struct mem_cgroup *memcg) { } -static void memcg_free_kmem(struct mem_cgroup *memcg) -{ -} #endif /* CONFIG_MEMCG_KMEM */ static int memcg_update_kmem_max(struct mem_cgroup *memcg, @@ -5183,7 +5175,6 @@ mem_cgroup_css_alloc(struct cgroup_subsys_state *parent_css) { struct mem_cgroup *parent = mem_cgroup_from_css(parent_css); struct mem_cgroup *memcg, *old_memcg; - long error = -ENOMEM; old_memcg = set_active_memcg(parent); memcg = mem_cgroup_alloc(); @@ -5213,33 +5204,26 @@ mem_cgroup_css_alloc(struct cgroup_subsys_state *parent_css) } /* The following stuff does not apply to the root */ - error = memcg_online_kmem(memcg); - if (error) - goto fail; - if (cgroup_subsys_on_dfl(memory_cgrp_subsys) && !cgroup_memory_nosocket) static_branch_inc(&memcg_sockets_enabled_key); return &memcg->css; -fail: - mem_cgroup_id_remove(memcg); - mem_cgroup_free(memcg); - return ERR_PTR(error); } static int mem_cgroup_css_online(struct cgroup_subsys_state *css) { struct mem_cgroup *memcg = mem_cgroup_from_css(css); + if (memcg_online_kmem(memcg)) + goto remove_id; + /* * A memcg must be visible for expand_shrinker_info() * by the time the maps are allocated. So, we allocate maps * here, when for_each_mem_cgroup() can't skip it. */ - if (alloc_shrinker_info(memcg)) { - mem_cgroup_id_remove(memcg); - return -ENOMEM; - } + if (alloc_shrinker_info(memcg)) + goto offline_kmem; /* Online state pins memcg ID, memcg ID pins CSS */ refcount_set(&memcg->id.ref, 1); @@ -5249,6 +5233,11 @@ static int mem_cgroup_css_online(struct cgroup_subsys_state *css) queue_delayed_work(system_unbound_wq, &stats_flush_dwork, 2UL*HZ); return 0; +offline_kmem: + memcg_offline_kmem(memcg); +remove_id: + mem_cgroup_id_remove(memcg); + return -ENOMEM; } static void mem_cgroup_css_offline(struct cgroup_subsys_state *css) @@ -5306,7 +5295,6 @@ static void mem_cgroup_css_free(struct cgroup_subsys_state *css) cancel_work_sync(&memcg->high_work); mem_cgroup_remove_from_trees(memcg); free_shrinker_info(memcg); - memcg_free_kmem(memcg); mem_cgroup_free(memcg); } From patchwork Tue Sep 14 07:28:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12491859 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_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 10A27C433EF for ; Tue, 14 Sep 2021 07:33:33 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7976261056 for ; Tue, 14 Sep 2021 07:33:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 7976261056 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 21E336B0071; Tue, 14 Sep 2021 03:33:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1CDBB94000B; Tue, 14 Sep 2021 03:33:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 095BA94000A; Tue, 14 Sep 2021 03:33:32 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0003.hostedemail.com [216.40.44.3]) by kanga.kvack.org (Postfix) with ESMTP id F11166B0071 for ; Tue, 14 Sep 2021 03:33:31 -0400 (EDT) Received: from smtpin03.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id A68E21803EF00 for ; Tue, 14 Sep 2021 07:33:31 +0000 (UTC) X-FDA: 78585363822.03.3E1EE3C Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) by imf16.hostedemail.com (Postfix) with ESMTP id 63D4CF000092 for ; Tue, 14 Sep 2021 07:33:31 +0000 (UTC) Received: by mail-pl1-f178.google.com with SMTP id c4so6044482pls.6 for ; Tue, 14 Sep 2021 00:33:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=pdSMr5/T83fWycgKHeCNyglH8dIFjVjgVfZi+3aGb/o=; b=lcF2FdRL9SmDj6sPoOKJRFfCDRkvqUq7bcdi+w6EjU85E25KLBbP9RZIf1g1RF1VGF dYD9vWNLARJj2aso1D0zfM0tnh4+8LLXP8x/ks1iAmoSo5bmlyG8s7Z4L6t/Hzh3kAb5 aiqgfjgCJg0JeYJHrRHvuB3Z0Z7gozQJUUV59v99TdjJn4MNtsOzrrf2X0U15bNWONQM 5+CLF53XPlAE3WN/08ilsg/S9SSdjV5YOvnjHcNrUELXww7m4qHx+z7E74VGqXqULLTE 484Bt5XKw+KSNOZ871DW0obWlvMU3XQsR/zX7L4m/X/CtmizI8nwl5rOukLwJO8Bpky4 qO2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=pdSMr5/T83fWycgKHeCNyglH8dIFjVjgVfZi+3aGb/o=; b=EYnwmToTAGaOLnzLY9GYgSfTCzaRdQTsu6ZkQ8t3YkyzaHduNFhSFm3BH6sEiilZVd VtpmLxvB/T5xIGmYJP6UCILcKErqje4413Khp2JcMneh5v5O23ZilW9Ktpfc7josbAMj xcRaZuuf2Q4NLjslISOtJFgsFYm7kfvT6YoiAytV8nvZtnGquJBL6sYmBy7Fpc8/3RSi OfGS07vdJE88mziz4gEhU1xN/sduZszXXvAydliItVvZ4o93hthbQgiU2ADRcS/mEgr5 6F4OAt8L3b1fzF2EEZpN1XmMgldIStiuqEkoK0AUnVJx9FUb59oGxmASq/JabbZ980hE nlSg== X-Gm-Message-State: AOAM531jnMDFIHjkDFDUB3d7WbtHA0jmT1L5mZc4+ou1y0Vpwvtk7sap Rm3CVWVYPF+Ix3JeS3LtIwlw0A== X-Google-Smtp-Source: ABdhPJyd7C7ap9YT7ZyYr6oDPQ1gvF/rR4tIJydHVVLbWcwDTcRs26m4qzANk3uL3N76KhhkCvYSxA== X-Received: by 2002:a17:90a:1c81:: with SMTP id t1mr544287pjt.170.1631604810566; Tue, 14 Sep 2021 00:33:30 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.244]) by smtp.gmail.com with ESMTPSA id s3sm9377839pfd.188.2021.09.14.00.33.24 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Sep 2021 00:33:30 -0700 (PDT) From: Muchun Song To: willy@infradead.org, akpm@linux-foundation.org, hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, shakeelb@google.com, guro@fb.com, shy828301@gmail.com, alexs@kernel.org, richard.weiyang@gmail.com, david@fromorbit.com, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, zhengqi.arch@bytedance.com, duanxiongchun@bytedance.com, fam.zheng@bytedance.com, smuchun@gmail.com, Muchun Song Subject: [PATCH v3 05/76] mm: list_lru: remove holding lru lock Date: Tue, 14 Sep 2021 15:28:27 +0800 Message-Id: <20210914072938.6440-6-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20210914072938.6440-1-songmuchun@bytedance.com> References: <20210914072938.6440-1-songmuchun@bytedance.com> MIME-Version: 1.0 X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 63D4CF000092 X-Stat-Signature: dt48xo5mnd93cxmrnw1kmsdcx1zek5qt Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=lcF2FdRL; spf=pass (imf16.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.214.178 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com X-HE-Tag: 1631604811-774062 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: Since commit e5bc3af7734f ("rcu: Consolidate PREEMPT and !PREEMPT synchronize_rcu()"), the critical section of spin lock can serve as an RCU read-side critical section which already allows readers that hold nlru->lock avoid taking rcu lock. So just to remove holding lock. Signed-off-by: Muchun Song --- mm/list_lru.c | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/mm/list_lru.c b/mm/list_lru.c index 4962d48d4410..6b2f3cbe5f67 100644 --- a/mm/list_lru.c +++ b/mm/list_lru.c @@ -402,18 +402,7 @@ static int memcg_update_list_lru_node(struct list_lru_node *nlru, } memcpy(&new->lru, &old->lru, old_size * sizeof(void *)); - - /* - * The locking below allows readers that hold nlru->lock avoid taking - * rcu_read_lock (see list_lru_from_memcg_idx). - * - * Since list_lru_{add,del} may be called under an IRQ-safe lock, - * we have to use IRQ-safe primitives here to avoid deadlock. - */ - spin_lock_irq(&nlru->lock); rcu_assign_pointer(nlru->memcg_lrus, new); - spin_unlock_irq(&nlru->lock); - kvfree_rcu(old, rcu); return 0; } From patchwork Tue Sep 14 07:28:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12491861 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_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 975ADC433F5 for ; Tue, 14 Sep 2021 07:33:39 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 4A1A861056 for ; Tue, 14 Sep 2021 07:33:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 4A1A861056 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id DDD3A94000A; Tue, 14 Sep 2021 03:33:38 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D8DF16B0073; Tue, 14 Sep 2021 03:33:38 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C2E9994000A; Tue, 14 Sep 2021 03:33:38 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0099.hostedemail.com [216.40.44.99]) by kanga.kvack.org (Postfix) with ESMTP id B6A276B0072 for ; Tue, 14 Sep 2021 03:33:38 -0400 (EDT) Received: from smtpin05.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 713DC18017BD4 for ; Tue, 14 Sep 2021 07:33:38 +0000 (UTC) X-FDA: 78585364116.05.BEDE0E2 Received: from mail-pj1-f53.google.com (mail-pj1-f53.google.com [209.85.216.53]) by imf21.hostedemail.com (Postfix) with ESMTP id 3909AD02DFB5 for ; Tue, 14 Sep 2021 07:33:38 +0000 (UTC) Received: by mail-pj1-f53.google.com with SMTP id k23so8261652pji.0 for ; Tue, 14 Sep 2021 00:33:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=rI7PKACqM/Kwcdk+6AVk4DQ16MheMLZPlQjMEC5n7yk=; b=EdRD6sHziaUM8ZWwxrmJqt7nsJvDxYQmRneqGGkNe4BMlgV93fTvY2OehhPz1IFX1k YZkwM/14bd/X2mxRpcHaMtYegAn4Xp3oZu5WoP1rYKkupk8RUyF4chweIn+rbkx6PI0T 2tzbfNdxm3YDWMnbwTb3lzapiSC+RYDp1PRGKF9ZVYYwMk+tIfuidHTsOb58Nbx8ATZP amG6TR448PN8cJaY2YytWw9yP5YHUl3aLII/2hVQ0/UmP9eiyVwl+G4TVNV/cpizgA8N EEkC7jtYQmemaObOfbSkvNmmSWli8j1ASAjaJe4Ey7y3CNI7wdSRaBChZ8WUoNUxdEYF jG4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=rI7PKACqM/Kwcdk+6AVk4DQ16MheMLZPlQjMEC5n7yk=; b=4+tI2gJlG7+RwYHW0VYsU9s92Mz0HDj4EwjQq9Z05hUnNWqJV2X5St5gxY/5xYXHue 9ZrCgi4ubY42mRKI2goHr5io6lbB4FycRLVgP2JrdJ03StvbS/gWQ1wRRFEbxC3PdaPb zc7KpIpg56/bLAR9EZGVPI8tTFaVbtGjj0UP6WaOI5jiYP5l4H6zaNmrFQzhjtN+rb3q KNo6hhyLWoR47AyAOsZaCNhtaljGhxBMcYmCGAFaxf19LfjHIJqTOeafXzxx9pJOtpRj KUm8UXoaWJtCCj2TTC+Ls2PtZYdpQWpLZ8+FOYrJc2sL1pzR+poGzNm/cf/m+rN1fBLi Zj2A== X-Gm-Message-State: AOAM532z0PLhDvUIZPkxPld7PG/Dju0M/32Srzrsp8gmRYECzdF1+axL xhiHcHDZP9gNN2JzfKPwTufxpQ== X-Google-Smtp-Source: ABdhPJxU1w9S8RjHsj9t6dgNar9sO/uqvNbkUMk51yUE+y0Vgte07Q6BLLNmpDqU438/KSBl1gIduw== X-Received: by 2002:a17:90b:3890:: with SMTP id mu16mr575506pjb.78.1631604817392; Tue, 14 Sep 2021 00:33:37 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.244]) by smtp.gmail.com with ESMTPSA id s3sm9377839pfd.188.2021.09.14.00.33.30 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Sep 2021 00:33:36 -0700 (PDT) From: Muchun Song To: willy@infradead.org, akpm@linux-foundation.org, hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, shakeelb@google.com, guro@fb.com, shy828301@gmail.com, alexs@kernel.org, richard.weiyang@gmail.com, david@fromorbit.com, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, zhengqi.arch@bytedance.com, duanxiongchun@bytedance.com, fam.zheng@bytedance.com, smuchun@gmail.com, Muchun Song Subject: [PATCH v3 06/76] mm: list_lru: only add memcg-aware lrus to the global lru list Date: Tue, 14 Sep 2021 15:28:28 +0800 Message-Id: <20210914072938.6440-7-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20210914072938.6440-1-songmuchun@bytedance.com> References: <20210914072938.6440-1-songmuchun@bytedance.com> MIME-Version: 1.0 X-Stat-Signature: eypjrgp565nzbj8poteff1nx9y8x5hhn Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=EdRD6sHz; dmarc=pass (policy=none) header.from=bytedance.com; spf=pass (imf21.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.216.53 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 3909AD02DFB5 X-HE-Tag: 1631604818-503762 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 non-memcg-aware lru is always skiped when traversing the global lru list, which is not efficient. We can only add the memcg-aware lru to the global lru list instead to make traversing more efficient. Signed-off-by: Muchun Song --- mm/list_lru.c | 35 ++++++++++++++++------------------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/mm/list_lru.c b/mm/list_lru.c index 6b2f3cbe5f67..39828632631c 100644 --- a/mm/list_lru.c +++ b/mm/list_lru.c @@ -15,18 +15,29 @@ #include "slab.h" #ifdef CONFIG_MEMCG_KMEM -static LIST_HEAD(list_lrus); +static LIST_HEAD(memcg_list_lrus); static DEFINE_MUTEX(list_lrus_mutex); +static inline bool list_lru_memcg_aware(struct list_lru *lru) +{ + return lru->memcg_aware; +} + static void list_lru_register(struct list_lru *lru) { + if (!list_lru_memcg_aware(lru)) + return; + mutex_lock(&list_lrus_mutex); - list_add(&lru->list, &list_lrus); + list_add(&lru->list, &memcg_list_lrus); mutex_unlock(&list_lrus_mutex); } static void list_lru_unregister(struct list_lru *lru) { + if (!list_lru_memcg_aware(lru)) + return; + mutex_lock(&list_lrus_mutex); list_del(&lru->list); mutex_unlock(&list_lrus_mutex); @@ -37,11 +48,6 @@ static int lru_shrinker_id(struct list_lru *lru) return lru->shrinker_id; } -static inline bool list_lru_memcg_aware(struct list_lru *lru) -{ - return lru->memcg_aware; -} - static inline struct list_lru_one * list_lru_from_memcg_idx(struct list_lru_node *nlru, int idx) { @@ -458,9 +464,6 @@ static int memcg_update_list_lru(struct list_lru *lru, { int i; - if (!list_lru_memcg_aware(lru)) - return 0; - for_each_node(i) { if (memcg_update_list_lru_node(&lru->node[i], old_size, new_size)) @@ -483,9 +486,6 @@ static void memcg_cancel_update_list_lru(struct list_lru *lru, { int i; - if (!list_lru_memcg_aware(lru)) - return; - for_each_node(i) memcg_cancel_update_list_lru_node(&lru->node[i], old_size, new_size); @@ -498,7 +498,7 @@ int memcg_update_all_list_lrus(int new_size) int old_size = memcg_nr_cache_ids; mutex_lock(&list_lrus_mutex); - list_for_each_entry(lru, &list_lrus, list) { + list_for_each_entry(lru, &memcg_list_lrus, list) { ret = memcg_update_list_lru(lru, old_size, new_size); if (ret) goto fail; @@ -507,7 +507,7 @@ int memcg_update_all_list_lrus(int new_size) mutex_unlock(&list_lrus_mutex); return ret; fail: - list_for_each_entry_continue_reverse(lru, &list_lrus, list) + list_for_each_entry_continue_reverse(lru, &memcg_list_lrus, list) memcg_cancel_update_list_lru(lru, old_size, new_size); goto out; } @@ -544,9 +544,6 @@ static void memcg_drain_list_lru(struct list_lru *lru, { int i; - if (!list_lru_memcg_aware(lru)) - return; - for_each_node(i) memcg_drain_list_lru_node(lru, i, src_idx, dst_memcg); } @@ -556,7 +553,7 @@ void memcg_drain_all_list_lrus(int src_idx, struct mem_cgroup *dst_memcg) struct list_lru *lru; mutex_lock(&list_lrus_mutex); - list_for_each_entry(lru, &list_lrus, list) + list_for_each_entry(lru, &memcg_list_lrus, list) memcg_drain_list_lru(lru, src_idx, dst_memcg); mutex_unlock(&list_lrus_mutex); } From patchwork Tue Sep 14 07:28:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12491863 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_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 6CFCDC433FE for ; Tue, 14 Sep 2021 07:33:46 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 0E7ED60F4A for ; Tue, 14 Sep 2021 07:33:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 0E7ED60F4A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 9E67A94000B; Tue, 14 Sep 2021 03:33:45 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9959F6B0073; Tue, 14 Sep 2021 03:33:45 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 836F794000B; Tue, 14 Sep 2021 03:33:45 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0166.hostedemail.com [216.40.44.166]) by kanga.kvack.org (Postfix) with ESMTP id 76BD96B0072 for ; Tue, 14 Sep 2021 03:33:45 -0400 (EDT) Received: from smtpin04.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 310E68249980 for ; Tue, 14 Sep 2021 07:33:45 +0000 (UTC) X-FDA: 78585364410.04.843915A Received: from mail-pj1-f49.google.com (mail-pj1-f49.google.com [209.85.216.49]) by imf16.hostedemail.com (Postfix) with ESMTP id E8D68F00008C for ; Tue, 14 Sep 2021 07:33:44 +0000 (UTC) Received: by mail-pj1-f49.google.com with SMTP id f3-20020a17090a638300b00199097ddf1aso1488264pjj.0 for ; Tue, 14 Sep 2021 00:33:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=p4eA/7pZeF11MuhEViUBrUNzV90AiYNMF/W1dHt1+uU=; b=bSNrZ0svyMOna0RD7tyLsuQvex+ddngfnkbFuBaT1VcoOBRoFI0bNfCA/OS4gJ33fk 5vrRGPm6R8OnDxX16TIh0S32uz78FhGahUS/2Osvq3mPyhREVjOk+jpRAFs9Qz4W25sD xCcRrjbiOVtZhbzfamQ/Wgj8WPgsAIiTiMIWB03gJWFFu1BWBRtpkLqUZwPPZ/5DZJ9q RMvNgE4ccqMz0whoDNmHMJBjW+rhmfWa+MAXaLXyxFQwx3OqhZ6gbKtmcSSgEof4N9je +YCo/kiSQ9WR+9f2EEODkkIgU72Buqt5xj2kSpGmIVbGXiO6/keQvuOwswbYvrD+kJ5H VsuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=p4eA/7pZeF11MuhEViUBrUNzV90AiYNMF/W1dHt1+uU=; b=iIugRLR5hxOQKt8qmIPaNlxB2qHS5Eb02V4LwYPCHoWssO6uNOB5R1sNIPE4Brr7bH hzgQLEC+VrFCgiJRQCdvIrYJban7bd0O9dXsMIyX+CyFh1rj8D0pNMm3yWOPH9jE74u1 EnlY52grY0Ldt575bvN2ipf+kgh3JNLqTEFmHXLlgurNHMLNU7tRdPSlfR/kvR3lF5i1 djzE+AHDVWuuhEM3K3CgCiztzmJ2W/rpg99iQ+NlKBjxii+XryOBOlm3SLBvj/NR7a8Y bZWAEVLtw5ItQeWqchIeqq1cVQ11uIoT8nDZ8OCfZij3dB9mHvSmajSXmdPMlayDP2LH 5suA== X-Gm-Message-State: AOAM530h+QrA0eJ86W78fZtMr/cJ2cUFs5m7rxE8UV01u0rNDMhZB9VT i+LqurLM2nh2HkgDE40yNtVyEw== X-Google-Smtp-Source: ABdhPJw79DxS+5yExqu/VhV0+u0vXHspIJKvbDcUZqdeHgYFS+Xe/4owFBdXloQmaQZSPCf+apxgpw== X-Received: by 2002:a17:90a:8817:: with SMTP id s23mr513268pjn.181.1631604824029; Tue, 14 Sep 2021 00:33:44 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.244]) by smtp.gmail.com with ESMTPSA id s3sm9377839pfd.188.2021.09.14.00.33.37 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Sep 2021 00:33:43 -0700 (PDT) From: Muchun Song To: willy@infradead.org, akpm@linux-foundation.org, hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, shakeelb@google.com, guro@fb.com, shy828301@gmail.com, alexs@kernel.org, richard.weiyang@gmail.com, david@fromorbit.com, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, zhengqi.arch@bytedance.com, duanxiongchun@bytedance.com, fam.zheng@bytedance.com, smuchun@gmail.com, Muchun Song Subject: [PATCH v3 07/76] mm: list_lru: optimize memory consumption of arrays Date: Tue, 14 Sep 2021 15:28:29 +0800 Message-Id: <20210914072938.6440-8-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20210914072938.6440-1-songmuchun@bytedance.com> References: <20210914072938.6440-1-songmuchun@bytedance.com> MIME-Version: 1.0 Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=bSNrZ0sv; spf=pass (imf16.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.216.49 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: E8D68F00008C X-Stat-Signature: z5bszm5bq9gjezzjh9yqzu5yx841fqg9 X-HE-Tag: 1631604824-838733 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 use an array to store the list_lru_one pointers, which is per-memcg per-node. What if we run 10k containers in the system? The size of the array of every list_lru can be 10k * number_of_node * sizeof(void *). The array size becomes very big, the more numa node in the system, the more memory it consumes. We can convert the array to per-memcg instead of per-memcg per-node. It can save memory especially when there are many numa nodes in the system. And also simplify the code. In my test case (10k memory cgroup and 2 NUMA nodes), it can save 2.5GB memory. Signed-off-by: Muchun Song --- include/linux/list_lru.h | 17 +++-- mm/list_lru.c | 191 +++++++++++++++++------------------------------ 2 files changed, 79 insertions(+), 129 deletions(-) diff --git a/include/linux/list_lru.h b/include/linux/list_lru.h index 1b5fceb565df..2b32dbd89214 100644 --- a/include/linux/list_lru.h +++ b/include/linux/list_lru.h @@ -31,10 +31,15 @@ struct list_lru_one { long nr_items; }; +struct list_lru_per_memcg { + /* array of per cgroup per node lists, indexed by node id */ + struct list_lru_one nodes[0]; +}; + struct list_lru_memcg { - struct rcu_head rcu; + struct rcu_head rcu; /* array of per cgroup lists, indexed by memcg_cache_id */ - struct list_lru_one *lru[]; + struct list_lru_per_memcg *lrus[]; }; struct list_lru_node { @@ -42,11 +47,7 @@ struct list_lru_node { spinlock_t lock; /* global list, used for the root cgroup in cgroup aware lrus */ struct list_lru_one lru; -#ifdef CONFIG_MEMCG_KMEM - /* for cgroup aware lrus points to per cgroup lists, otherwise NULL */ - struct list_lru_memcg __rcu *memcg_lrus; -#endif - long nr_items; + long nr_items; } ____cacheline_aligned_in_smp; struct list_lru { @@ -55,6 +56,8 @@ struct list_lru { struct list_head list; int shrinker_id; bool memcg_aware; + /* for cgroup aware lrus points to per cgroup lists, otherwise NULL */ + struct list_lru_memcg __rcu *memcg_lrus; #endif }; diff --git a/mm/list_lru.c b/mm/list_lru.c index 39828632631c..f1c73b53af9a 100644 --- a/mm/list_lru.c +++ b/mm/list_lru.c @@ -49,35 +49,38 @@ static int lru_shrinker_id(struct list_lru *lru) } static inline struct list_lru_one * -list_lru_from_memcg_idx(struct list_lru_node *nlru, int idx) +list_lru_from_memcg_idx(struct list_lru *lru, int nid, int idx) { struct list_lru_memcg *memcg_lrus; + struct list_lru_node *nlru = &lru->node[nid]; + /* * Either lock or RCU protects the array of per cgroup lists - * from relocation (see memcg_update_list_lru_node). + * from relocation (see memcg_update_list_lru). */ - memcg_lrus = rcu_dereference_check(nlru->memcg_lrus, + memcg_lrus = rcu_dereference_check(lru->memcg_lrus, lockdep_is_held(&nlru->lock)); if (memcg_lrus && idx >= 0) - return memcg_lrus->lru[idx]; + return &memcg_lrus->lrus[idx]->nodes[nid]; return &nlru->lru; } static inline struct list_lru_one * -list_lru_from_kmem(struct list_lru_node *nlru, void *ptr, +list_lru_from_kmem(struct list_lru *lru, int nid, void *ptr, struct mem_cgroup **memcg_ptr) { + struct list_lru_node *nlru = &lru->node[nid]; struct list_lru_one *l = &nlru->lru; struct mem_cgroup *memcg = NULL; - if (!nlru->memcg_lrus) + if (!lru->memcg_lrus) goto out; memcg = mem_cgroup_from_obj(ptr); if (!memcg) goto out; - l = list_lru_from_memcg_idx(nlru, memcg_cache_id(memcg)); + l = list_lru_from_memcg_idx(lru, nid, memcg_cache_id(memcg)); out: if (memcg_ptr) *memcg_ptr = memcg; @@ -103,18 +106,18 @@ static inline bool list_lru_memcg_aware(struct list_lru *lru) } static inline struct list_lru_one * -list_lru_from_memcg_idx(struct list_lru_node *nlru, int idx) +list_lru_from_memcg_idx(struct list_lru *lru, int nid, int idx) { - return &nlru->lru; + return &lru->node[nid].lru; } static inline struct list_lru_one * -list_lru_from_kmem(struct list_lru_node *nlru, void *ptr, +list_lru_from_kmem(struct list_lru *lru, int nid, void *ptr, struct mem_cgroup **memcg_ptr) { if (memcg_ptr) *memcg_ptr = NULL; - return &nlru->lru; + return &lru->node[nid].lru; } #endif /* CONFIG_MEMCG_KMEM */ @@ -127,7 +130,7 @@ bool list_lru_add(struct list_lru *lru, struct list_head *item) spin_lock(&nlru->lock); if (list_empty(item)) { - l = list_lru_from_kmem(nlru, item, &memcg); + l = list_lru_from_kmem(lru, nid, item, &memcg); list_add_tail(item, &l->list); /* Set shrinker bit if the first element was added */ if (!l->nr_items++) @@ -150,7 +153,7 @@ bool list_lru_del(struct list_lru *lru, struct list_head *item) spin_lock(&nlru->lock); if (!list_empty(item)) { - l = list_lru_from_kmem(nlru, item, NULL); + l = list_lru_from_kmem(lru, nid, item, NULL); list_del_init(item); l->nr_items--; nlru->nr_items--; @@ -180,12 +183,11 @@ EXPORT_SYMBOL_GPL(list_lru_isolate_move); unsigned long list_lru_count_one(struct list_lru *lru, int nid, struct mem_cgroup *memcg) { - struct list_lru_node *nlru = &lru->node[nid]; struct list_lru_one *l; long count; rcu_read_lock(); - l = list_lru_from_memcg_idx(nlru, memcg_cache_id(memcg)); + l = list_lru_from_memcg_idx(lru, nid, memcg_cache_id(memcg)); count = READ_ONCE(l->nr_items); rcu_read_unlock(); @@ -206,16 +208,16 @@ unsigned long list_lru_count_node(struct list_lru *lru, int nid) EXPORT_SYMBOL_GPL(list_lru_count_node); static unsigned long -__list_lru_walk_one(struct list_lru_node *nlru, int memcg_idx, +__list_lru_walk_one(struct list_lru *lru, int nid, int memcg_idx, list_lru_walk_cb isolate, void *cb_arg, unsigned long *nr_to_walk) { - + struct list_lru_node *nlru = &lru->node[nid]; struct list_lru_one *l; struct list_head *item, *n; unsigned long isolated = 0; - l = list_lru_from_memcg_idx(nlru, memcg_idx); + l = list_lru_from_memcg_idx(lru, nid, memcg_idx); restart: list_for_each_safe(item, n, &l->list) { enum lru_status ret; @@ -272,8 +274,8 @@ list_lru_walk_one(struct list_lru *lru, int nid, struct mem_cgroup *memcg, unsigned long ret; spin_lock(&nlru->lock); - ret = __list_lru_walk_one(nlru, memcg_cache_id(memcg), isolate, cb_arg, - nr_to_walk); + ret = __list_lru_walk_one(lru, nid, memcg_cache_id(memcg), isolate, + cb_arg, nr_to_walk); spin_unlock(&nlru->lock); return ret; } @@ -288,8 +290,8 @@ list_lru_walk_one_irq(struct list_lru *lru, int nid, struct mem_cgroup *memcg, unsigned long ret; spin_lock_irq(&nlru->lock); - ret = __list_lru_walk_one(nlru, memcg_cache_id(memcg), isolate, cb_arg, - nr_to_walk); + ret = __list_lru_walk_one(lru, nid, memcg_cache_id(memcg), isolate, + cb_arg, nr_to_walk); spin_unlock_irq(&nlru->lock); return ret; } @@ -308,7 +310,7 @@ unsigned long list_lru_walk_node(struct list_lru *lru, int nid, struct list_lru_node *nlru = &lru->node[nid]; spin_lock(&nlru->lock); - isolated += __list_lru_walk_one(nlru, memcg_idx, + isolated += __list_lru_walk_one(lru, nid, memcg_idx, isolate, cb_arg, nr_to_walk); spin_unlock(&nlru->lock); @@ -328,167 +330,112 @@ static void init_one_lru(struct list_lru_one *l) } #ifdef CONFIG_MEMCG_KMEM -static void __memcg_destroy_list_lru_node(struct list_lru_memcg *memcg_lrus, - int begin, int end) +static void memcg_destroy_list_lru_range(struct list_lru_memcg *memcg_lrus, + int begin, int end) { int i; for (i = begin; i < end; i++) - kfree(memcg_lrus->lru[i]); + kfree(memcg_lrus->lrus[i]); } -static int __memcg_init_list_lru_node(struct list_lru_memcg *memcg_lrus, - int begin, int end) +static int memcg_init_list_lru_range(struct list_lru_memcg *memcg_lrus, + int begin, int end) { int i; for (i = begin; i < end; i++) { - struct list_lru_one *l; + int nid; + struct list_lru_per_memcg *lru; - l = kmalloc(sizeof(struct list_lru_one), GFP_KERNEL); - if (!l) + lru = kmalloc(struct_size(lru, nodes, nr_node_ids), GFP_KERNEL); + if (!lru) goto fail; - init_one_lru(l); - memcg_lrus->lru[i] = l; + for_each_node(nid) + init_one_lru(&lru->nodes[nid]); + memcg_lrus->lrus[i] = lru; } return 0; fail: - __memcg_destroy_list_lru_node(memcg_lrus, begin, i); + memcg_destroy_list_lru_range(memcg_lrus, begin, i); return -ENOMEM; } -static int memcg_init_list_lru_node(struct list_lru_node *nlru) +static int memcg_init_list_lru(struct list_lru *lru, bool memcg_aware) { struct list_lru_memcg *memcg_lrus; int size = memcg_nr_cache_ids; + lru->memcg_aware = memcg_aware; + if (!memcg_aware) + return 0; + memcg_lrus = kvmalloc(sizeof(*memcg_lrus) + - size * sizeof(void *), GFP_KERNEL); + size * sizeof(memcg_lrus->lrus[0]), GFP_KERNEL); if (!memcg_lrus) return -ENOMEM; - if (__memcg_init_list_lru_node(memcg_lrus, 0, size)) { + if (memcg_init_list_lru_range(memcg_lrus, 0, size)) { kvfree(memcg_lrus); return -ENOMEM; } - RCU_INIT_POINTER(nlru->memcg_lrus, memcg_lrus); + RCU_INIT_POINTER(lru->memcg_lrus, memcg_lrus); return 0; } -static void memcg_destroy_list_lru_node(struct list_lru_node *nlru) +static void memcg_destroy_list_lru(struct list_lru *lru) { struct list_lru_memcg *memcg_lrus; + + if (!list_lru_memcg_aware(lru)) + return; + /* * This is called when shrinker has already been unregistered, * 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); + memcg_lrus = rcu_dereference_protected(lru->memcg_lrus, true); + memcg_destroy_list_lru_range(memcg_lrus, 0, memcg_nr_cache_ids); kvfree(memcg_lrus); } -static int memcg_update_list_lru_node(struct list_lru_node *nlru, - int old_size, int new_size) +static int memcg_update_list_lru(struct list_lru *lru, int old_size, int new_size) { struct list_lru_memcg *old, *new; BUG_ON(old_size > new_size); - old = rcu_dereference_protected(nlru->memcg_lrus, + old = rcu_dereference_protected(lru->memcg_lrus, lockdep_is_held(&list_lrus_mutex)); - new = kvmalloc(sizeof(*new) + new_size * sizeof(void *), GFP_KERNEL); + new = kvmalloc(sizeof(*new) + new_size * sizeof(new->lrus[0]), GFP_KERNEL); if (!new) return -ENOMEM; - if (__memcg_init_list_lru_node(new, old_size, new_size)) { + if (memcg_init_list_lru_range(new, old_size, new_size)) { kvfree(new); return -ENOMEM; } - memcpy(&new->lru, &old->lru, old_size * sizeof(void *)); - rcu_assign_pointer(nlru->memcg_lrus, new); + memcpy(&new->lrus, &old->lrus, old_size * sizeof(new->lrus[0])); + rcu_assign_pointer(lru->memcg_lrus, new); kvfree_rcu(old, rcu); return 0; } -static void memcg_cancel_update_list_lru_node(struct list_lru_node *nlru, - int old_size, int new_size) -{ - struct list_lru_memcg *memcg_lrus; - - memcg_lrus = rcu_dereference_protected(nlru->memcg_lrus, - lockdep_is_held(&list_lrus_mutex)); - /* do not bother shrinking the array back to the old size, because we - * cannot handle allocation failures here */ - __memcg_destroy_list_lru_node(memcg_lrus, old_size, new_size); -} - -static int memcg_init_list_lru(struct list_lru *lru, bool memcg_aware) -{ - int i; - - lru->memcg_aware = memcg_aware; - - if (!memcg_aware) - return 0; - - for_each_node(i) { - if (memcg_init_list_lru_node(&lru->node[i])) - goto fail; - } - return 0; -fail: - for (i = i - 1; i >= 0; i--) { - if (!lru->node[i].memcg_lrus) - continue; - memcg_destroy_list_lru_node(&lru->node[i]); - } - return -ENOMEM; -} - -static void memcg_destroy_list_lru(struct list_lru *lru) -{ - int i; - - if (!list_lru_memcg_aware(lru)) - return; - - for_each_node(i) - memcg_destroy_list_lru_node(&lru->node[i]); -} - -static int memcg_update_list_lru(struct list_lru *lru, - int old_size, int new_size) -{ - int i; - - for_each_node(i) { - if (memcg_update_list_lru_node(&lru->node[i], - old_size, new_size)) - goto fail; - } - return 0; -fail: - for (i = i - 1; i >= 0; i--) { - if (!lru->node[i].memcg_lrus) - continue; - - memcg_cancel_update_list_lru_node(&lru->node[i], - old_size, new_size); - } - return -ENOMEM; -} - static void memcg_cancel_update_list_lru(struct list_lru *lru, int old_size, int new_size) { - int i; + struct list_lru_memcg *memcg_lrus; - for_each_node(i) - memcg_cancel_update_list_lru_node(&lru->node[i], - old_size, new_size); + memcg_lrus = rcu_dereference_protected(lru->memcg_lrus, + lockdep_is_held(&list_lrus_mutex)); + /* + * Do not bother shrinking the array back to the old size, because we + * cannot handle allocation failures here. + */ + memcg_destroy_list_lru_range(memcg_lrus, old_size, new_size); } int memcg_update_all_list_lrus(int new_size) @@ -525,8 +472,8 @@ static void memcg_drain_list_lru_node(struct list_lru *lru, int nid, */ spin_lock_irq(&nlru->lock); - src = list_lru_from_memcg_idx(nlru, src_idx); - dst = list_lru_from_memcg_idx(nlru, dst_idx); + src = list_lru_from_memcg_idx(lru, nid, src_idx); + dst = list_lru_from_memcg_idx(lru, nid, dst_idx); list_splice_init(&src->list, &dst->list); From patchwork Tue Sep 14 07:28:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12491865 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_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 4AD5FC433F5 for ; Tue, 14 Sep 2021 07:33:53 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id DF04E61029 for ; Tue, 14 Sep 2021 07:33:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org DF04E61029 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 8D42994000C; Tue, 14 Sep 2021 03:33:52 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8AB506B0073; Tue, 14 Sep 2021 03:33:52 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 74BFD94000C; Tue, 14 Sep 2021 03:33:52 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0174.hostedemail.com [216.40.44.174]) by kanga.kvack.org (Postfix) with ESMTP id 64B6E6B0072 for ; Tue, 14 Sep 2021 03:33:52 -0400 (EDT) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 04BCE26DE9 for ; Tue, 14 Sep 2021 07:33:52 +0000 (UTC) X-FDA: 78585364704.01.BF461B0 Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) by imf09.hostedemail.com (Postfix) with ESMTP id B29803000105 for ; Tue, 14 Sep 2021 07:33:51 +0000 (UTC) Received: by mail-pl1-f175.google.com with SMTP id f21so5362533plb.4 for ; Tue, 14 Sep 2021 00:33:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=y1kAf0XYLhQyaq0Tfwg29KiVIv9l+PC00VybqIGq6HA=; b=BfCSpRlfLt480JnDBDwIZcbb16eriJDkUQJs9r2y8Ydzzg++/KQA9DBYR4pEWZOu/8 MTSRuzhQHDWC+emsX0t3C8Z5Jw2hSoB5iLcjEpBHHhLcajsrtJQksFMLTw0pNY2bC8AK L2z8QpO7P3Rjs9xeE30uvW1Z+YUhP9M65m6J/YVMeBb45MoT3qrF4ZNb3FZD4F0nZWuk REKsakZTZ58lbX483F2Oqt0Q4vLn6bAi++c5CbH6bbxWEuxGJbhXXb78b9yk9Swt5jkV Kr0aYN6ylfPtfYFB1W4OHRMKpg2Dh1cOPiO3cF/Nn5qEEugNDNFbmSlMCvPeL2ruyBzS Pbkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=y1kAf0XYLhQyaq0Tfwg29KiVIv9l+PC00VybqIGq6HA=; b=KUKRYbmbNWvWKM8of1cDxyhXUa74qucnm/I4ZOqOPApEMGdjRXhLD17NoogUpSCnk4 qzN48yCWlcMmANcjWMZXXJIv5EXrnQSFpvhS/5/2AuFyB5WrpRO8S1aR2zy6AliXBWb7 cS92DnC48m06rVkMYFi0lxUzwLhHlDV0nAunrLRgZtDk39NmZb5UY0F8v7TUG1Di0b74 UCMiydooTyQcCtlmcK+87ocBUcneIV2Okt7G2GjzJih/433hyr7MA0aH/VBK8MRy42Gb 8rRyOK9EVuWOCGEfijk4k25egnwxsRIaMAVDRnOvBkzunCVywAiISLm/6xx8wEgDO4G4 l9wg== X-Gm-Message-State: AOAM531N7BPhFNcGo6LEIExGcz60IdlyJW+F8LQUI6ecCMWkYyatc3W5 pYDJSpqA0OVZuo+ugIkf/jEQcQ== X-Google-Smtp-Source: ABdhPJwHvDvAJKRV7EYhcf5UWWuf/yjQ4SAMKBm3iQathHWPnBgxU68AQllTLW+xIZHjmMlY0QL1GA== X-Received: by 2002:a17:90a:1c81:: with SMTP id t1mr545581pjt.170.1631604830756; Tue, 14 Sep 2021 00:33:50 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.244]) by smtp.gmail.com with ESMTPSA id s3sm9377839pfd.188.2021.09.14.00.33.44 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Sep 2021 00:33:50 -0700 (PDT) From: Muchun Song To: willy@infradead.org, akpm@linux-foundation.org, hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, shakeelb@google.com, guro@fb.com, shy828301@gmail.com, alexs@kernel.org, richard.weiyang@gmail.com, david@fromorbit.com, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, zhengqi.arch@bytedance.com, duanxiongchun@bytedance.com, fam.zheng@bytedance.com, smuchun@gmail.com, Muchun Song Subject: [PATCH v3 08/76] mm: introduce kmem_cache_alloc_lru Date: Tue, 14 Sep 2021 15:28:30 +0800 Message-Id: <20210914072938.6440-9-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20210914072938.6440-1-songmuchun@bytedance.com> References: <20210914072938.6440-1-songmuchun@bytedance.com> MIME-Version: 1.0 Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=BfCSpRlf; spf=pass (imf09.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.214.175 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com X-Stat-Signature: 43upbrzqeinfbmh1r4tayry9dp4q16g9 X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: B29803000105 X-HE-Tag: 1631604831-495966 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: We currently allocate scope for every memcg to be able to tracked on every superblock instantiated in the system, regardless of whether that superblock is even accessible to that memcg. These huge memcg counts come from container hosts where memcgs are confined to just a small subset of the total number of superblocks that instantiated at any given point in time. For these systems with huge container counts, list_lru does not need the capability of tracking every memcg on every superblock. What it comes down to is that adding the memcg to the list_lru at the first insert. So introduce kmem_cache_alloc_lru to allocate objects and its list_lru. In the later patch, we will convert all inode and dentry allocation from kmem_cache_alloc to kmem_cache_alloc_lru. Signed-off-by: Muchun Song --- include/linux/list_lru.h | 3 ++ include/linux/memcontrol.h | 14 ++++++ include/linux/slab.h | 3 ++ mm/list_lru.c | 114 +++++++++++++++++++++++++++++++++++++++++---- mm/memcontrol.c | 14 ------ mm/slab.c | 39 +++++++++++----- mm/slab.h | 17 ++++++- mm/slob.c | 6 +++ mm/slub.c | 42 +++++++++++------ 9 files changed, 202 insertions(+), 50 deletions(-) diff --git a/include/linux/list_lru.h b/include/linux/list_lru.h index 2b32dbd89214..50a3144016b4 100644 --- a/include/linux/list_lru.h +++ b/include/linux/list_lru.h @@ -56,11 +56,14 @@ struct list_lru { struct list_head list; int shrinker_id; bool memcg_aware; + /* protects ->memcg_lrus->lrus[i] */ + spinlock_t lock; /* for cgroup aware lrus points to per cgroup lists, otherwise NULL */ struct list_lru_memcg __rcu *memcg_lrus; #endif }; +int list_lru_memcg_alloc(struct list_lru *lru, struct mem_cgroup *memcg, gfp_t gfp); void list_lru_destroy(struct list_lru *lru); int __list_lru_init(struct list_lru *lru, bool memcg_aware, struct lock_class_key *key, struct shrinker *shrinker); diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index 7267cf9d1f3d..06ee32822fd4 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h @@ -520,6 +520,20 @@ static inline struct mem_cgroup *page_memcg_check(struct page *page) return (struct mem_cgroup *)(memcg_data & ~MEMCG_DATA_FLAGS_MASK); } +static inline struct mem_cgroup *get_mem_cgroup_from_objcg(struct obj_cgroup *objcg) +{ + struct mem_cgroup *memcg; + + rcu_read_lock(); +retry: + memcg = obj_cgroup_memcg(objcg); + if (unlikely(!css_tryget(&memcg->css))) + goto retry; + rcu_read_unlock(); + + return memcg; +} + #ifdef CONFIG_MEMCG_KMEM /* * folio_memcg_kmem - Check if the folio has the memcg_kmem flag set. diff --git a/include/linux/slab.h b/include/linux/slab.h index 6ce826d8194d..441f4e87cb34 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h @@ -135,6 +135,7 @@ #include +struct list_lru; struct mem_cgroup; /* * struct kmem_cache related prototypes @@ -429,6 +430,8 @@ static __always_inline unsigned int __kmalloc_index(size_t size, __alloc_size(1) void *__kmalloc(size_t size, gfp_t flags) __assume_kmalloc_alignment __malloc; void *kmem_cache_alloc(struct kmem_cache *s, gfp_t flags) __assume_kmalloc_alignment __malloc; +void *kmem_cache_alloc_lru(struct kmem_cache *s, struct list_lru *lru, + gfp_t gfpflags) __assume_kmalloc_alignment __malloc; void kmem_cache_free(struct kmem_cache *s, void *objp); /* diff --git a/mm/list_lru.c b/mm/list_lru.c index f1c73b53af9a..eea29eb4cf48 100644 --- a/mm/list_lru.c +++ b/mm/list_lru.c @@ -339,22 +339,30 @@ static void memcg_destroy_list_lru_range(struct list_lru_memcg *memcg_lrus, kfree(memcg_lrus->lrus[i]); } +static struct list_lru_per_memcg *memcg_list_lru_alloc(gfp_t gfp) +{ + int nid; + struct list_lru_per_memcg *lru; + + lru = kmalloc(struct_size(lru, nodes, nr_node_ids), gfp); + if (!lru) + return NULL; + + for_each_node(nid) + init_one_lru(&lru->nodes[nid]); + + return lru; +} + static int memcg_init_list_lru_range(struct list_lru_memcg *memcg_lrus, int begin, int end) { int i; for (i = begin; i < end; i++) { - int nid; - struct list_lru_per_memcg *lru; - - lru = kmalloc(struct_size(lru, nodes, nr_node_ids), GFP_KERNEL); - if (!lru) + memcg_lrus->lrus[i] = memcg_list_lru_alloc(GFP_KERNEL); + if (!memcg_lrus->lrus[i]) goto fail; - - for_each_node(nid) - init_one_lru(&lru->nodes[nid]); - memcg_lrus->lrus[i] = lru; } return 0; fail: @@ -371,6 +379,8 @@ static int memcg_init_list_lru(struct list_lru *lru, bool memcg_aware) if (!memcg_aware) return 0; + spin_lock_init(&lru->lock); + memcg_lrus = kvmalloc(sizeof(*memcg_lrus) + size * sizeof(memcg_lrus->lrus[0]), GFP_KERNEL); if (!memcg_lrus) @@ -418,8 +428,11 @@ static int memcg_update_list_lru(struct list_lru *lru, int old_size, int new_siz return -ENOMEM; } + spin_lock_irq(&lru->lock); memcpy(&new->lrus, &old->lrus, old_size * sizeof(new->lrus[0])); rcu_assign_pointer(lru->memcg_lrus, new); + spin_unlock_irq(&lru->lock); + kvfree_rcu(old, rcu); return 0; } @@ -504,6 +517,89 @@ void memcg_drain_all_list_lrus(int src_idx, struct mem_cgroup *dst_memcg) memcg_drain_list_lru(lru, src_idx, dst_memcg); mutex_unlock(&list_lrus_mutex); } + +static bool memcg_list_lru_skip_alloc(struct list_lru *lru, + struct mem_cgroup *memcg) +{ + struct list_lru_memcg *memcg_lrus; + int idx = memcg_cache_id(memcg); + + if (unlikely(idx < 0)) + return true; + + rcu_read_lock(); + memcg_lrus = rcu_dereference(lru->memcg_lrus); + if (memcg_lrus->lrus[idx]) { + rcu_read_unlock(); + return true; + } + rcu_read_unlock(); + + return false; +} + +int list_lru_memcg_alloc(struct list_lru *lru, struct mem_cgroup *memcg, gfp_t gfp) +{ + unsigned long flags; + struct list_lru_memcg *memcg_lrus; + int i; + + struct list_lru_memcg { + struct list_lru_per_memcg *mlru; + struct mem_cgroup *memcg; + } *table; + + if (!list_lru_memcg_aware(lru)) + return 0; + + if (memcg_list_lru_skip_alloc(lru, memcg)) + return 0; + + /* + * The allocated list_lru_per_memcg array is not accounted directly. + * Moreover, it should not come from DMA buffer and is not readily + * reclaimable. So those GFP bits should be masked off. + */ + gfp &= ~(__GFP_DMA | __GFP_RECLAIMABLE | __GFP_ACCOUNT | __GFP_ZERO); + table = kmalloc_array(memcg->css.cgroup->level, sizeof(*table), gfp); + if (!table) + return -ENOMEM; + + /* + * Because the list_lru can be reparented to the parent cgroup's + * list_lru, we should make sure that this cgroup and all its + * ancestors have allocated list_lru_per_memcg. + */ + for (i = 0; memcg; memcg = parent_mem_cgroup(memcg), i++) { + if (memcg_list_lru_skip_alloc(lru, memcg)) + break; + + table[i].memcg = memcg; + table[i].mlru = memcg_list_lru_alloc(gfp); + if (!table[i].mlru) { + while (i--) + kfree(table[i].mlru); + kfree(table); + return -ENOMEM; + } + } + + spin_lock_irqsave(&lru->lock, flags); + memcg_lrus = rcu_dereference_protected(lru->memcg_lrus, true); + while (i--) { + int index = memcg_cache_id(table[i].memcg); + + if (memcg_lrus->lrus[index]) + kfree(table[i].mlru); + else + memcg_lrus->lrus[index] = table[i].mlru; + } + spin_unlock_irqrestore(&lru->lock, flags); + + kfree(table); + + return 0; +} #else static int memcg_init_list_lru(struct list_lru *lru, bool memcg_aware) { diff --git a/mm/memcontrol.c b/mm/memcontrol.c index a85b52968666..0e8c8d8465e5 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -2763,20 +2763,6 @@ static void commit_charge(struct folio *folio, struct mem_cgroup *memcg) folio->memcg_data = (unsigned long)memcg; } -static struct mem_cgroup *get_mem_cgroup_from_objcg(struct obj_cgroup *objcg) -{ - struct mem_cgroup *memcg; - - rcu_read_lock(); -retry: - memcg = obj_cgroup_memcg(objcg); - if (unlikely(!css_tryget(&memcg->css))) - goto retry; - rcu_read_unlock(); - - return memcg; -} - #ifdef CONFIG_MEMCG_KMEM /* * The allocated objcg pointers array is not accounted directly. diff --git a/mm/slab.c b/mm/slab.c index d0f725637663..9a001aabc77b 100644 --- a/mm/slab.c +++ b/mm/slab.c @@ -3219,7 +3219,7 @@ slab_alloc_node(struct kmem_cache *cachep, gfp_t flags, int nodeid, size_t orig_ bool init = false; flags &= gfp_allowed_mask; - cachep = slab_pre_alloc_hook(cachep, &objcg, 1, flags); + cachep = slab_pre_alloc_hook(cachep, NULL, &objcg, 1, flags); if (unlikely(!cachep)) return NULL; @@ -3295,7 +3295,8 @@ __do_cache_alloc(struct kmem_cache *cachep, gfp_t flags) #endif /* CONFIG_NUMA */ static __always_inline void * -slab_alloc(struct kmem_cache *cachep, gfp_t flags, size_t orig_size, unsigned long caller) +slab_alloc(struct kmem_cache *cachep, struct list_lru *lru, gfp_t flags, + size_t orig_size, unsigned long caller) { unsigned long save_flags; void *objp; @@ -3303,7 +3304,7 @@ slab_alloc(struct kmem_cache *cachep, gfp_t flags, size_t orig_size, unsigned lo bool init = false; flags &= gfp_allowed_mask; - cachep = slab_pre_alloc_hook(cachep, &objcg, 1, flags); + cachep = slab_pre_alloc_hook(cachep, lru, &objcg, 1, flags); if (unlikely(!cachep)) return NULL; @@ -3492,6 +3493,18 @@ void ___cache_free(struct kmem_cache *cachep, void *objp, __free_one(ac, objp); } +static __always_inline +void *__kmem_cache_alloc_lru(struct kmem_cache *cachep, struct list_lru *lru, + gfp_t flags) +{ + void *ret = slab_alloc(cachep, lru, flags, cachep->object_size, _RET_IP_); + + trace_kmem_cache_alloc(_RET_IP_, ret, + cachep->object_size, cachep->size, flags); + + return ret; +} + /** * kmem_cache_alloc - Allocate an object * @cachep: The cache to allocate from. @@ -3504,15 +3517,17 @@ void ___cache_free(struct kmem_cache *cachep, void *objp, */ void *kmem_cache_alloc(struct kmem_cache *cachep, gfp_t flags) { - void *ret = slab_alloc(cachep, flags, cachep->object_size, _RET_IP_); - - trace_kmem_cache_alloc(_RET_IP_, ret, - cachep->object_size, cachep->size, flags); - - return ret; + return __kmem_cache_alloc_lru(cachep, NULL, flags); } EXPORT_SYMBOL(kmem_cache_alloc); +void *kmem_cache_alloc_lru(struct kmem_cache *cachep, struct list_lru *lru, + gfp_t flags) +{ + return __kmem_cache_alloc_lru(cachep, lru, flags); +} +EXPORT_SYMBOL(kmem_cache_alloc_lru); + static __always_inline void cache_alloc_debugcheck_after_bulk(struct kmem_cache *s, gfp_t flags, size_t size, void **p, unsigned long caller) @@ -3529,7 +3544,7 @@ int kmem_cache_alloc_bulk(struct kmem_cache *s, gfp_t flags, size_t size, size_t i; struct obj_cgroup *objcg = NULL; - s = slab_pre_alloc_hook(s, &objcg, size, flags); + s = slab_pre_alloc_hook(s, NULL, &objcg, size, flags); if (!s) return 0; @@ -3570,7 +3585,7 @@ kmem_cache_alloc_trace(struct kmem_cache *cachep, gfp_t flags, size_t size) { void *ret; - ret = slab_alloc(cachep, flags, size, _RET_IP_); + ret = slab_alloc(cachep, NULL, flags, size, _RET_IP_); ret = kasan_kmalloc(cachep, ret, size, flags); trace_kmalloc(_RET_IP_, ret, @@ -3697,7 +3712,7 @@ static __always_inline void *__do_kmalloc(size_t size, gfp_t flags, cachep = kmalloc_slab(size, flags); if (unlikely(ZERO_OR_NULL_PTR(cachep))) return cachep; - ret = slab_alloc(cachep, flags, size, caller); + ret = slab_alloc(cachep, NULL, flags, size, caller); ret = kasan_kmalloc(cachep, ret, size, flags); trace_kmalloc(caller, ret, diff --git a/mm/slab.h b/mm/slab.h index 58c01a34e5b8..c6fbfda824df 100644 --- a/mm/slab.h +++ b/mm/slab.h @@ -46,6 +46,7 @@ struct kmem_cache { #include #include #include +#include /* * State of the slab allocator. @@ -269,6 +270,7 @@ static inline size_t obj_full_size(struct kmem_cache *s) * Returns false if the allocation should fail. */ static inline bool memcg_slab_pre_alloc_hook(struct kmem_cache *s, + struct list_lru *lru, struct obj_cgroup **objcgp, size_t objects, gfp_t flags) { @@ -284,6 +286,17 @@ static inline bool memcg_slab_pre_alloc_hook(struct kmem_cache *s, if (!objcg) return true; + if (lru) { + struct mem_cgroup *memcg = get_mem_cgroup_from_objcg(objcg); + + if (list_lru_memcg_alloc(lru, memcg, flags)) { + css_put(&memcg->css); + obj_cgroup_put(objcg); + return false; + } + css_put(&memcg->css); + } + if (obj_cgroup_charge(objcg, flags, objects * obj_full_size(s))) { obj_cgroup_put(objcg); return false; @@ -386,6 +399,7 @@ static inline void memcg_free_page_obj_cgroups(struct page *page) } static inline bool memcg_slab_pre_alloc_hook(struct kmem_cache *s, + struct list_lru *lru, struct obj_cgroup **objcgp, size_t objects, gfp_t flags) { @@ -484,6 +498,7 @@ static inline size_t slab_ksize(const struct kmem_cache *s) } static inline struct kmem_cache *slab_pre_alloc_hook(struct kmem_cache *s, + struct list_lru *lru, struct obj_cgroup **objcgp, size_t size, gfp_t flags) { @@ -494,7 +509,7 @@ static inline struct kmem_cache *slab_pre_alloc_hook(struct kmem_cache *s, if (should_failslab(s, flags)) return NULL; - if (!memcg_slab_pre_alloc_hook(s, objcgp, size, flags)) + if (!memcg_slab_pre_alloc_hook(s, lru, objcgp, size, flags)) return NULL; return s; diff --git a/mm/slob.c b/mm/slob.c index 74d3f6e60666..9db272c75928 100644 --- a/mm/slob.c +++ b/mm/slob.c @@ -633,6 +633,12 @@ void *kmem_cache_alloc(struct kmem_cache *cachep, gfp_t flags) } EXPORT_SYMBOL(kmem_cache_alloc); + +void *kmem_cache_alloc_lru(struct kmem_cache *cachep, struct list_lru *lru, gfp_t flags) +{ + return slob_alloc_node(cachep, flags, NUMA_NO_NODE); +} +EXPORT_SYMBOL(kmem_cache_alloc_lru); #ifdef CONFIG_NUMA void *__kmalloc_node(size_t size, gfp_t gfp, int node) { diff --git a/mm/slub.c b/mm/slub.c index df1ac8aff86f..41211a2de0da 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -3083,7 +3083,7 @@ static __always_inline void maybe_wipe_obj_freeptr(struct kmem_cache *s, * * Otherwise we can simply pick the next object from the lockless free list. */ -static __always_inline void *slab_alloc_node(struct kmem_cache *s, +static __always_inline void *slab_alloc_node(struct kmem_cache *s, struct list_lru *lru, gfp_t gfpflags, int node, unsigned long addr, size_t orig_size) { void *object; @@ -3093,7 +3093,7 @@ static __always_inline void *slab_alloc_node(struct kmem_cache *s, struct obj_cgroup *objcg = NULL; bool init = false; - s = slab_pre_alloc_hook(s, &objcg, 1, gfpflags); + s = slab_pre_alloc_hook(s, lru, &objcg, 1, gfpflags); if (!s) return NULL; @@ -3184,27 +3184,41 @@ static __always_inline void *slab_alloc_node(struct kmem_cache *s, return object; } -static __always_inline void *slab_alloc(struct kmem_cache *s, +static __always_inline void *slab_alloc(struct kmem_cache *s, struct list_lru *lru, gfp_t gfpflags, unsigned long addr, size_t orig_size) { - return slab_alloc_node(s, gfpflags, NUMA_NO_NODE, addr, orig_size); + return slab_alloc_node(s, lru, gfpflags, NUMA_NO_NODE, addr, orig_size); } -void *kmem_cache_alloc(struct kmem_cache *s, gfp_t gfpflags) +static __always_inline +void *__kmem_cache_alloc_lru(struct kmem_cache *s, struct list_lru *lru, + gfp_t gfpflags) { - void *ret = slab_alloc(s, gfpflags, _RET_IP_, s->object_size); + void *ret = slab_alloc(s, lru, gfpflags, _RET_IP_, s->object_size); trace_kmem_cache_alloc(_RET_IP_, ret, s->object_size, s->size, gfpflags); return ret; } + +void *kmem_cache_alloc(struct kmem_cache *s, gfp_t gfpflags) +{ + return __kmem_cache_alloc_lru(s, NULL, gfpflags); +} EXPORT_SYMBOL(kmem_cache_alloc); +void *kmem_cache_alloc_lru(struct kmem_cache *s, struct list_lru *lru, + gfp_t gfpflags) +{ + return __kmem_cache_alloc_lru(s, lru, gfpflags); +} +EXPORT_SYMBOL(kmem_cache_alloc_lru); + #ifdef CONFIG_TRACING void *kmem_cache_alloc_trace(struct kmem_cache *s, gfp_t gfpflags, size_t size) { - void *ret = slab_alloc(s, gfpflags, _RET_IP_, size); + void *ret = slab_alloc(s, NULL, gfpflags, _RET_IP_, size); trace_kmalloc(_RET_IP_, ret, size, s->size, gfpflags); ret = kasan_kmalloc(s, ret, size, gfpflags); return ret; @@ -3215,7 +3229,7 @@ EXPORT_SYMBOL(kmem_cache_alloc_trace); #ifdef CONFIG_NUMA void *kmem_cache_alloc_node(struct kmem_cache *s, gfp_t gfpflags, int node) { - void *ret = slab_alloc_node(s, gfpflags, node, _RET_IP_, s->object_size); + void *ret = slab_alloc_node(s, NULL, gfpflags, node, _RET_IP_, s->object_size); trace_kmem_cache_alloc_node(_RET_IP_, ret, s->object_size, s->size, gfpflags, node); @@ -3229,7 +3243,7 @@ void *kmem_cache_alloc_node_trace(struct kmem_cache *s, gfp_t gfpflags, int node, size_t size) { - void *ret = slab_alloc_node(s, gfpflags, node, _RET_IP_, size); + void *ret = slab_alloc_node(s, NULL, gfpflags, node, _RET_IP_, size); trace_kmalloc_node(_RET_IP_, ret, size, s->size, gfpflags, node); @@ -3611,7 +3625,7 @@ int kmem_cache_alloc_bulk(struct kmem_cache *s, gfp_t flags, size_t size, struct obj_cgroup *objcg = NULL; /* memcg and kmem_cache debug support */ - s = slab_pre_alloc_hook(s, &objcg, size, flags); + s = slab_pre_alloc_hook(s, NULL, &objcg, size, flags); if (unlikely(!s)) return false; /* @@ -4360,7 +4374,7 @@ void *__kmalloc(size_t size, gfp_t flags) if (unlikely(ZERO_OR_NULL_PTR(s))) return s; - ret = slab_alloc(s, flags, _RET_IP_, size); + ret = slab_alloc(s, NULL, flags, _RET_IP_, size); trace_kmalloc(_RET_IP_, ret, size, s->size, flags); @@ -4408,7 +4422,7 @@ void *__kmalloc_node(size_t size, gfp_t flags, int node) if (unlikely(ZERO_OR_NULL_PTR(s))) return s; - ret = slab_alloc_node(s, flags, node, _RET_IP_, size); + ret = slab_alloc_node(s, NULL, flags, node, _RET_IP_, size); trace_kmalloc_node(_RET_IP_, ret, size, s->size, flags, node); @@ -4878,7 +4892,7 @@ void *__kmalloc_track_caller(size_t size, gfp_t gfpflags, unsigned long caller) if (unlikely(ZERO_OR_NULL_PTR(s))) return s; - ret = slab_alloc(s, gfpflags, caller, size); + ret = slab_alloc(s, NULL, gfpflags, caller, size); /* Honor the call site pointer we received. */ trace_kmalloc(caller, ret, size, s->size, gfpflags); @@ -4909,7 +4923,7 @@ void *__kmalloc_node_track_caller(size_t size, gfp_t gfpflags, if (unlikely(ZERO_OR_NULL_PTR(s))) return s; - ret = slab_alloc_node(s, gfpflags, node, caller, size); + ret = slab_alloc_node(s, NULL, gfpflags, node, caller, size); /* Honor the call site pointer we received. */ trace_kmalloc_node(caller, ret, size, s->size, gfpflags, node); From patchwork Tue Sep 14 07:28:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12491867 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_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 C6A5DC433F5 for ; Tue, 14 Sep 2021 07:33:59 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7C9F861029 for ; Tue, 14 Sep 2021 07:33:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 7C9F861029 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 21EA06B0072; Tue, 14 Sep 2021 03:33:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1CDB694000E; Tue, 14 Sep 2021 03:33:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0951694000D; Tue, 14 Sep 2021 03:33:59 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0085.hostedemail.com [216.40.44.85]) by kanga.kvack.org (Postfix) with ESMTP id F121C6B0072 for ; Tue, 14 Sep 2021 03:33:58 -0400 (EDT) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id B45362D4BD for ; Tue, 14 Sep 2021 07:33:58 +0000 (UTC) X-FDA: 78585364956.19.EBE8887 Received: from mail-pg1-f172.google.com (mail-pg1-f172.google.com [209.85.215.172]) by imf17.hostedemail.com (Postfix) with ESMTP id 3B398F000090 for ; Tue, 14 Sep 2021 07:33:58 +0000 (UTC) Received: by mail-pg1-f172.google.com with SMTP id u18so11982794pgf.0 for ; Tue, 14 Sep 2021 00:33:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=XM8lTqwIC/t1cHsDphwpH5utYAkV5aMz9gOR8B5mwoQ=; b=uJWPoBJVzhjkadfGiWbAPJGCfqjtJnVl2tkbT7o5apxB0OtiGGSR6nsvigPaV+nfTF BtoROtsUfMMvB/F2ffqKth8a7dGZanTz0d1UhErkhnnrCuOGCnsfyNp0rAp6VeMypF2k Rrd33YEdK9ZJvl54CkUpwRDOtzr43ofl+vbQ5yBnpEyEZV8d7LjA+SA1hICBNds7IMu6 sRQc6XrwtbYrQ46+wEqy84B8ZTEyXIBw1os8LJ5Dw7JG+UaUabwV7j258OKi+KyBcLX8 DD0sEihMjZb0fn2zExvp38ZJJyhcC8YzYN/lu5mUHfinJq2cqP80FHYNaFQzoCX6DLxL K8cQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=XM8lTqwIC/t1cHsDphwpH5utYAkV5aMz9gOR8B5mwoQ=; b=mpQ3njy2ar+8NPIoJkmR3qbpyHn2wp5jXPgqxQh9QImjjw9IAUQibUF6mZHTwDDn+L DU5GIdZRNkT0M9YxhUZpA5XjEW1HTNAoJ8GTHY6eZJ0SSTZMEQOtnwcElDVF20IPH0lH GGNw5Si6E0rIaMVI6M9usVr+qF1nvRdOldecmKa64ISov2sPBh7rGZk4ccFRhyKAKOr/ h6BN2twx9ZLR05UdNP8R7u4cKebD8D698o/BILcAjVRFiK0JAcafcJ0LR6KjVoyHKAQe fXnvZpErg78JtjTIgxHD3/SS8P1uzEepvbnZz7slggZiDv+2PMcwAtRNAZ1S/6OAiMsN v3uA== X-Gm-Message-State: AOAM5330DNhIWX9eYUiT2bS+dT8HYpDfzRHFapsv1p7yzr3N7cwSTf9p oHfzHIW2Ew663IoTngFMAlBw/w== X-Google-Smtp-Source: ABdhPJx4jDMCj3y+I06HB83GUQxuXdp7OYPPhRZx43pPnnq1Q0vnwOEKSObZyNzprSCEdhoVGGZdxQ== X-Received: by 2002:a63:7454:: with SMTP id e20mr14233508pgn.136.1631604837380; Tue, 14 Sep 2021 00:33:57 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.244]) by smtp.gmail.com with ESMTPSA id s3sm9377839pfd.188.2021.09.14.00.33.51 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Sep 2021 00:33:57 -0700 (PDT) From: Muchun Song To: willy@infradead.org, akpm@linux-foundation.org, hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, shakeelb@google.com, guro@fb.com, shy828301@gmail.com, alexs@kernel.org, richard.weiyang@gmail.com, david@fromorbit.com, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, zhengqi.arch@bytedance.com, duanxiongchun@bytedance.com, fam.zheng@bytedance.com, smuchun@gmail.com, Muchun Song Subject: [PATCH v3 09/76] fs: introduce alloc_inode_sb() to allocate filesystems specific inode Date: Tue, 14 Sep 2021 15:28:31 +0800 Message-Id: <20210914072938.6440-10-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20210914072938.6440-1-songmuchun@bytedance.com> References: <20210914072938.6440-1-songmuchun@bytedance.com> MIME-Version: 1.0 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 3B398F000090 X-Stat-Signature: pcmnuowp93d1fynjuwqu9fsxuuoirmec Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=uJWPoBJV; spf=pass (imf17.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.215.172 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com X-HE-Tag: 1631604838-33642 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 allocated inode cache is supposed to be added to its memcg list_lru which should be allocated as well in advance. That can be done by kmem_cache_alloc_lru() which allocates object and list_lru. The file systems is main user of it. So introduce alloc_inode_sb() to allocate file system specific inodes and set up the inode reclaim context properly. The file system is supposed to use alloc_inode_sb() to allocate inodes. In the later patches, we will convert all users to the new API. Signed-off-by: Muchun Song --- Documentation/filesystems/porting.rst | 5 +++++ fs/inode.c | 2 +- include/linux/fs.h | 11 +++++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/Documentation/filesystems/porting.rst b/Documentation/filesystems/porting.rst index bf19fd6b86e7..c9c157d7b7bb 100644 --- a/Documentation/filesystems/porting.rst +++ b/Documentation/filesystems/porting.rst @@ -45,6 +45,11 @@ typically between calling iget_locked() and unlocking the inode. At some point that will become mandatory. +**mandatory** + +The foo_inode_info should always be allocated through alloc_inode_sb() rather +than kmem_cache_alloc() or kmalloc() related. + --- **mandatory** diff --git a/fs/inode.c b/fs/inode.c index cb41f02d8ced..43d06b42f908 100644 --- a/fs/inode.c +++ b/fs/inode.c @@ -234,7 +234,7 @@ static struct inode *alloc_inode(struct super_block *sb) if (ops->alloc_inode) inode = ops->alloc_inode(sb); else - inode = kmem_cache_alloc(inode_cachep, GFP_KERNEL); + inode = alloc_inode_sb(sb, inode_cachep, GFP_KERNEL); if (!inode) return NULL; diff --git a/include/linux/fs.h b/include/linux/fs.h index bec3781d260f..c03d8b3fa70c 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -41,6 +41,7 @@ #include #include #include +#include #include #include @@ -3173,6 +3174,16 @@ extern void free_inode_nonrcu(struct inode *inode); extern int should_remove_suid(struct dentry *); extern int file_remove_privs(struct file *); +/* + * This must be used for allocating filesystems specific inodes to set + * up the inode reclaim context correctly. + */ +static inline void * +alloc_inode_sb(struct super_block *sb, struct kmem_cache *cache, gfp_t gfp) +{ + return kmem_cache_alloc_lru(cache, &sb->s_inode_lru, gfp); +} + extern void __insert_inode_hash(struct inode *, unsigned long hashval); static inline void insert_inode_hash(struct inode *inode) { From patchwork Tue Sep 14 07:28:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12491869 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_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 2DB63C433F5 for ; Tue, 14 Sep 2021 07:34:06 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id BA57161056 for ; Tue, 14 Sep 2021 07:34:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org BA57161056 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 5EDEA6B0073; Tue, 14 Sep 2021 03:34:05 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 59E14900003; Tue, 14 Sep 2021 03:34:05 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 465A4900002; Tue, 14 Sep 2021 03:34:05 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0183.hostedemail.com [216.40.44.183]) by kanga.kvack.org (Postfix) with ESMTP id 395DF6B0073 for ; Tue, 14 Sep 2021 03:34:05 -0400 (EDT) Received: from smtpin02.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id F14E01806508F for ; Tue, 14 Sep 2021 07:34:04 +0000 (UTC) X-FDA: 78585365208.02.D1F85EF Received: from mail-pg1-f177.google.com (mail-pg1-f177.google.com [209.85.215.177]) by imf09.hostedemail.com (Postfix) with ESMTP id BF19B3000104 for ; Tue, 14 Sep 2021 07:34:04 +0000 (UTC) Received: by mail-pg1-f177.google.com with SMTP id w8so11909455pgf.5 for ; Tue, 14 Sep 2021 00:34:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Een1sDBPrj2tYW3UgVidRn2hFKpvInjKsC4lnzv+r+s=; b=hwfQHv4YyZFuK8uRdecl6UJ4ZCLL+YxGBmSPzJfSBj+cNX0RGj/vjS2huquwqR2eff 894MlelcvOoW2PXCHkdchBqg5JUCefoMMCAC8MR03VHs8yMafrYb0TeXP+3K5mV5REeD 482qt36XpQMzllbc+46p7H8rLB98khauGSLxtRet0z3aIid/fOJpRD2DoUCzkst0ZBMc vjfu9UiPtpxcX1uhiLA8iY7YU9A2PEZZDB/g2RyO4gZf2oilHmwW/8eePABd1A05Gqkx OUBnQfpEhAiz43za7C+MvI08abWGRBjPx6qmSW/y3/Nx6pphrhq6xFOnko1qnD0RVtXv aVkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Een1sDBPrj2tYW3UgVidRn2hFKpvInjKsC4lnzv+r+s=; b=D8PHyMMzuo0aR4nKDxC0Kit6bUe2T+ouPI36WwTlQRjlFwRjDMGR2U96qxN/XCmDvw Dy36pmLrNF81ZX4n/aE3Ug1jbaQT/9Xy7N7Dt87OTX6AT3O8X5/3+ozpPERxg4XTYAEa Wlld8XbnwbaFJEYVGEOdZm3CnQzWJ29vZ3x8sSkmfMd6CEsjlMcdkuPiQ9Vhm5+3/Ko0 LpYIoDIZu68pK9tNFICKX3LQpPqPfjOmFnncs3J9sjHaDmr4PhTk9lsYOZds9mWN5n6G ULw2Yr4zTJV2B7x1L0d6S+txfFyG2hMlsG7G/rWpUog9e2Jp8SVGd7px3bI73ZJaD2Gz suHQ== X-Gm-Message-State: AOAM531SA4l5kRgLx5SeF+kDmdyLiMW42NC7yP4cmC1PVZ9y+BpYRVS2 ilDOgmPjYy/yN3pYVWyoQyNW9A== X-Google-Smtp-Source: ABdhPJxDuPlbC/nA4zUe4ijemmnEj10CilEPVZjnz1hnHeZ7fxNYn8sSJwcyYn/0tT/kQd/l8F/T9g== X-Received: by 2002:a63:8f53:: with SMTP id r19mr14599042pgn.84.1631604843947; Tue, 14 Sep 2021 00:34:03 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.244]) by smtp.gmail.com with ESMTPSA id s3sm9377839pfd.188.2021.09.14.00.33.57 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Sep 2021 00:34:03 -0700 (PDT) From: Muchun Song To: willy@infradead.org, akpm@linux-foundation.org, hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, shakeelb@google.com, guro@fb.com, shy828301@gmail.com, alexs@kernel.org, richard.weiyang@gmail.com, david@fromorbit.com, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, zhengqi.arch@bytedance.com, duanxiongchun@bytedance.com, fam.zheng@bytedance.com, smuchun@gmail.com, Muchun Song Subject: [PATCH v3 10/76] dax: allocate inode by using alloc_inode_sb() Date: Tue, 14 Sep 2021 15:28:32 +0800 Message-Id: <20210914072938.6440-11-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20210914072938.6440-1-songmuchun@bytedance.com> References: <20210914072938.6440-1-songmuchun@bytedance.com> MIME-Version: 1.0 Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=hwfQHv4Y; spf=pass (imf09.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.215.177 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com X-Stat-Signature: eore7eugndmbd4qufkq3je47ypde3can X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: BF19B3000104 X-HE-Tag: 1631604844-551984 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 inode allocation is supposed to use alloc_inode_sb(), so convert kmem_cache_alloc() to alloc_inode_sb(). Signed-off-by: Muchun Song --- drivers/dax/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/dax/super.c b/drivers/dax/super.c index fc89e91beea7..288c0b85bb77 100644 --- a/drivers/dax/super.c +++ b/drivers/dax/super.c @@ -447,7 +447,7 @@ static struct inode *dax_alloc_inode(struct super_block *sb) struct dax_device *dax_dev; struct inode *inode; - dax_dev = kmem_cache_alloc(dax_cache, GFP_KERNEL); + dax_dev = alloc_inode_sb(sb, dax_cache, GFP_KERNEL); if (!dax_dev) return NULL; From patchwork Tue Sep 14 07:28:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12491987 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_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 AB5DAC433F5 for ; Tue, 14 Sep 2021 07:34:12 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 56A6A61029 for ; Tue, 14 Sep 2021 07:34:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 56A6A61029 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id EC79B900002; Tue, 14 Sep 2021 03:34:11 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E772E6B0075; Tue, 14 Sep 2021 03:34:11 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D3F2A900002; Tue, 14 Sep 2021 03:34:11 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0075.hostedemail.com [216.40.44.75]) by kanga.kvack.org (Postfix) with ESMTP id C5E9D6B0074 for ; Tue, 14 Sep 2021 03:34:11 -0400 (EDT) Received: from smtpin29.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 71CE026DE9 for ; Tue, 14 Sep 2021 07:34:11 +0000 (UTC) X-FDA: 78585365502.29.2DE97A7 Received: from mail-pj1-f48.google.com (mail-pj1-f48.google.com [209.85.216.48]) by imf23.hostedemail.com (Postfix) with ESMTP id 4282F900009B for ; Tue, 14 Sep 2021 07:34:11 +0000 (UTC) Received: by mail-pj1-f48.google.com with SMTP id u13-20020a17090abb0db0290177e1d9b3f7so1461898pjr.1 for ; Tue, 14 Sep 2021 00:34:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=CDLcpu946MbvuRuUN1EHiKI2jWbJ59wOnelshGEwx5o=; b=EGcTSzQ7LymxzMTmcq+dY1RH9ZVtzdq+L+Vjkit29Ww41oJngNrtZ5zm4052jkZaiC 7p5aUcuMt6czSQXWt/P7YkfR8Ulh2OdcakbGakJT015ZoKEn38W1rljR2BFsXSDp9ka+ F9mDBF9RU/Hw9axHyaHS2b3yPsMb9t+e3Od/Xku/gOZTsipnJAFz4qYQsqFnqWf5LS0w qPaRpBgAq+f5zw1gxYt1jFvBh+OBB5rYVBWGCM9yx5HNHrx9ytpfVq9LNIiEm1vzlJBO 7pO4zaMTd9lpyex/J8rVnUKWsUjiTHpJuVl++l1wgTf5D24yJI58JBZI0UiXD+wis+Lh ke1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=CDLcpu946MbvuRuUN1EHiKI2jWbJ59wOnelshGEwx5o=; b=BQ/vo7V3NzGs6WLrnwCYCTzGW2711Jawn9KFvKlowrNrYQKMoqP2N4KLuAYu3z9XGD ZRHFec7ZiW8AgcEVRm7PCGt9eSfB20Zt4HBA2w0cF+Ta69ad5lmzprZrykGI1FhxYUnR fIJDdWG6q4zzhi1u6KKAwKKmVRYzNbkMtn35L2rR6YHWXWm4rS082Ge1zqH9D0C0p4RY JZuD2t99xdf89v4jvn7Ni7GneLa62zrkvyE7oFCUhNLCeRpivYoC2Ky2rffHJY5LeB1n ATKGx7YN6Vl83SKzVR2mXl+79c+q6q1HrZ1/Jgoeu5oh40bdqIbP+NExi30uYIAO+92l c/Gw== X-Gm-Message-State: AOAM532RAyZyM23qD7ohXk0osEjg0dcq6AaHodRcG2Dg4mbKpPnlFtt8 GBeGKq9/9Av8v55E/VMrvyz3yg== X-Google-Smtp-Source: ABdhPJwbNQU8pwckWFcISKjOKiStbCnWygByP2QJqQa3Fx2qPJKGChBhiiUStRWPmq4GXF6FfmvNuw== X-Received: by 2002:a17:902:c40e:b0:138:e2f9:6c97 with SMTP id k14-20020a170902c40e00b00138e2f96c97mr13773344plk.26.1631604850440; Tue, 14 Sep 2021 00:34:10 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.244]) by smtp.gmail.com with ESMTPSA id s3sm9377839pfd.188.2021.09.14.00.34.04 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Sep 2021 00:34:10 -0700 (PDT) From: Muchun Song To: willy@infradead.org, akpm@linux-foundation.org, hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, shakeelb@google.com, guro@fb.com, shy828301@gmail.com, alexs@kernel.org, richard.weiyang@gmail.com, david@fromorbit.com, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, zhengqi.arch@bytedance.com, duanxiongchun@bytedance.com, fam.zheng@bytedance.com, smuchun@gmail.com, Muchun Song Subject: [PATCH v3 11/76] 9p: allocate inode by using alloc_inode_sb() Date: Tue, 14 Sep 2021 15:28:33 +0800 Message-Id: <20210914072938.6440-12-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20210914072938.6440-1-songmuchun@bytedance.com> References: <20210914072938.6440-1-songmuchun@bytedance.com> MIME-Version: 1.0 X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 4282F900009B X-Stat-Signature: qfjxsdf7384bwajes5ftjkz3hnjtceim Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=EGcTSzQ7; spf=pass (imf23.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.216.48 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com X-HE-Tag: 1631604851-181510 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 inode allocation is supposed to use alloc_inode_sb(), so convert kmem_cache_alloc() to alloc_inode_sb(). Signed-off-by: Muchun Song --- fs/9p/vfs_inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c index 795706520b5e..5311f35accf5 100644 --- a/fs/9p/vfs_inode.c +++ b/fs/9p/vfs_inode.c @@ -223,7 +223,7 @@ v9fs_blank_wstat(struct p9_wstat *wstat) struct inode *v9fs_alloc_inode(struct super_block *sb) { struct v9fs_inode *v9inode; - v9inode = kmem_cache_alloc(v9fs_inode_cache, GFP_KERNEL); + v9inode = alloc_inode_sb(sb, v9fs_inode_cache, GFP_KERNEL); if (!v9inode) return NULL; #ifdef CONFIG_9P_FSCACHE From patchwork Tue Sep 14 07:28:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12491989 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_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 0A121C433EF for ; Tue, 14 Sep 2021 07:34:21 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B1EDC61029 for ; Tue, 14 Sep 2021 07:34:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org B1EDC61029 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 5784B940007; Tue, 14 Sep 2021 03:34:20 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 528866B0075; Tue, 14 Sep 2021 03:34:20 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3F05A940007; Tue, 14 Sep 2021 03:34:20 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0025.hostedemail.com [216.40.44.25]) by kanga.kvack.org (Postfix) with ESMTP id 329F36B0074 for ; Tue, 14 Sep 2021 03:34:20 -0400 (EDT) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id E1FD02D4A1 for ; Tue, 14 Sep 2021 07:34:19 +0000 (UTC) X-FDA: 78585365838.13.E248529 Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) by imf06.hostedemail.com (Postfix) with ESMTP id A2BD8801A8A0 for ; Tue, 14 Sep 2021 07:34:19 +0000 (UTC) Received: by mail-pl1-f177.google.com with SMTP id bg1so7579558plb.13 for ; Tue, 14 Sep 2021 00:34:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=e0Cz5KszzKgz+rfafe6kJxucNkG4zz2R/wYYOusb/5g=; b=vJYKAwYhwUV5hhfFKNxFX40A7tFGg6R3plM+yV0OSmh/VU/IqBmwbz8zgHD1tHkEK4 E1JD4YltDx4a3n4GSbOI0E3x++tTa+l+SIit1D9Da0hOUEa8EjrH/68hl09owts8ZSP7 lpFgWoOwZs70Nh5hAPXb8CMgr30Z9pNyIMb0YXUoMiaxCQVE0eG3O++s30J7pfJeu5k3 Iqw1eTvYDoaHw9ODD3FXUIcPhYShUrAtBJc1DDPDdwRsjTw6vr5De7ltVLGADuOeqFgQ q4vQAhJ8Up4ymIRMAKjHeyR0DbH3TBqW6isSVBLzY8tABPgSSy57qJbomc00Lngwzsfy Yb0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=e0Cz5KszzKgz+rfafe6kJxucNkG4zz2R/wYYOusb/5g=; b=6j8G7cmqAZmEOBPp54x827PNNK3r6jaOAdb3aMRNeb8ERBf+evL8rG7LYh2kZ4BIYS Q8USu89hYXm9HqAPuG2jpFtQIUspJs+7RhbNA9w5hXcxhVdtG6uyfMteQKDdcdH9DIgN Mr9ZhrjP3Zi9EZqkTKj+U8AyvbcX33N6v3d+DtX+QM9QTHV7xPh/NNca7Gp8GJWNYJEZ nX+KfLjuUdQpL82fxJarv4MC0911dg7MBmj8wQ/gOBEPBzCrGc6LlVKJhWUQQhN4y/Jd 5uclAx0JzEt3NKKIs10yQN1sqw0lQXBt6iCoV51+4Xkt0aRVZOPyKh9Yg0KU0cdOMsK+ yaBw== X-Gm-Message-State: AOAM530bTboRUnbFrOibewD3DPpYh6XhOwb4cEyH4hZj4TVRSqWcoH9S kAI7C/G9AM9YXftaDiv1iD10Qw== X-Google-Smtp-Source: ABdhPJyCqvutogGUThraHLU+AXmQ0katkDnels28Nlq4T7R4apDU3w/FDhkLQaDwakizASQL3Uq/RQ== X-Received: by 2002:a17:90a:2:: with SMTP id 2mr523792pja.77.1631604858840; Tue, 14 Sep 2021 00:34:18 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.244]) by smtp.gmail.com with ESMTPSA id s3sm9377839pfd.188.2021.09.14.00.34.10 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Sep 2021 00:34:18 -0700 (PDT) From: Muchun Song To: willy@infradead.org, akpm@linux-foundation.org, hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, shakeelb@google.com, guro@fb.com, shy828301@gmail.com, alexs@kernel.org, richard.weiyang@gmail.com, david@fromorbit.com, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, zhengqi.arch@bytedance.com, duanxiongchun@bytedance.com, fam.zheng@bytedance.com, smuchun@gmail.com, Muchun Song Subject: [PATCH v3 12/76] adfs: allocate inode by using alloc_inode_sb() Date: Tue, 14 Sep 2021 15:28:34 +0800 Message-Id: <20210914072938.6440-13-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20210914072938.6440-1-songmuchun@bytedance.com> References: <20210914072938.6440-1-songmuchun@bytedance.com> MIME-Version: 1.0 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: A2BD8801A8A0 X-Stat-Signature: fexosda9x5k4gs3nix1uyxr96r5ahin3 Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=vJYKAwYh; spf=pass (imf06.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.214.177 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com X-HE-Tag: 1631604859-949444 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 inode allocation is supposed to use alloc_inode_sb(), so convert kmem_cache_alloc() to alloc_inode_sb(). Signed-off-by: Muchun Song --- fs/adfs/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/adfs/super.c b/fs/adfs/super.c index bdbd26e571ed..e8bfc38239cd 100644 --- a/fs/adfs/super.c +++ b/fs/adfs/super.c @@ -220,7 +220,7 @@ static struct kmem_cache *adfs_inode_cachep; static struct inode *adfs_alloc_inode(struct super_block *sb) { struct adfs_inode_info *ei; - ei = kmem_cache_alloc(adfs_inode_cachep, GFP_KERNEL); + ei = alloc_inode_sb(sb, adfs_inode_cachep, GFP_KERNEL); if (!ei) return NULL; return &ei->vfs_inode; From patchwork Tue Sep 14 07:28:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12491991 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_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 624E9C433F5 for ; Tue, 14 Sep 2021 07:34:28 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id F1E9A61029 for ; Tue, 14 Sep 2021 07:34:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org F1E9A61029 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 96F83940008; Tue, 14 Sep 2021 03:34:27 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 91FDD6B0074; Tue, 14 Sep 2021 03:34:27 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7E799940008; Tue, 14 Sep 2021 03:34:27 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0070.hostedemail.com [216.40.44.70]) by kanga.kvack.org (Postfix) with ESMTP id 71DAC6B0074 for ; Tue, 14 Sep 2021 03:34:27 -0400 (EDT) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 307C98249980 for ; Tue, 14 Sep 2021 07:34:27 +0000 (UTC) X-FDA: 78585366174.10.720A17C Received: from mail-pj1-f41.google.com (mail-pj1-f41.google.com [209.85.216.41]) by imf27.hostedemail.com (Postfix) with ESMTP id E7E1F700009B for ; Tue, 14 Sep 2021 07:34:26 +0000 (UTC) Received: by mail-pj1-f41.google.com with SMTP id on12-20020a17090b1d0c00b001997c60aa29so1555369pjb.1 for ; Tue, 14 Sep 2021 00:34:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=23796e/EkCqGxsts7z4T27F2CElIqEnQP+HmB8HPPWM=; b=MS7HQl7iHYUzOUvFODQmZjoYJ4YLn/YMn1KBuXeAE2HJsvzgrUzAjKGouJbWUwM7fe xcLQCyRaqQ7kh33upx0tME0azMBtkyyer0bC8FTcuCgmgbh0btr2Txss3es2Te9U66Zx /04nyjlNDY6baWg7SFPt2EUhbDw5/cKAZ+XSb6ErGfhmfLnm0vBex0BhMrVmfMCMgurQ g2ht4nFNF3rZcOdh8Sr422taztMsvkAlurB4SsGBYcCgN3HwxTWMbH1i6EW2K6w5oRNs yTl3jldf4WiT3d4gutcEIR3UXl9ydfUc036e15wEPpwhC00zBAXgTXc5r5T84cESZh6h 8pjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=23796e/EkCqGxsts7z4T27F2CElIqEnQP+HmB8HPPWM=; b=Q7CyBYj4ONEYyaNDXNYe7qPryZ/BmCMEdq02namPpH2zyjlgfEy7isA6UcvW+ZgbgZ RozN+vxSBea4F4/0L0GpBuguyV2SRWmspnckqSo/hhYYFTY6Zplc6td9YYjTCzLtsNrP 0ZvLLVm80CSoMDvq1nBbIj0emSSFiw2DO1RTG8lCEzAFo5bWtc3O3cfoLcSyekSe4dVZ qW5z5bJvk4A8X3xWyUYySqEPNDAgSZLCDq2id4MiaWITs6WLcUQJLrabJguJapiWTLkg bIFAMgSjRLfucFt0pPUE2H+wpxszraTe1yn4Vrqc+t6jenO0de5YnwSh/DImypTXbPVP 9eUA== X-Gm-Message-State: AOAM531AuClpKV1WbBQjSMWU5PExT8XRIMCzpZsiVR4wfPR6/OR8B34M q9z05Osi43AA/+bCpPTENf/VuQ== X-Google-Smtp-Source: ABdhPJx1OdmjbG0QVQ5po/ZxEEh1YazMixa0/wdVxV+iLUPLe1yC8JzYAiRcPVg6pyBEe4boi4Y7kg== X-Received: by 2002:a17:90a:12:: with SMTP id 18mr561980pja.104.1631604866075; Tue, 14 Sep 2021 00:34:26 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.244]) by smtp.gmail.com with ESMTPSA id s3sm9377839pfd.188.2021.09.14.00.34.19 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Sep 2021 00:34:25 -0700 (PDT) From: Muchun Song To: willy@infradead.org, akpm@linux-foundation.org, hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, shakeelb@google.com, guro@fb.com, shy828301@gmail.com, alexs@kernel.org, richard.weiyang@gmail.com, david@fromorbit.com, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, zhengqi.arch@bytedance.com, duanxiongchun@bytedance.com, fam.zheng@bytedance.com, smuchun@gmail.com, Muchun Song Subject: [PATCH v3 13/76] affs: allocate inode by using alloc_inode_sb() Date: Tue, 14 Sep 2021 15:28:35 +0800 Message-Id: <20210914072938.6440-14-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20210914072938.6440-1-songmuchun@bytedance.com> References: <20210914072938.6440-1-songmuchun@bytedance.com> MIME-Version: 1.0 X-Stat-Signature: w8wyikm31exkj64zu5pxjefdiqnzqj7a Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=MS7HQl7i; dmarc=pass (policy=none) header.from=bytedance.com; spf=pass (imf27.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.216.41 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: E7E1F700009B X-HE-Tag: 1631604866-355966 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 inode allocation is supposed to use alloc_inode_sb(), so convert kmem_cache_alloc() to alloc_inode_sb(). Signed-off-by: Muchun Song --- fs/affs/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/affs/super.c b/fs/affs/super.c index c6c2a513ec92..67458f63a1ab 100644 --- a/fs/affs/super.c +++ b/fs/affs/super.c @@ -100,7 +100,7 @@ static struct inode *affs_alloc_inode(struct super_block *sb) { struct affs_inode_info *i; - i = kmem_cache_alloc(affs_inode_cachep, GFP_KERNEL); + i = alloc_inode_sb(sb, affs_inode_cachep, GFP_KERNEL); if (!i) return NULL; From patchwork Tue Sep 14 07:28:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12491993 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_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 8E78AC433F5 for ; Tue, 14 Sep 2021 07:34:35 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3D4E161029 for ; Tue, 14 Sep 2021 07:34:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 3D4E161029 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id D1998940009; Tue, 14 Sep 2021 03:34:34 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CC9866B0074; Tue, 14 Sep 2021 03:34:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B9143940009; Tue, 14 Sep 2021 03:34:34 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0009.hostedemail.com [216.40.44.9]) by kanga.kvack.org (Postfix) with ESMTP id ACD3C6B006C for ; Tue, 14 Sep 2021 03:34:34 -0400 (EDT) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 56BE7180945DD for ; Tue, 14 Sep 2021 07:34:34 +0000 (UTC) X-FDA: 78585366468.17.C53B9E8 Received: from mail-pf1-f179.google.com (mail-pf1-f179.google.com [209.85.210.179]) by imf29.hostedemail.com (Postfix) with ESMTP id 279069000249 for ; Tue, 14 Sep 2021 07:34:34 +0000 (UTC) Received: by mail-pf1-f179.google.com with SMTP id w19so6947917pfn.12 for ; Tue, 14 Sep 2021 00:34:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=m96L+zVQUR6AnDBWXoAHTXEu/tNBSY5AnJri9rNBEEI=; b=Y0hjJinSBRIbrKfMVhAkCDp86Gz7tBwHyDz8ynbEIsICEuIt8cCVWfa19XoTVfKVr6 iK3B1qUIgJuNqbVpIAiujCfNlFxPGo2o7L2KYY+JVh7XHWaqY08O0bVjWUunkwvUtHR0 zdwwmbHa2Qs/YpRQjPWeB7HqWhUrAFlyO2MkLFB90Z/6H2V1TBxBacKnADuSA3GHns7q mCa5+IK8uXxjLu3yUjiSwSx1sbAgJxQKieCkM9RudG0n2qQE0NfXlp1JoP8c1VyPPpfj EiDKP6kikslkO98hgqx7q6ZxnG31L6mcG3CLAallv8dDWoA7qq/tuYUuHo43DWBh8wTb 1l1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=m96L+zVQUR6AnDBWXoAHTXEu/tNBSY5AnJri9rNBEEI=; b=nvvpjUHhSezX4sICJ7X8otuOYVHuK93Nui9rCfJ78iqN0KPZxTBqGDJ6WwaNh6th04 WOOKo8wXDs7+ObLJoyLXmhkUGNmkVW0AmHBLmo2aCSu6RN/vVkssNqkwVUbag9xhJRiS fO2mkyk/omWqQDguqd6W3ffgme2DbEkT7yR9i++1JFiFZn9f6z8fk8WPZsd7hw3/2v0r TdcW0LIPC0WZkxPdXI9TKfeUXDZLOCmwNa/TDg4fmwFkkTn1hLcAJTHiNYCHHANGS/Ki DyqhdTNQynFq9bhkJuZsO686a7ogJU8xbEY/5k8gXKDRwl1tBORMLtdHa5GRkK26xz5f NJ1g== X-Gm-Message-State: AOAM531BxGvdIIzkDoJ6mlR3Qu6/5v6fq1iT5zT57WJd4KkHaeNq4WGr wgWb8SCYLOUXJDLRdE258Jkr4A== X-Google-Smtp-Source: ABdhPJw5l5kBaKBTV84qO1bQ0kgDegLUgD7W0AdA+4Utz9av4/Ad6AgcCH+taK2oUcCvKKd8wZJi5A== X-Received: by 2002:aa7:8d10:0:b0:414:ab01:656c with SMTP id j16-20020aa78d10000000b00414ab01656cmr3315679pfe.13.1631604873164; Tue, 14 Sep 2021 00:34:33 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.244]) by smtp.gmail.com with ESMTPSA id s3sm9377839pfd.188.2021.09.14.00.34.26 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Sep 2021 00:34:32 -0700 (PDT) From: Muchun Song To: willy@infradead.org, akpm@linux-foundation.org, hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, shakeelb@google.com, guro@fb.com, shy828301@gmail.com, alexs@kernel.org, richard.weiyang@gmail.com, david@fromorbit.com, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, zhengqi.arch@bytedance.com, duanxiongchun@bytedance.com, fam.zheng@bytedance.com, smuchun@gmail.com, Muchun Song Subject: [PATCH v3 14/76] afs: allocate inode by using alloc_inode_sb() Date: Tue, 14 Sep 2021 15:28:36 +0800 Message-Id: <20210914072938.6440-15-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20210914072938.6440-1-songmuchun@bytedance.com> References: <20210914072938.6440-1-songmuchun@bytedance.com> MIME-Version: 1.0 X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 279069000249 X-Stat-Signature: u6ru3h9dyha8whyedbkcpxhgfceff4af Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=Y0hjJinS; spf=pass (imf29.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.210.179 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com X-HE-Tag: 1631604874-144809 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 inode allocation is supposed to use alloc_inode_sb(), so convert kmem_cache_alloc() to alloc_inode_sb(). Signed-off-by: Muchun Song --- fs/afs/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/afs/super.c b/fs/afs/super.c index e38bb1e7a4d2..0ecea5a94af9 100644 --- a/fs/afs/super.c +++ b/fs/afs/super.c @@ -677,7 +677,7 @@ static struct inode *afs_alloc_inode(struct super_block *sb) { struct afs_vnode *vnode; - vnode = kmem_cache_alloc(afs_inode_cachep, GFP_KERNEL); + vnode = alloc_inode_sb(sb, afs_inode_cachep, GFP_KERNEL); if (!vnode) return NULL; From patchwork Tue Sep 14 07:28:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12491995 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_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 DA971C433EF for ; Tue, 14 Sep 2021 07:34:45 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 93DBF61056 for ; Tue, 14 Sep 2021 07:34:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 93DBF61056 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 3553694000D; Tue, 14 Sep 2021 03:34:45 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3047E6B0074; Tue, 14 Sep 2021 03:34:45 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1CCCC94000D; Tue, 14 Sep 2021 03:34:45 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0050.hostedemail.com [216.40.44.50]) by kanga.kvack.org (Postfix) with ESMTP id 10BE26B006C for ; Tue, 14 Sep 2021 03:34:45 -0400 (EDT) Received: from smtpin35.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id C453B22011 for ; Tue, 14 Sep 2021 07:34:44 +0000 (UTC) X-FDA: 78585366888.35.2943F21 Received: from mail-pj1-f49.google.com (mail-pj1-f49.google.com [209.85.216.49]) by imf14.hostedemail.com (Postfix) with ESMTP id 957D36001983 for ; Tue, 14 Sep 2021 07:34:44 +0000 (UTC) Received: by mail-pj1-f49.google.com with SMTP id k23-20020a17090a591700b001976d2db364so2060194pji.2 for ; Tue, 14 Sep 2021 00:34:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Pedf9du0q8x1qAsaM5V3taJv2nQf7Bhn4Zyu6Rs8BOA=; b=UmoEkfxCRPhIo5HEYCOvUTLwt2JiJ7GS6xmqjTUFzuAs0PIbDbopH2NDmuJyFjtvSA 6Qocu6XCUru0ObSWp/NjROFSqLvbK1De3Fo1USBVt+p+GeyE7puX/aMKapXy+mPilRpn 1AjHYrsyrr3J41uOox3PqjFfRqMWjfKb6impQOYoGwyJbValrlYJajenPS7+RYtemLIl GUO+IphKhrxtkIgZFF31nY2xO8r1RCKRr4NdnKa3tynWEIgt/k5x0ZJKfQ0ag50EUOwM tkrQAQyCR7aEmJqihD3I5zpip1PyBFUDFZkQWNKp6X/8XrHpgktM6ZkSnpzrvth72bFz 4W/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Pedf9du0q8x1qAsaM5V3taJv2nQf7Bhn4Zyu6Rs8BOA=; b=32arZqVorawaMTPTjH5ogsWP9C9FkVPHpdhtxcUOzrp73a+SJKBU4ocgnl0zqJ4Ir0 ypWECTONiJUEoaJPDjFjEeSgE4Frm4AQ5ScMvENukOvPMb1EN4W426tZXD4cUcamlnm4 JbKvbqgKmVpTNce2AY1FhwY819WJDrH+/vX3y0ArZP2jMaciTxbUv5AmejroixvYT2Q4 H0RMJzRKiTxcKTpmYLLXauwUcWrSUtFGr77pt6hfERh4bj78iPTUmU02S5Sv3EmDGt26 VPAvPrB7puLvno/3KLfKHxSsHaJz5ShLgGQG88ZHduVhwvN4SEaA+QTlI32ot+I+2IcP tKQw== X-Gm-Message-State: AOAM530KLTw7z0A6hJ4D2+vutH0N8nPP9kcYOlryTZfI8D6eGfOI47S6 knJ8JPtMLM7dn6R0mWbuVfLADQ== X-Google-Smtp-Source: ABdhPJyrhuxUeqV+K1cl2xp3aIj58oY9WlBf65ST7PoGj30D+6kcbs/jZTrC/qRoOUA6+U41V1WqrQ== X-Received: by 2002:a17:90b:4901:: with SMTP id kr1mr574557pjb.80.1631604883756; Tue, 14 Sep 2021 00:34:43 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.244]) by smtp.gmail.com with ESMTPSA id s3sm9377839pfd.188.2021.09.14.00.34.33 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Sep 2021 00:34:43 -0700 (PDT) From: Muchun Song To: willy@infradead.org, akpm@linux-foundation.org, hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, shakeelb@google.com, guro@fb.com, shy828301@gmail.com, alexs@kernel.org, richard.weiyang@gmail.com, david@fromorbit.com, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, zhengqi.arch@bytedance.com, duanxiongchun@bytedance.com, fam.zheng@bytedance.com, smuchun@gmail.com, Muchun Song Subject: [PATCH v3 15/76] befs: allocate inode by using alloc_inode_sb() Date: Tue, 14 Sep 2021 15:28:37 +0800 Message-Id: <20210914072938.6440-16-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20210914072938.6440-1-songmuchun@bytedance.com> References: <20210914072938.6440-1-songmuchun@bytedance.com> MIME-Version: 1.0 Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=UmoEkfxC; spf=pass (imf14.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.216.49 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 957D36001983 X-Stat-Signature: cy1ezmfcyzx9ig7p6tema4jmw8yq6pzt X-HE-Tag: 1631604884-531622 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 inode allocation is supposed to use alloc_inode_sb(), so convert kmem_cache_alloc() to alloc_inode_sb(). Signed-off-by: Muchun Song --- fs/befs/linuxvfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/befs/linuxvfs.c b/fs/befs/linuxvfs.c index c1ba13d19024..b4b3567ac655 100644 --- a/fs/befs/linuxvfs.c +++ b/fs/befs/linuxvfs.c @@ -277,7 +277,7 @@ befs_alloc_inode(struct super_block *sb) { struct befs_inode_info *bi; - bi = kmem_cache_alloc(befs_inode_cachep, GFP_KERNEL); + bi = alloc_inode_sb(sb, befs_inode_cachep, GFP_KERNEL); if (!bi) return NULL; return &bi->vfs_inode; From patchwork Tue Sep 14 07:28:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12491997 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_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 4539EC433F5 for ; Tue, 14 Sep 2021 07:34:53 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E257F6113E for ; Tue, 14 Sep 2021 07:34:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org E257F6113E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 85E296B006C; Tue, 14 Sep 2021 03:34:52 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 80E3694000F; Tue, 14 Sep 2021 03:34:52 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6D5AC94000E; Tue, 14 Sep 2021 03:34:52 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0235.hostedemail.com [216.40.44.235]) by kanga.kvack.org (Postfix) with ESMTP id 60D806B006C for ; Tue, 14 Sep 2021 03:34:52 -0400 (EDT) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 1EF168249980 for ; Tue, 14 Sep 2021 07:34:52 +0000 (UTC) X-FDA: 78585367224.19.B39F128 Received: from mail-pg1-f176.google.com (mail-pg1-f176.google.com [209.85.215.176]) by imf12.hostedemail.com (Postfix) with ESMTP id E3413100009D for ; Tue, 14 Sep 2021 07:34:51 +0000 (UTC) Received: by mail-pg1-f176.google.com with SMTP id f129so11931982pgc.1 for ; Tue, 14 Sep 2021 00:34:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=KjWc96NEUs6s7TrF4a34Zjvbmk/0I5a9KuSsKKY3wE0=; b=LSRVxigR9TV6L4sW0giLifD3wXvbbKTZJtKARiLKQQ87hPDTntWnpQWvgk/EDgH1QK y11hFiCRcoQ8N9dbJPCY1PcS3wFBxFLm8stjmvNXUERO3mkQZBzZrHBApNEQ+F3kkqqc avKHlPNvPyrFe1WTpOQHaSyqBBb1i+h9YSSkR6k4qKLFi8tbW4WNbXGIwGBGdBcpYv0I twJ+REaIoFw6hO8SgePsjYrR6ls0q/6l60h2jsGVamrP/M8MkGgdXRq0quiDnnmO0LQd O4tyfLiklmavjZgJ21b0VEJP9zZsCF60WQhmn3cxKMdpmoLeGHkCywP0uccxCkGC2hM/ d9cA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=KjWc96NEUs6s7TrF4a34Zjvbmk/0I5a9KuSsKKY3wE0=; b=SWu+2YI3Jae/4HZ8qCKL6oS2bdAZbSCuS5Vu9+LinbZaACCPY2TydeIMbdVpMa9Er+ daWEG+t6GJvLUYREaNPR2jjPvE7fsEjo11mcpUJ48DcutZE/QNtsM02eKWwmj7U2P7Vk wrRcd6d1eaMyMawiIN3TfByjY98KtbO7PjCsZzoGwXfJ89icg18uhaktxPCqG5EYJEv3 1x2QTA/u49ed1fg+ZimtfzRoAv6AE//zwTM7JdOCtHLiTqTdyCjFroW8OwMzyqFW4UFK z9X5A07qi/TlpdrEzfrEMLT/mAz+gsn9lI1Tt6x43vemOXa564mo4T1jeyQ02ukEwlZM sTuQ== X-Gm-Message-State: AOAM532uqq4AJogLDVyHEWjn8uqx4Vbvlan4CBcF8IL5BO2zE7O6OQ+A 9RcePGcZ4P7HwWCTvT71EW6GTQ== X-Google-Smtp-Source: ABdhPJxg86ESorqNYMXvCUenUrVaUzZd3b3PjzqVkJtZLoGKUDeAaasbk6Ch1PlreCRMxdscS5OpQQ== X-Received: by 2002:a05:6a00:1147:b029:3e0:8c37:938e with SMTP id b7-20020a056a001147b02903e08c37938emr3315273pfm.65.1631604891102; Tue, 14 Sep 2021 00:34:51 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.244]) by smtp.gmail.com with ESMTPSA id s3sm9377839pfd.188.2021.09.14.00.34.44 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Sep 2021 00:34:50 -0700 (PDT) From: Muchun Song To: willy@infradead.org, akpm@linux-foundation.org, hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, shakeelb@google.com, guro@fb.com, shy828301@gmail.com, alexs@kernel.org, richard.weiyang@gmail.com, david@fromorbit.com, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, zhengqi.arch@bytedance.com, duanxiongchun@bytedance.com, fam.zheng@bytedance.com, smuchun@gmail.com, Muchun Song Subject: [PATCH v3 16/76] bfs: allocate inode by using alloc_inode_sb() Date: Tue, 14 Sep 2021 15:28:38 +0800 Message-Id: <20210914072938.6440-17-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20210914072938.6440-1-songmuchun@bytedance.com> References: <20210914072938.6440-1-songmuchun@bytedance.com> MIME-Version: 1.0 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: E3413100009D X-Stat-Signature: t7forxturw6jkxy43rtscrbsdfosgjcb Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=LSRVxigR; spf=pass (imf12.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.215.176 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com X-HE-Tag: 1631604891-722426 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 inode allocation is supposed to use alloc_inode_sb(), so convert kmem_cache_alloc() to alloc_inode_sb(). Signed-off-by: Muchun Song --- fs/bfs/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/bfs/inode.c b/fs/bfs/inode.c index fd691e4815c5..1926bec2c850 100644 --- a/fs/bfs/inode.c +++ b/fs/bfs/inode.c @@ -239,7 +239,7 @@ static struct kmem_cache *bfs_inode_cachep; static struct inode *bfs_alloc_inode(struct super_block *sb) { struct bfs_inode_info *bi; - bi = kmem_cache_alloc(bfs_inode_cachep, GFP_KERNEL); + bi = alloc_inode_sb(sb, bfs_inode_cachep, GFP_KERNEL); if (!bi) return NULL; return &bi->vfs_inode; From patchwork Tue Sep 14 07:28:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12492001 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_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 626F7C433EF for ; Tue, 14 Sep 2021 07:35:00 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 1989761029 for ; Tue, 14 Sep 2021 07:35:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 1989761029 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id B44366B0074; Tue, 14 Sep 2021 03:34:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AF38594000F; Tue, 14 Sep 2021 03:34:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9E2B16B0078; Tue, 14 Sep 2021 03:34:59 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0176.hostedemail.com [216.40.44.176]) by kanga.kvack.org (Postfix) with ESMTP id 9071A6B0074 for ; Tue, 14 Sep 2021 03:34:59 -0400 (EDT) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 5AF66181355D3 for ; Tue, 14 Sep 2021 07:34:59 +0000 (UTC) X-FDA: 78585367518.22.E3AC072 Received: from mail-pl1-f176.google.com (mail-pl1-f176.google.com [209.85.214.176]) by imf07.hostedemail.com (Postfix) with ESMTP id DE90510000A7 for ; Tue, 14 Sep 2021 07:34:58 +0000 (UTC) Received: by mail-pl1-f176.google.com with SMTP id c4so6046607pls.6 for ; Tue, 14 Sep 2021 00:34:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Ngaq8HeXVg0bDvfdB7FNpFgH1Z9L4n9AUAaT+A4ybEY=; b=TxlM/LNag+9j+pHHnzYxUIcqTnlG8CAktsmrXO0thXlgjt/0xKpEydfDbhVIhyLlSb 8yaYLg0UVhsiS0IwI3D60wScJOYPe1zGXz1U4suUJ+i/6kRKVhMTFdS8ckWexTA4EE8h QEQyxDPXEneT65b4sX+iNOkGENj27L7Kwcfw3Y/ZG6i4O76WdoUR05MkcXlpMHaATepI 4bx70VoM3TP7FMg4DKmNTasIjpr6AutJjLhrZtyNJyGSIDlLVAovGaPfa/HNI2TpR4Ae bQbYTzgj4IThGaUi5gXbrxK+V+eg2xuZdXHAOCxucXaqXGVpbLtTzUvJmXX4EK4DfMmn xE/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Ngaq8HeXVg0bDvfdB7FNpFgH1Z9L4n9AUAaT+A4ybEY=; b=t3PzcC+PdCe7rFFAOJl2ke7CtOwpv1s5j25SfgcChbK2fzdvJEZ+E2mPKWiLgTrpA9 kZs1axOKtfvx7MBFc/nGM5akdLh5rlu6gU9Gd1iupvivibnkiXJ1amksjoQiQVNdqHQn htYgtFAalLFGgk71dqnEnwTA3IpN/bNCpCESpKAMkf3BoYOFJ4rIJabeRNp/cSv2RD9E nFvbMLRUFDbMm3Du68CjouwxrDEQqp1zf6twHfrYPc0xf9mhCFMm2OqO7CliQLBFoW51 i5kUZcquiejwNuirBlAmkqpP4jyFNJ/+FxbfOA67YE/8XthmACFY6JurTuKoLn9GMlvX ao+g== X-Gm-Message-State: AOAM533JCvl7Fl/R0R2zlfnVMCtz7CGnoSBG73NKI2ti0DJPNKAZC2BK VIzQLLAt0GOEerxCoTIb/GWOqA== X-Google-Smtp-Source: ABdhPJyCiB4o0BV2SmG7F/g3um9IpNXO0UQAa8xTk2H4jdGoOJfauoZeyXj54vI3CCV0Vr4LlpBBNA== X-Received: by 2002:a17:90a:bd08:: with SMTP id y8mr523956pjr.123.1631604898107; Tue, 14 Sep 2021 00:34:58 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.244]) by smtp.gmail.com with ESMTPSA id s3sm9377839pfd.188.2021.09.14.00.34.51 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Sep 2021 00:34:57 -0700 (PDT) From: Muchun Song To: willy@infradead.org, akpm@linux-foundation.org, hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, shakeelb@google.com, guro@fb.com, shy828301@gmail.com, alexs@kernel.org, richard.weiyang@gmail.com, david@fromorbit.com, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, zhengqi.arch@bytedance.com, duanxiongchun@bytedance.com, fam.zheng@bytedance.com, smuchun@gmail.com, Muchun Song Subject: [PATCH v3 17/76] block: allocate inode by using alloc_inode_sb() Date: Tue, 14 Sep 2021 15:28:39 +0800 Message-Id: <20210914072938.6440-18-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20210914072938.6440-1-songmuchun@bytedance.com> References: <20210914072938.6440-1-songmuchun@bytedance.com> MIME-Version: 1.0 X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: DE90510000A7 X-Stat-Signature: kqqbgq1ikmtfhnh4r957kh9dcngzc68z Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b="TxlM/LNa"; spf=pass (imf07.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.214.176 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com X-HE-Tag: 1631604898-18266 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 inode allocation is supposed to use alloc_inode_sb(), so convert kmem_cache_alloc() to alloc_inode_sb(). Signed-off-by: Muchun Song --- fs/block_dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/block_dev.c b/fs/block_dev.c index 45df6cbccf12..1630458b3e98 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c @@ -799,7 +799,7 @@ static struct kmem_cache * bdev_cachep __read_mostly; static struct inode *bdev_alloc_inode(struct super_block *sb) { - struct bdev_inode *ei = kmem_cache_alloc(bdev_cachep, GFP_KERNEL); + struct bdev_inode *ei = alloc_inode_sb(sb, bdev_cachep, GFP_KERNEL); if (!ei) return NULL; From patchwork Tue Sep 14 07:28:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12492003 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_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 9D1B6C433F5 for ; Tue, 14 Sep 2021 07:35:07 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 4DB7161056 for ; Tue, 14 Sep 2021 07:35:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 4DB7161056 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id E52C694000B; Tue, 14 Sep 2021 03:35:06 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E03C594000A; Tue, 14 Sep 2021 03:35:06 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CF06394000B; Tue, 14 Sep 2021 03:35:06 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0096.hostedemail.com [216.40.44.96]) by kanga.kvack.org (Postfix) with ESMTP id BF71894000A for ; Tue, 14 Sep 2021 03:35:06 -0400 (EDT) Received: from smtpin12.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 7EF992D019 for ; Tue, 14 Sep 2021 07:35:06 +0000 (UTC) X-FDA: 78585367812.12.33355C4 Received: from mail-pf1-f174.google.com (mail-pf1-f174.google.com [209.85.210.174]) by imf20.hostedemail.com (Postfix) with ESMTP id 41B73D0000A2 for ; Tue, 14 Sep 2021 07:35:06 +0000 (UTC) Received: by mail-pf1-f174.google.com with SMTP id w19so6949273pfn.12 for ; Tue, 14 Sep 2021 00:35:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=NEq7kq9SMuUgC1IARLEvXImMtR13fBngVunARmKnk64=; b=jdEgYeufa0xbSpy6pjyVs9HuLGulGqxzZuIYgEqVO2w4wlElT/nX2QSJGpfUXrmti3 ZB6EAatU3qFhGYvzY1BqWJIhxP7gTNlcabnbgUTn6I/EUwBBE6AjKZ/yeiZaSeVYJWQW PmXXJibSqLnbKfyKCxabpe3LV/Ya76OwPAy/zNF9K10LwjeBZr2jX+hRflJ+hSxXWVap DXrHNLKRe3vSam6AK1REtimYudoSqEYzpT5uA9+luOEN+y5aQFtwE7bw2GEKZn5MEAbg bA63vq1JfLcpxDtbwKD5httYxYPc6iH7S6Jkec/s2K2MA7AJNtDpBBmVvRqdaeyNZK8A ta0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=NEq7kq9SMuUgC1IARLEvXImMtR13fBngVunARmKnk64=; b=2jUTuh7Q7Y31VsB8BffSsa1tW0RFcGGd7o9F3nPSNSQ06JYpS/yrnX9j3NwOss0YW3 X0w+oh4PB7KTpNbAHjF+fyGmOFicvQ6ahea678l9sJ3bV7tvi/aEAzbie7cOZXAqsXyy r/EqbZG7ZEoT8FE/eoCt3hKM3BrU5Ljz4l5t4XeqZKIU04rIiQpziaOyVlJ6NbxbnqOW V3TP4Vng7RzqvQ/j5rJPDJCoyUpKwd4CIkGxw+p8tAuS/6chF+3ijpKJ2az9hfYRjo8d uiVkJV72AaeQH6E7ToUbhcXet17T2t3eAiEYT7pTpAx4MbouMdkgty+zHZUuKc3Sy2Nj wAIw== X-Gm-Message-State: AOAM533EzaLKUpM5rPeHo6SFmaZ6l5qG+7grlJ7zaGivew3OgvOEKzww l70v0vozRyjZ9bKlh0vUqz9sSw== X-Google-Smtp-Source: ABdhPJxOJCHtnx+WYbnA/IFmqdKOE7ty3oRk48gVLvlyEJf6F0MqheJB8RWJqz+q7QxmFlxo83mpug== X-Received: by 2002:a63:7454:: with SMTP id e20mr14236260pgn.136.1631604905477; Tue, 14 Sep 2021 00:35:05 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.244]) by smtp.gmail.com with ESMTPSA id s3sm9377839pfd.188.2021.09.14.00.34.58 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Sep 2021 00:35:05 -0700 (PDT) From: Muchun Song To: willy@infradead.org, akpm@linux-foundation.org, hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, shakeelb@google.com, guro@fb.com, shy828301@gmail.com, alexs@kernel.org, richard.weiyang@gmail.com, david@fromorbit.com, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, zhengqi.arch@bytedance.com, duanxiongchun@bytedance.com, fam.zheng@bytedance.com, smuchun@gmail.com, Muchun Song Subject: [PATCH v3 18/76] btrfs: allocate inode by using alloc_inode_sb() Date: Tue, 14 Sep 2021 15:28:40 +0800 Message-Id: <20210914072938.6440-19-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20210914072938.6440-1-songmuchun@bytedance.com> References: <20210914072938.6440-1-songmuchun@bytedance.com> MIME-Version: 1.0 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 41B73D0000A2 X-Stat-Signature: 1ixxnwgxsxmnw6ikhebx8u5kozhie9w7 Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=jdEgYeuf; spf=pass (imf20.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.210.174 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com X-HE-Tag: 1631604906-462583 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 inode allocation is supposed to use alloc_inode_sb(), so convert kmem_cache_alloc() to alloc_inode_sb(). Signed-off-by: Muchun Song --- fs/btrfs/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 487533c35ddb..f98fbe2ff212 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -9072,7 +9072,7 @@ struct inode *btrfs_alloc_inode(struct super_block *sb) struct btrfs_inode *ei; struct inode *inode; - ei = kmem_cache_alloc(btrfs_inode_cachep, GFP_KERNEL); + ei = alloc_inode_sb(sb, btrfs_inode_cachep, GFP_KERNEL); if (!ei) return NULL; From patchwork Tue Sep 14 07:28:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12492005 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_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 7D66AC433EF for ; Tue, 14 Sep 2021 07:35:14 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 24D2661056 for ; Tue, 14 Sep 2021 07:35:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 24D2661056 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id C080E6B006C; Tue, 14 Sep 2021 03:35:13 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BB87194000A; Tue, 14 Sep 2021 03:35:13 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A7F156B0073; Tue, 14 Sep 2021 03:35:13 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0075.hostedemail.com [216.40.44.75]) by kanga.kvack.org (Postfix) with ESMTP id 992456B006C for ; Tue, 14 Sep 2021 03:35:13 -0400 (EDT) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 698F52D223 for ; Tue, 14 Sep 2021 07:35:13 +0000 (UTC) X-FDA: 78585368106.17.3FCFDAF Received: from mail-pf1-f176.google.com (mail-pf1-f176.google.com [209.85.210.176]) by imf17.hostedemail.com (Postfix) with ESMTP id 2F36BF00038C for ; Tue, 14 Sep 2021 07:35:13 +0000 (UTC) Received: by mail-pf1-f176.google.com with SMTP id e16so11345156pfc.6 for ; Tue, 14 Sep 2021 00:35:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=xmWs76ejJuWUw+NjSJEHDOglMzK6H3Rus8uSh5Y2LOI=; b=JDksD2X5hYyqveT44345REs/WzN6DpsF4haKOhQxw+stDMw1hW9W15EKVpprv4NkjO bGMz0nu4jvtK0ts1snJJN6W6+XK/9N9FHCz6ox/vwNR2JhGWnzGn0P0LYYSElIxQBFPz 51MvliAcWVYcS+9YzCLetuAbutjav05WDWsS3qx852Ph1em7cIZj71+SCJfHKulx+z1U hVO+SdaZo9H80GydN6uL2xOToXA0yj9bNcHXqEs3qQdN696bPkmizb/XpTdgsur4623a t2Vj6nvM/q9BQz4JtMNGsNdm0GNNA30aRJTIpdfUYghZjJjOFgMkGQ7n/p1iBqJoHzSW VWeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=xmWs76ejJuWUw+NjSJEHDOglMzK6H3Rus8uSh5Y2LOI=; b=oZgvc6fAmD24BR82lo5Ef76hw6oXc3i/XOG9vdrajktquJz5KbOzgKOF3QZ9/o2x3P i81goCY614cU1dJ77nLP0hB8eS3ua81FOz0FnM3/2EMTCM+29WcpAMQ908OYsAoMJ588 gFAhCgO0GMakODtaSUcV5tzIb5hAIRtBs3OUNg3am8HSTGy8+9BvS4uCODzHnDSZongK 6yiJWeSCXauUOADjjpkBeVqibS0xKaIcnvGXQ59d0WYtZDMpDqlMQcM7091muPjmnVFb ACD1M+jEojDqjLUSPx8UuDGH0UlFJQw/ZpO5KL3c20Mn5BGbEPHCHCCv86OqCrT7bhFT X8EA== X-Gm-Message-State: AOAM531fW1h3d85Yc1XGkjdrV9jai9gzYWVaMfxcpIOy6C1NxkBCgGpe Vor+GQM/PE79VUieBlm+7mQP9w== X-Google-Smtp-Source: ABdhPJzTOnQngqhMuN6LTM4la+nLf6iQUU7SFedtJ54Vh2B0sOh1eoF37FRLMSQs2nF2EZ3GfRKUQQ== X-Received: by 2002:a62:6103:0:b0:405:2c7a:9ee9 with SMTP id v3-20020a626103000000b004052c7a9ee9mr3457664pfb.71.1631604912429; Tue, 14 Sep 2021 00:35:12 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.244]) by smtp.gmail.com with ESMTPSA id s3sm9377839pfd.188.2021.09.14.00.35.05 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Sep 2021 00:35:12 -0700 (PDT) From: Muchun Song To: willy@infradead.org, akpm@linux-foundation.org, hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, shakeelb@google.com, guro@fb.com, shy828301@gmail.com, alexs@kernel.org, richard.weiyang@gmail.com, david@fromorbit.com, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, zhengqi.arch@bytedance.com, duanxiongchun@bytedance.com, fam.zheng@bytedance.com, smuchun@gmail.com, Muchun Song Subject: [PATCH v3 19/76] ceph: allocate inode by using alloc_inode_sb() Date: Tue, 14 Sep 2021 15:28:41 +0800 Message-Id: <20210914072938.6440-20-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20210914072938.6440-1-songmuchun@bytedance.com> References: <20210914072938.6440-1-songmuchun@bytedance.com> MIME-Version: 1.0 Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=JDksD2X5; spf=pass (imf17.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.210.176 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com X-Stat-Signature: 4374w8j3wiy3845kfndbfuw47i1zaspx X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 2F36BF00038C X-HE-Tag: 1631604913-276189 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 inode allocation is supposed to use alloc_inode_sb(), so convert kmem_cache_alloc() to alloc_inode_sb(). Signed-off-by: Muchun Song --- fs/ceph/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c index 2df1e1284451..96239d209bec 100644 --- a/fs/ceph/inode.c +++ b/fs/ceph/inode.c @@ -447,7 +447,7 @@ struct inode *ceph_alloc_inode(struct super_block *sb) struct ceph_inode_info *ci; int i; - ci = kmem_cache_alloc(ceph_inode_cachep, GFP_NOFS); + ci = alloc_inode_sb(sb, ceph_inode_cachep, GFP_NOFS); if (!ci) return NULL; From patchwork Tue Sep 14 07:28:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12492007 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_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 D3492C433F5 for ; Tue, 14 Sep 2021 07:35:21 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 867F160F4A for ; Tue, 14 Sep 2021 07:35:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 867F160F4A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 3545F900003; Tue, 14 Sep 2021 03:35:21 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 30436900002; Tue, 14 Sep 2021 03:35:21 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1F357900003; Tue, 14 Sep 2021 03:35:21 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0229.hostedemail.com [216.40.44.229]) by kanga.kvack.org (Postfix) with ESMTP id 12A30900002 for ; Tue, 14 Sep 2021 03:35:21 -0400 (EDT) Received: from smtpin38.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id CB786180889BC for ; Tue, 14 Sep 2021 07:35:20 +0000 (UTC) X-FDA: 78585368400.38.2C28C3F Received: from mail-pf1-f175.google.com (mail-pf1-f175.google.com [209.85.210.175]) by imf12.hostedemail.com (Postfix) with ESMTP id 8D73010000A8 for ; Tue, 14 Sep 2021 07:35:20 +0000 (UTC) Received: by mail-pf1-f175.google.com with SMTP id v123so11329285pfb.11 for ; Tue, 14 Sep 2021 00:35:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=EeEIfsET3veEFyKZGMdqrIC7SmUJrf9uv2HTbxew7HM=; b=SV6JN5iimQBXUfCre6VlL7Lj4UTOZ7hKT3qLd58hiOph3ZbO9ARv9uURoQiK3OcGgB yOc8X2dDszH+dDEB5L+utQ8J22OjjM+CxD43vuPjMUSjhRUYCs/UVHUDRMLX0TKxkXTV wRffWVFQMVrkCpgaY2u6OSSNmvVc1VzQ1yr7ETOJ7dnQRYYK1ptqu+icFkFqkKSSazWN 9oMcAcxrlXngjdZNFb/NncCXBi1ofb+fhVOFqxYxbzEBkoFsxX+Q0Cka16YxapTti6g6 iC0MQdrk9x7ZbQNKn1GL6k1TfYNbvGn9YGclVnI5ZSqRnX+SMjwZv7WqqRVZsyoDNEdK I9zg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=EeEIfsET3veEFyKZGMdqrIC7SmUJrf9uv2HTbxew7HM=; b=BAZcxF1MCvD7KV2dK3SQ6R4FOK7EOpVOjkoichEX6XcAYN/Fwq7eCZRDWhRz5cr1Q2 VE0hWy1Kp35Ucpul3JiE5YyrLqrxYWE55w2U/yLjmjvT0OQ0AJ9ywMacQOf9tD3WUKFo OpMcaNGSoA14f0ljJp7YX87zMGrJfZ2L3cZSssAxTGhXHoXcAA1hNiGYCp4Z2LJuDi2k +dhVeWRKjRl5rnd9W8oQ2/nBIqHRAqJejv8bVlk8zhpA0Dv/i0xlmjIzjesdOdcCgMzb oCEXoWMqnfjo675eLfX4LiZfFsk4MeezSamIqz30KWlUzDEfeG2UoMvta5FTCscmc//d YzWQ== X-Gm-Message-State: AOAM5326XH6SnwIPLHAqn4plugzQg2250n9be7vomwZvnvsBytNyIhgZ bxC0vkvCgN0xnCuPETjDGUxjww== X-Google-Smtp-Source: ABdhPJzJ3stl+34/hU2kXHce6y3rv3WtN0uv6gcgVBj8T8YLnolCz18rqWf5mghFAUOHHszaMxmR9A== X-Received: by 2002:a05:6a00:a23:b0:43d:e856:a3d4 with SMTP id p35-20020a056a000a2300b0043de856a3d4mr3381701pfh.17.1631604919762; Tue, 14 Sep 2021 00:35:19 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.244]) by smtp.gmail.com with ESMTPSA id s3sm9377839pfd.188.2021.09.14.00.35.12 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Sep 2021 00:35:19 -0700 (PDT) From: Muchun Song To: willy@infradead.org, akpm@linux-foundation.org, hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, shakeelb@google.com, guro@fb.com, shy828301@gmail.com, alexs@kernel.org, richard.weiyang@gmail.com, david@fromorbit.com, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, zhengqi.arch@bytedance.com, duanxiongchun@bytedance.com, fam.zheng@bytedance.com, smuchun@gmail.com, Muchun Song Subject: [PATCH v3 20/76] cifs: allocate inode by using alloc_inode_sb() Date: Tue, 14 Sep 2021 15:28:42 +0800 Message-Id: <20210914072938.6440-21-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20210914072938.6440-1-songmuchun@bytedance.com> References: <20210914072938.6440-1-songmuchun@bytedance.com> MIME-Version: 1.0 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 8D73010000A8 X-Stat-Signature: 79anggexiug34kf1mm891ai73a1uuijj Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=SV6JN5ii; spf=pass (imf12.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.210.175 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com X-HE-Tag: 1631604920-122135 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 inode allocation is supposed to use alloc_inode_sb(), so convert kmem_cache_alloc() to alloc_inode_sb(). Signed-off-by: Muchun Song --- fs/cifs/cifsfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c index 8c20bfa187ac..7c239ba551b9 100644 --- a/fs/cifs/cifsfs.c +++ b/fs/cifs/cifsfs.c @@ -355,7 +355,7 @@ static struct inode * cifs_alloc_inode(struct super_block *sb) { struct cifsInodeInfo *cifs_inode; - cifs_inode = kmem_cache_alloc(cifs_inode_cachep, GFP_KERNEL); + cifs_inode = alloc_inode_sb(sb, cifs_inode_cachep, GFP_KERNEL); if (!cifs_inode) return NULL; cifs_inode->cifsAttrs = 0x20; /* default */ From patchwork Tue Sep 14 07:28:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12492009 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_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 97101C433FE for ; Tue, 14 Sep 2021 07:35:28 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 49F3A60F4A for ; Tue, 14 Sep 2021 07:35:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 49F3A60F4A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id E7823900002; Tue, 14 Sep 2021 03:35:27 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E008F940007; Tue, 14 Sep 2021 03:35:27 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CA17D900004; Tue, 14 Sep 2021 03:35:27 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0102.hostedemail.com [216.40.44.102]) by kanga.kvack.org (Postfix) with ESMTP id B4C59900002 for ; Tue, 14 Sep 2021 03:35:27 -0400 (EDT) Received: from smtpin15.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 73C118249980 for ; Tue, 14 Sep 2021 07:35:27 +0000 (UTC) X-FDA: 78585368694.15.52F80E0 Received: from mail-pj1-f45.google.com (mail-pj1-f45.google.com [209.85.216.45]) by imf12.hostedemail.com (Postfix) with ESMTP id 3A7DE10000A0 for ; Tue, 14 Sep 2021 07:35:27 +0000 (UTC) Received: by mail-pj1-f45.google.com with SMTP id n13-20020a17090a4e0d00b0017946980d8dso1434644pjh.5 for ; Tue, 14 Sep 2021 00:35:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Yn4GjbGKOalkp7KyXghKb9kUqc+WdE7xPBBNtSw49kg=; b=npB+pVn/vbn0eNYwtlSthJv7NBkOrOYMdLVzNAnEHX0BsO73iZoa66jGaFaG5addC0 cgJiTpm3Pv92k7hEjsZ05n4vWim9yUjZaflyMTHnB+SIxMH42+iuoY6FtWyfDm6T6uZM /SvJYTj0xZW4myvwa7ToEcgOpprF6LR7VMWYknvR26p0Qu6ZqxtY5e15cZta8W3aeblP Pu8Gyt1UcMCae2DKj9uC8co129TdSbpSUsUFBHsAv3ASerGOo92IyrNVp7P5ai0EDton KJkkOJDmM35KKrYqDrF7k790Srij5c5bn1mgnYI3eLrodF7RbhmMbZFUPZCbau4exCN+ lHWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Yn4GjbGKOalkp7KyXghKb9kUqc+WdE7xPBBNtSw49kg=; b=jnKTnBpncFuJYqCyQBIZFGArzcoRCppAgYF5XkclIsVlN7lSK/pjU6eFiJ0eOfdjXB /Bs1+ubSHBfWgpjz2zOc1InEJ1M/Agl9Aa6ajZHplEQacx0OjYD66MJS7GcpRtV+SxZZ l4UUDuFv5WU4hOzD4LDWQAMFftx7kegss91USSU3jeiEu1wRm9+rFdtEL16s8ZAW2VQg nU83CQfZEhebSa6PZvEvT5G0clJS6xkQ9HNqGVerMDM1/f7RrrCIGRSfSeAMAl7FmWBY c5bCOVLzXembKRxLXBCuH9pYh9dOcsb/s0p66Ege+KGsiRCqpnLzOJY3nVcupiGHjw5Z K2Mw== X-Gm-Message-State: AOAM533Tf+qKAJw73p5BoymPy6XYQbYR9XI4vVyR8Mj6597ZSrfyEr/o FWxLvQsOjZxD7Otm/LhGC+wUTQ== X-Google-Smtp-Source: ABdhPJxy4IufRBKzjD8wBmIhR6AaKyadsNj889rMyLOVXLMf+K5MDbdlRVSNpKLlmHyPRl+ICj25uQ== X-Received: by 2002:a17:90b:1bcf:: with SMTP id oa15mr479092pjb.58.1631604926427; Tue, 14 Sep 2021 00:35:26 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.244]) by smtp.gmail.com with ESMTPSA id s3sm9377839pfd.188.2021.09.14.00.35.20 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Sep 2021 00:35:26 -0700 (PDT) From: Muchun Song To: willy@infradead.org, akpm@linux-foundation.org, hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, shakeelb@google.com, guro@fb.com, shy828301@gmail.com, alexs@kernel.org, richard.weiyang@gmail.com, david@fromorbit.com, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, zhengqi.arch@bytedance.com, duanxiongchun@bytedance.com, fam.zheng@bytedance.com, smuchun@gmail.com, Muchun Song Subject: [PATCH v3 21/76] coda: allocate inode by using alloc_inode_sb() Date: Tue, 14 Sep 2021 15:28:43 +0800 Message-Id: <20210914072938.6440-22-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20210914072938.6440-1-songmuchun@bytedance.com> References: <20210914072938.6440-1-songmuchun@bytedance.com> MIME-Version: 1.0 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 3A7DE10000A0 X-Stat-Signature: x4w7cz1yaj8w7u66wh4mtbdk9jgwgrxy Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b="npB+pVn/"; spf=pass (imf12.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.216.45 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com X-HE-Tag: 1631604927-317680 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 inode allocation is supposed to use alloc_inode_sb(), so convert kmem_cache_alloc() to alloc_inode_sb(). Signed-off-by: Muchun Song --- fs/coda/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/coda/inode.c b/fs/coda/inode.c index d9f1bd7153df..2185328b65c7 100644 --- a/fs/coda/inode.c +++ b/fs/coda/inode.c @@ -43,7 +43,7 @@ static struct kmem_cache * coda_inode_cachep; static struct inode *coda_alloc_inode(struct super_block *sb) { struct coda_inode_info *ei; - ei = kmem_cache_alloc(coda_inode_cachep, GFP_KERNEL); + ei = alloc_inode_sb(sb, coda_inode_cachep, GFP_KERNEL); if (!ei) return NULL; memset(&ei->c_fid, 0, sizeof(struct CodaFid)); From patchwork Tue Sep 14 07:28:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12492011 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_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 A9917C433EF for ; Tue, 14 Sep 2021 07:35:35 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 5C07E61029 for ; Tue, 14 Sep 2021 07:35:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 5C07E61029 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id E9FF794000A; Tue, 14 Sep 2021 03:35:34 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E27B5940007; Tue, 14 Sep 2021 03:35:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CC90A94000A; Tue, 14 Sep 2021 03:35:34 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0143.hostedemail.com [216.40.44.143]) by kanga.kvack.org (Postfix) with ESMTP id B65D8940007 for ; Tue, 14 Sep 2021 03:35:34 -0400 (EDT) Received: from smtpin29.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 79823181A0D9D for ; Tue, 14 Sep 2021 07:35:34 +0000 (UTC) X-FDA: 78585368988.29.F363A3D Received: from mail-pg1-f172.google.com (mail-pg1-f172.google.com [209.85.215.172]) by imf10.hostedemail.com (Postfix) with ESMTP id 3305A6001986 for ; Tue, 14 Sep 2021 07:35:34 +0000 (UTC) Received: by mail-pg1-f172.google.com with SMTP id q68so11917433pga.9 for ; Tue, 14 Sep 2021 00:35:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=70dZb4sygyL4z0x1TtZhkqlyiFHEDmdlI4RF8O+Vt1A=; b=zJXxJLj4ESHJp25Po9c+bepEEQGcRbSFaDV2ROX2AMMoOoCP9TQExmc64Im8VFxp5B MUbQMCkQxxxkYmZCMzfBk6z8KLOFhOhku7W9pC0lFQPcLJ1LnGL4cdd+u1XWHfqEKaB3 M/X9zlmNtovkUWmhhmvxlhBvO4p6EWob+U3epYvIHJD1ZJdbV+P1jW99NMGCAhMDPZnf NO+s0pwOoHRfDHA6amvhUyJItcpPPx/tURrq9o0lysXBBNnhuKjiPxZ2VUdVk3AO5I4B Ykd1TfvSaYv1qtzADmeKpO6qgYm9J5Wty1ohHvctCi6EFvSx5zps2XBMXfVs0cxgiR9t 5CFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=70dZb4sygyL4z0x1TtZhkqlyiFHEDmdlI4RF8O+Vt1A=; b=rnyZD3XCLiMuhsGxHmOsFlnee293e4mvTrZf8uorASXglK/GFKDUrRjvMuQ7vB6Ynm zvzcESzg8WinLhkuCIhIGbVJl97WjMUe0drZHu+b8SzBV9XAhJFfwnmoRObxjfU/FF2+ q+cBtJBPgHVEofRP4McM+LLCTCXZ01J3GkfdEOh0IwJYmlu1Sd//yZLlkym+ybm+xllx D+D+b22MvOymUuOOAGb75hqFbB+v7bg7lZKPd8JVzcFwiRN8g1M7gs4OuXeKfnoprG5X ALAi7wbG453h4kFT0U+Md8PyjQ9/uM9teWtk03CMx1Uv37kptI1qXWdLS2lS901i9lI2 1zdA== X-Gm-Message-State: AOAM533N7L1gSXajPRVCLjnHGhPB/SVusOhFzTEnop93Up3HARZn3U3X U2Kw0LX6OzDl6Q61vO0A6rvSFg== X-Google-Smtp-Source: ABdhPJwGydjmVciK31lObC1YoqbXvngbtFM+HXY2vjQE8P9Ine0QM594NQCVdnzHC2NEtuckQpjmzA== X-Received: by 2002:a05:6a00:21c7:b0:412:bb0b:850d with SMTP id t7-20020a056a0021c700b00412bb0b850dmr3476534pfj.33.1631604933364; Tue, 14 Sep 2021 00:35:33 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.244]) by smtp.gmail.com with ESMTPSA id s3sm9377839pfd.188.2021.09.14.00.35.26 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Sep 2021 00:35:33 -0700 (PDT) From: Muchun Song To: willy@infradead.org, akpm@linux-foundation.org, hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, shakeelb@google.com, guro@fb.com, shy828301@gmail.com, alexs@kernel.org, richard.weiyang@gmail.com, david@fromorbit.com, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, zhengqi.arch@bytedance.com, duanxiongchun@bytedance.com, fam.zheng@bytedance.com, smuchun@gmail.com, Muchun Song Subject: [PATCH v3 22/76] ecryptfs: allocate inode by using alloc_inode_sb() Date: Tue, 14 Sep 2021 15:28:44 +0800 Message-Id: <20210914072938.6440-23-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20210914072938.6440-1-songmuchun@bytedance.com> References: <20210914072938.6440-1-songmuchun@bytedance.com> MIME-Version: 1.0 X-Stat-Signature: icj59usseiggn6az9844in46pxr8g5tn Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=zJXxJLj4; dmarc=pass (policy=none) header.from=bytedance.com; spf=pass (imf10.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.215.172 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 3305A6001986 X-HE-Tag: 1631604934-801190 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 inode allocation is supposed to use alloc_inode_sb(), so convert kmem_cache_alloc() to alloc_inode_sb(). Signed-off-by: Muchun Song --- fs/ecryptfs/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ecryptfs/super.c b/fs/ecryptfs/super.c index 39116af0390f..0b1c878317ab 100644 --- a/fs/ecryptfs/super.c +++ b/fs/ecryptfs/super.c @@ -38,7 +38,7 @@ static struct inode *ecryptfs_alloc_inode(struct super_block *sb) struct ecryptfs_inode_info *inode_info; struct inode *inode = NULL; - inode_info = kmem_cache_alloc(ecryptfs_inode_info_cache, GFP_KERNEL); + inode_info = alloc_inode_sb(sb, ecryptfs_inode_info_cache, GFP_KERNEL); if (unlikely(!inode_info)) goto out; if (ecryptfs_init_crypt_stat(&inode_info->crypt_stat)) { From patchwork Tue Sep 14 07:28:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12492013 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_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 7E295C433F5 for ; Tue, 14 Sep 2021 07:35:42 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3123B60F4A for ; Tue, 14 Sep 2021 07:35:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 3123B60F4A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id BDF9494000F; Tue, 14 Sep 2021 03:35:41 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B694C940007; Tue, 14 Sep 2021 03:35:41 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9E30A94000F; Tue, 14 Sep 2021 03:35:41 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0192.hostedemail.com [216.40.44.192]) by kanga.kvack.org (Postfix) with ESMTP id 84FA0940007 for ; Tue, 14 Sep 2021 03:35:41 -0400 (EDT) Received: from smtpin20.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 47B6F180AD83E for ; Tue, 14 Sep 2021 07:35:41 +0000 (UTC) X-FDA: 78585369282.20.365A499 Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) by imf18.hostedemail.com (Postfix) with ESMTP id E2768400208D for ; Tue, 14 Sep 2021 07:35:40 +0000 (UTC) Received: by mail-pl1-f178.google.com with SMTP id o8so4516924pll.1 for ; Tue, 14 Sep 2021 00:35:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=1yuy+HZCggD2Ix0ajnpDnDAqsy20DBm7xFEbRuBADBk=; b=a6sOSaXIPiqPpssIICXEj+A9I0pXX8WW+n0AIX6Qer+S9FzZnNc9/lAKHNJIbqfd98 te5EgnNysJZ/Gr6Tl5XFrvMeKYuVVkXPgxcD7EXX/ZtO9AacuwK6B3gaY7QjTRoBLup3 kwIW63M3ksbtxYT1MvuDNjMjSgPzg8tvmhyN1KG7nGpYatsmj+g1dYMFdWG82EMn72vn pqDbRVLzkzkXknyq3PP5/ajZ0ZIJ1NX4vV/xHPZdUSrDtQ1vSWWjL8oNX/vDZp/V+sLU mditTKgDXUyj39galecQGgd99rKihY8WLCH9Cj4wGtEc8H8d2b1RmTQ80YDr7kfpKZk4 NPvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=1yuy+HZCggD2Ix0ajnpDnDAqsy20DBm7xFEbRuBADBk=; b=Gb29zAiJV64NdvXJnLsD+09+Ec3IIzw/iGtBjEbv1wMN3ZzkQDIHI3mQ+8QXTbiivS +zM/G7VqfRSPY8YzYUHxyZrLwqMCgIU86+2Gvyrn4RljAEElRvVf4D8+WXFAruNiuZC3 whP7Lf6UOYbcThVJRf/QA34uCD/ElKe1KJv7sR1zFpJpS4fAg3Lkgk6RdDEKTsQL+Ux9 sle6LFI0pUevhhudlfX4wCWObMzP+/zKeewddnDLGlsf8qJc8dgJbE15HGUJOztypS+Q 25gu8W0cTGpCSk+pxoBvXG3cnoEZUkiQAVb7IuC0VXO+WE2MtcgWyQSpAzf/w3LHv1T7 Cu8A== X-Gm-Message-State: AOAM533eEnGewXsTGHybGsLhKWbs8W8m5eSQP8uggjFV/ItcTI56PsrM o7IHNAlOd6ZKTTspm1gAJ59+tA== X-Google-Smtp-Source: ABdhPJws7JltmeMv6QYknpPOWEOB65IqgYWjDjVwL8ZJqUCVuwi0tAesPsTpFFDsYdx1IaTXzoHG9Q== X-Received: by 2002:a17:90b:4c8a:: with SMTP id my10mr538516pjb.220.1631604940104; Tue, 14 Sep 2021 00:35:40 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.244]) by smtp.gmail.com with ESMTPSA id s3sm9377839pfd.188.2021.09.14.00.35.33 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Sep 2021 00:35:39 -0700 (PDT) From: Muchun Song To: willy@infradead.org, akpm@linux-foundation.org, hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, shakeelb@google.com, guro@fb.com, shy828301@gmail.com, alexs@kernel.org, richard.weiyang@gmail.com, david@fromorbit.com, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, zhengqi.arch@bytedance.com, duanxiongchun@bytedance.com, fam.zheng@bytedance.com, smuchun@gmail.com, Muchun Song Subject: [PATCH v3 23/76] efs: allocate inode by using alloc_inode_sb() Date: Tue, 14 Sep 2021 15:28:45 +0800 Message-Id: <20210914072938.6440-24-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20210914072938.6440-1-songmuchun@bytedance.com> References: <20210914072938.6440-1-songmuchun@bytedance.com> MIME-Version: 1.0 X-Stat-Signature: 77yxy6mq7bo1fj9y87t89wyqamss7oou Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=a6sOSaXI; dmarc=pass (policy=none) header.from=bytedance.com; spf=pass (imf18.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.214.178 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: E2768400208D X-HE-Tag: 1631604940-842017 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 inode allocation is supposed to use alloc_inode_sb(), so convert kmem_cache_alloc() to alloc_inode_sb(). Signed-off-by: Muchun Song --- fs/efs/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/efs/super.c b/fs/efs/super.c index 62b155b9366b..b287f47c165b 100644 --- a/fs/efs/super.c +++ b/fs/efs/super.c @@ -69,7 +69,7 @@ static struct kmem_cache * efs_inode_cachep; static struct inode *efs_alloc_inode(struct super_block *sb) { struct efs_inode_info *ei; - ei = kmem_cache_alloc(efs_inode_cachep, GFP_KERNEL); + ei = alloc_inode_sb(sb, efs_inode_cachep, GFP_KERNEL); if (!ei) return NULL; return &ei->vfs_inode; From patchwork Tue Sep 14 07:28:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12492015 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_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 00BE1C433F5 for ; Tue, 14 Sep 2021 07:35:49 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A870C60F4A for ; Tue, 14 Sep 2021 07:35:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org A870C60F4A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 4187F940010; Tue, 14 Sep 2021 03:35:48 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3C7CC940007; Tue, 14 Sep 2021 03:35:48 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1F323940010; Tue, 14 Sep 2021 03:35:48 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0223.hostedemail.com [216.40.44.223]) by kanga.kvack.org (Postfix) with ESMTP id 0B53B940007 for ; Tue, 14 Sep 2021 03:35:48 -0400 (EDT) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id CECB5180C2E47 for ; Tue, 14 Sep 2021 07:35:47 +0000 (UTC) X-FDA: 78585369534.16.DCE3E36 Received: from mail-pg1-f179.google.com (mail-pg1-f179.google.com [209.85.215.179]) by imf12.hostedemail.com (Postfix) with ESMTP id 96F12100009D for ; Tue, 14 Sep 2021 07:35:47 +0000 (UTC) Received: by mail-pg1-f179.google.com with SMTP id w8so11912912pgf.5 for ; Tue, 14 Sep 2021 00:35:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=yQ5/G4W/vpgRy8GesLP2bdOIlsZoFdBH5AJaA8cLR/Y=; b=FarpNNTHbqImJsUbmxvWFBcLoHkl6BQ5MmiEIzrpgL9pKZtHDMT/WVn7YqLTChckTQ Vb8mkkzxsiy5d984PcX6Y2tr+T935aXAw6/2kOpwngXBmppzWAh4woYUdrs6pLSbX+uf 5hmRpYQQOKXSOdQxVx7V+uYhC9vy6Qsl0ItU2KVF8SgisNPegYwAwxNKe1iu2XhKqi/u k6bRj20yfz6bsax0wNnkn30hXSOzmwtCT7Ngn+siAc41Smq0h83aaIGKAlvqV5ClQ52Z Cmg7DrTJkg4LiQDdE8uSNXwck3v/ZvhBmAJdb+6UQp5nl9CC3iGNHX6DskJznrt4+5oW of/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=yQ5/G4W/vpgRy8GesLP2bdOIlsZoFdBH5AJaA8cLR/Y=; b=UPmbTAlwvZCG9uvOlnmEryacsV5s6hTANFL0U/r8l11uvslu675MWx8Tt4Wk6mU7kC sWvPYp1cJVCy6rVPDOZdpYdY3pTkMtrcp/nsCDGnV2ASDRDAJrIRBFS70FQgv3rNh5m6 0vBUxPHb0qs4pZUV3BI9fp1FrchNPKsTmwutY6jmngp6WG9UTfrC7FXHF/4NUGbKauGs 69XHADEr3tgDVKGm+2LtEFNvfGSh2FoRVBUyC8t/bNVG6Tu96/ZHCENVfxYkp1FpAhgb yX59SriAYlQElKCNP6DDYEUn8+eTcLAZ7nP9UtVAXth7N17dcTldoerWMcj+Pe7JgVbe tswg== X-Gm-Message-State: AOAM530NJv1q5c7cuK7IvxYYf+Vl9dEUsNBFC2tRSsOk31TdMOSRKJfI k5owAP60xFvNFk24xC/YXOqxZQ== X-Google-Smtp-Source: ABdhPJztT6eT0YF+2K2i8AUHFeeTV5oxPFhuvtG9eResvbJYAu+ZabBJCKiHNMZu23im7o95eJDAOg== X-Received: by 2002:a62:b414:0:b029:32e:3ef0:7735 with SMTP id h20-20020a62b4140000b029032e3ef07735mr3406553pfn.61.1631604946790; Tue, 14 Sep 2021 00:35:46 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.244]) by smtp.gmail.com with ESMTPSA id s3sm9377839pfd.188.2021.09.14.00.35.40 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Sep 2021 00:35:46 -0700 (PDT) From: Muchun Song To: willy@infradead.org, akpm@linux-foundation.org, hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, shakeelb@google.com, guro@fb.com, shy828301@gmail.com, alexs@kernel.org, richard.weiyang@gmail.com, david@fromorbit.com, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, zhengqi.arch@bytedance.com, duanxiongchun@bytedance.com, fam.zheng@bytedance.com, smuchun@gmail.com, Muchun Song Subject: [PATCH v3 24/76] erofs: allocate inode by using alloc_inode_sb() Date: Tue, 14 Sep 2021 15:28:46 +0800 Message-Id: <20210914072938.6440-25-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20210914072938.6440-1-songmuchun@bytedance.com> References: <20210914072938.6440-1-songmuchun@bytedance.com> MIME-Version: 1.0 Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=FarpNNTH; spf=pass (imf12.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.215.179 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 96F12100009D X-Stat-Signature: eoj91q89xswk9j1q5tb7qe6wjhmhx8ik X-HE-Tag: 1631604947-306052 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 inode allocation is supposed to use alloc_inode_sb(), so convert kmem_cache_alloc() to alloc_inode_sb(). Signed-off-by: Muchun Song --- fs/erofs/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/erofs/super.c b/fs/erofs/super.c index 2dc0b9f1d421..1bf7f8c6cfab 100644 --- a/fs/erofs/super.c +++ b/fs/erofs/super.c @@ -83,7 +83,7 @@ static void erofs_inode_init_once(void *ptr) static struct inode *erofs_alloc_inode(struct super_block *sb) { struct erofs_inode *vi = - kmem_cache_alloc(erofs_inode_cachep, GFP_KERNEL); + alloc_inode_sb(sb, erofs_inode_cachep, GFP_KERNEL); if (!vi) return NULL; From patchwork Tue Sep 14 07:28:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12492017 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_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 676B1C433FE for ; Tue, 14 Sep 2021 07:35:56 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 1B96E61056 for ; Tue, 14 Sep 2021 07:35:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 1B96E61056 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id AA79F940011; Tue, 14 Sep 2021 03:35:55 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A2FE4940007; Tue, 14 Sep 2021 03:35:55 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8A983940011; Tue, 14 Sep 2021 03:35:55 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0231.hostedemail.com [216.40.44.231]) by kanga.kvack.org (Postfix) with ESMTP id 78663940007 for ; Tue, 14 Sep 2021 03:35:55 -0400 (EDT) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 33C4C180AD83E for ; Tue, 14 Sep 2021 07:35:55 +0000 (UTC) X-FDA: 78585369870.30.AD15742 Received: from mail-pf1-f170.google.com (mail-pf1-f170.google.com [209.85.210.170]) by imf12.hostedemail.com (Postfix) with ESMTP id E1D2510000A3 for ; Tue, 14 Sep 2021 07:35:54 +0000 (UTC) Received: by mail-pf1-f170.google.com with SMTP id x7so11329583pfa.8 for ; Tue, 14 Sep 2021 00:35:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=A8uxqiMKUHvgeYQ8P0CzaQokEJZlDPF7mc7vXHBGFco=; b=WtscQXkYsvxZnVK2jTa8msfCsrFpBoyEz4ciJVFGQ6E8TMWZF1FSwrvAgQ7ARQBdIn NbTEmVeNHebG+gbjwZFqNDxL4WD5KDVWZ3jxnk03vx7gB3D6NLkGpHPbMmcYEQJwcbPH MbpVJ/keP9PIby2gW3we45Nn9CsbDo5ajHS7o2NEqtmO2T76UGZuO5G5YVaW9ue/g7P0 RxuXerlPLVAEXR6scvrJStN3Gq1kgpxm7OReKAl0GwU0PnaPOMRMn+do540czlu79ueM RFPpQoWffofEJohRh8OouRBxFt8bZMXzTLqwNXQycKESSOBkBgfdJscHDMUHcLK1cg9C Dk7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=A8uxqiMKUHvgeYQ8P0CzaQokEJZlDPF7mc7vXHBGFco=; b=rAZn0z0OHVEACOrRdN5SyQ+jGCuk6U3nKYv1zk6Oo+urZcUEg+dp4jc5CSaj5Nsc+t 9fwSlYetes/zMCDvE9++DiQdOR/wpTYXeD/GYEkes/K4z2EIKlh3MjMSxMdTvlVRdM/f tesY69hFzCh+QsJcX7G/yPPK4vm2obi09t4VFHiTdi0j9MnG49cBOqfpEUx/h7Ugpx5o FePvgxNhVzA7xremwutUQp04OCXw+ZSWYWO3H960fhR57Jxlu9wk9HV0ioXfVZVMpbHU ASwNmVO5NYxZBx2+etiBOyI5qtdzdHnKrEO/9hiSNhoiENAfr5yWvp4lDqeOSDxXAtHr 1NhA== X-Gm-Message-State: AOAM5306/Ul/90eocRt0BAAFd0BA8BhBadf+UZkZXQ0cs4dH2OlpIqQR xRBCSo3URpICHEcCrYbnL1GGtw== X-Google-Smtp-Source: ABdhPJxfgZ4TY9n/BWFnWgjWloOD0RZB8Jk7Ek9z+15b8lVPKT0ekWcID8XfPLnd+CWwV07YiajNDw== X-Received: by 2002:a62:798f:0:b0:438:faa3:5508 with SMTP id u137-20020a62798f000000b00438faa35508mr3352807pfc.75.1631604954081; Tue, 14 Sep 2021 00:35:54 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.244]) by smtp.gmail.com with ESMTPSA id s3sm9377839pfd.188.2021.09.14.00.35.47 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Sep 2021 00:35:53 -0700 (PDT) From: Muchun Song To: willy@infradead.org, akpm@linux-foundation.org, hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, shakeelb@google.com, guro@fb.com, shy828301@gmail.com, alexs@kernel.org, richard.weiyang@gmail.com, david@fromorbit.com, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, zhengqi.arch@bytedance.com, duanxiongchun@bytedance.com, fam.zheng@bytedance.com, smuchun@gmail.com, Muchun Song Subject: [PATCH v3 25/76] exfat: allocate inode by using alloc_inode_sb() Date: Tue, 14 Sep 2021 15:28:47 +0800 Message-Id: <20210914072938.6440-26-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20210914072938.6440-1-songmuchun@bytedance.com> References: <20210914072938.6440-1-songmuchun@bytedance.com> MIME-Version: 1.0 X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: E1D2510000A3 Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=WtscQXkY; dmarc=pass (policy=none) header.from=bytedance.com; spf=pass (imf12.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.210.170 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com X-Stat-Signature: zaq661r71e6tqy35ra4bijh3fby4zbs3 X-HE-Tag: 1631604954-204904 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 inode allocation is supposed to use alloc_inode_sb(), so convert kmem_cache_alloc() to alloc_inode_sb(). Signed-off-by: Muchun Song --- fs/exfat/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/exfat/super.c b/fs/exfat/super.c index 5539ffc20d16..1b24c9f61be1 100644 --- a/fs/exfat/super.c +++ b/fs/exfat/super.c @@ -182,7 +182,7 @@ static struct inode *exfat_alloc_inode(struct super_block *sb) { struct exfat_inode_info *ei; - ei = kmem_cache_alloc(exfat_inode_cachep, GFP_NOFS); + ei = alloc_inode_sb(sb, exfat_inode_cachep, GFP_NOFS); if (!ei) return NULL; From patchwork Tue Sep 14 07:28:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12492019 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_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 A07E1C433EF for ; Tue, 14 Sep 2021 07:36:05 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 550A361056 for ; Tue, 14 Sep 2021 07:36:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 550A361056 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id E781694000D; Tue, 14 Sep 2021 03:36:04 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E0147940007; Tue, 14 Sep 2021 03:36:04 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CA1D494000D; Tue, 14 Sep 2021 03:36:04 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0174.hostedemail.com [216.40.44.174]) by kanga.kvack.org (Postfix) with ESMTP id B5E32940007 for ; Tue, 14 Sep 2021 03:36:04 -0400 (EDT) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 801B326817 for ; Tue, 14 Sep 2021 07:36:04 +0000 (UTC) X-FDA: 78585370248.10.0707CE2 Received: from mail-pj1-f41.google.com (mail-pj1-f41.google.com [209.85.216.41]) by imf06.hostedemail.com (Postfix) with ESMTP id 4FC20801A89F for ; Tue, 14 Sep 2021 07:36:04 +0000 (UTC) Received: by mail-pj1-f41.google.com with SMTP id n13-20020a17090a4e0d00b0017946980d8dso1435726pjh.5 for ; Tue, 14 Sep 2021 00:36:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=MveWRP8aGyEbJw0ZERHfw7irE+XE52etLPWDr/jyMk8=; b=1QCNrsd3fTrCJmYq7AjXylTezy2s+9nh0iSZRPvyjhcuVZGQZlQdPj3bGiN+SPoyMd 6r9cYRZSakLZWOVLj7JnMRmbn1rQDqY190OcP9qawDYIurm6vnC7/vAFkOF48797xJS+ 55PhOky3xA8w3egEogrUC17aerb3ceC7orkYOSuS9XkYZD+UJe4nNKbGfhA/rJ7X7Tcu Ov6YOSnJRvoMjFUexePo/N9MYfL8e3MH8JQg5+WVDMkPoUNTQt3mixMBZA5j/6+uI+7a r3juszHqxmUE8+iCub+REM1C9zplbGz8lQ6tSS2t/9QdcGks/Ru7ahJNWbFn60UL1XR1 yIZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=MveWRP8aGyEbJw0ZERHfw7irE+XE52etLPWDr/jyMk8=; b=Zal0+oXZkL0ibJYZVWRUb1hf/OVVm1XI70Ao0I/WxmHFQ8VzKRogaERbY/NLel86WC BIRxX1AuZ13T95bsi6M0bSUx9hnl8ioGhvH4UUxo0LtY8n0vL6P/JeLa1f3C5d6lTjLP YrvBTswqaATawC+ayXyUngM6ZyM4mtaVhtMt2vsi7pkh+B5XESO1ya9IugNVYAPj4Qdr x/CNjh6jCoBRshmdooEx7CFFj2oZ3cM+SwX7dgjhm9LNip3qrWzimCcB43yDTrtXqopo JkoRi1j8C9ArXeFwR07pm35oSgrjzjrE3VoqHp4FfEquSIte+PUmPFy5p7mAVURN3RB+ RvUg== X-Gm-Message-State: AOAM533fup4h2rTBW4swCCCfedzEyRUeiS54+2CpCea37T6IyqHLCJ3i YpYeJjNWSRyrJaXwqUzMf+BpBA== X-Google-Smtp-Source: ABdhPJy+tuUMTAb857qWSQifEc13Im/IfToxtwJuI833rQS1l7Wdsiv/q7Lz8DwaE+JIsU/V472dMw== X-Received: by 2002:a17:90b:46cd:: with SMTP id jx13mr554861pjb.122.1631604963433; Tue, 14 Sep 2021 00:36:03 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.244]) by smtp.gmail.com with ESMTPSA id s3sm9377839pfd.188.2021.09.14.00.35.54 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Sep 2021 00:36:03 -0700 (PDT) From: Muchun Song To: willy@infradead.org, akpm@linux-foundation.org, hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, shakeelb@google.com, guro@fb.com, shy828301@gmail.com, alexs@kernel.org, richard.weiyang@gmail.com, david@fromorbit.com, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, zhengqi.arch@bytedance.com, duanxiongchun@bytedance.com, fam.zheng@bytedance.com, smuchun@gmail.com, Muchun Song Subject: [PATCH v3 26/76] ext2: allocate inode by using alloc_inode_sb() Date: Tue, 14 Sep 2021 15:28:48 +0800 Message-Id: <20210914072938.6440-27-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20210914072938.6440-1-songmuchun@bytedance.com> References: <20210914072938.6440-1-songmuchun@bytedance.com> MIME-Version: 1.0 Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=1QCNrsd3; spf=pass (imf06.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.216.41 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com X-Stat-Signature: 11raob5jfa15yat3qxikb7qkjsg9s1qj X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 4FC20801A89F X-HE-Tag: 1631604964-587070 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 inode allocation is supposed to use alloc_inode_sb(), so convert kmem_cache_alloc() to alloc_inode_sb(). Signed-off-by: Muchun Song --- fs/ext2/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ext2/super.c b/fs/ext2/super.c index d8d580b609ba..8deb03ae4742 100644 --- a/fs/ext2/super.c +++ b/fs/ext2/super.c @@ -180,7 +180,7 @@ static struct kmem_cache * ext2_inode_cachep; static struct inode *ext2_alloc_inode(struct super_block *sb) { struct ext2_inode_info *ei; - ei = kmem_cache_alloc(ext2_inode_cachep, GFP_KERNEL); + ei = alloc_inode_sb(sb, ext2_inode_cachep, GFP_KERNEL); if (!ei) return NULL; ei->i_block_alloc_info = NULL; From patchwork Tue Sep 14 07:28:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12492021 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_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 E766DC433EF for ; Tue, 14 Sep 2021 07:36:13 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 99339610A6 for ; Tue, 14 Sep 2021 07:36:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 99339610A6 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 2DE7094000B; Tue, 14 Sep 2021 03:36:13 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 267D3940007; Tue, 14 Sep 2021 03:36:13 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1084B94000B; Tue, 14 Sep 2021 03:36:13 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0188.hostedemail.com [216.40.44.188]) by kanga.kvack.org (Postfix) with ESMTP id F16C0940007 for ; Tue, 14 Sep 2021 03:36:12 -0400 (EDT) Received: from smtpin05.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id B96152C69A for ; Tue, 14 Sep 2021 07:36:12 +0000 (UTC) X-FDA: 78585370584.05.4F51D46 Received: from mail-pj1-f46.google.com (mail-pj1-f46.google.com [209.85.216.46]) by imf17.hostedemail.com (Postfix) with ESMTP id 7A3F6F00038F for ; Tue, 14 Sep 2021 07:36:12 +0000 (UTC) Received: by mail-pj1-f46.google.com with SMTP id u13-20020a17090abb0db0290177e1d9b3f7so1465241pjr.1 for ; Tue, 14 Sep 2021 00:36:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=cmjjxAarEFgJ80kKiRRnCFdLqqijm/ZOZ3kz8PWEXM4=; b=uTrXKSnUgf/D1pPSszp9Jli4gPAIsZjFM3ymwHw0oD5rlNZgodHU1a0onalEQE/BnQ Tq3WMOBDjMAw00HLB8jMEtfbkzY9tzNQcDgABUEqHnxrKEB+eZV8mDTA8irJbX9Ldxry +EFr86Viasjl9SwUW3DuBJpw3T8Ak57aRafmujH19brt9CXaLZSmAdpkwZifbT2UHfkO WtpX3wnh1/ArkU3gzfhnyY+pWmd2YNY2q9VHvf34UEKyEp0e8XPvXQGyAzIaLMVxCFE0 ugyuii9Xmh8v3fZf38yaYFzUCitTtFF47+fhdQf3sE5E8OrIS+kTSSqqeBaMg7hb8c3v w/zQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=cmjjxAarEFgJ80kKiRRnCFdLqqijm/ZOZ3kz8PWEXM4=; b=54XfC6qro1QkKyda6V9WWxSOvSnavNiF/TQSokw2Fd1wq4l4wcPiHF6mgjOYpXpU2R 37LGuB2C6ohsl8XExiWVya9kxOF4V1ZwOz3IQtXf7iYKpCYhL0/2CUN7nzVE3La8Y8zF GJ7GVqMA1Bh3nBjYnHm4xIFfgzMFNaOhenVasxv8KA6tRPFZ3MXMPZx+EgUUd5Wy5l0O RKqDRORKRRfnNRccG4FjSuMmiCMIcSuIKgkC3T1flp4boLYyXMzF61zo028MOwZdMig1 IHdFHr/AIbBXj0fty6Be7zvvuvyOS7KuSLgi3HxO4PaXY8rh2jERzhU2xg3yxcqxeHyt uOmQ== X-Gm-Message-State: AOAM531hitEs3ZuNQNpe4RyE/6/uYrgYHYlzMWdeMDimU36o+9vJPK3T 6bcSYwVCvGL1N/gl3eZhDVRYhw== X-Google-Smtp-Source: ABdhPJwbNn2n3qZtjVQMtbnAhg4/a/OijUviLF+d8q6+0lbEHs1AYMqKbKdwzQfo2+1abSfqmXKt8A== X-Received: by 2002:a17:90a:4ce3:: with SMTP id k90mr517998pjh.237.1631604971297; Tue, 14 Sep 2021 00:36:11 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.244]) by smtp.gmail.com with ESMTPSA id s3sm9377839pfd.188.2021.09.14.00.36.03 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Sep 2021 00:36:11 -0700 (PDT) From: Muchun Song To: willy@infradead.org, akpm@linux-foundation.org, hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, shakeelb@google.com, guro@fb.com, shy828301@gmail.com, alexs@kernel.org, richard.weiyang@gmail.com, david@fromorbit.com, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, zhengqi.arch@bytedance.com, duanxiongchun@bytedance.com, fam.zheng@bytedance.com, smuchun@gmail.com, Muchun Song Subject: [PATCH v3 27/76] ext4: allocate inode by using alloc_inode_sb() Date: Tue, 14 Sep 2021 15:28:49 +0800 Message-Id: <20210914072938.6440-28-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20210914072938.6440-1-songmuchun@bytedance.com> References: <20210914072938.6440-1-songmuchun@bytedance.com> MIME-Version: 1.0 Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=uTrXKSnU; spf=pass (imf17.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.216.46 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com X-Stat-Signature: fsgrx6uf5rcauzqq3btkb8s1rj3maupx X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 7A3F6F00038F X-HE-Tag: 1631604972-420393 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 inode allocation is supposed to use alloc_inode_sb(), so convert kmem_cache_alloc() to alloc_inode_sb(). Signed-off-by: Muchun Song --- fs/ext4/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 0775950ee84e..71982851063b 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -1284,7 +1284,7 @@ static struct inode *ext4_alloc_inode(struct super_block *sb) { struct ext4_inode_info *ei; - ei = kmem_cache_alloc(ext4_inode_cachep, GFP_NOFS); + ei = alloc_inode_sb(sb, ext4_inode_cachep, GFP_NOFS); if (!ei) return NULL; From patchwork Tue Sep 14 07:28:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12492023 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_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 32815C433EF for ; Tue, 14 Sep 2021 07:36:21 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D72BF61029 for ; Tue, 14 Sep 2021 07:36:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org D72BF61029 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 7E74394000E; Tue, 14 Sep 2021 03:36:20 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 76FD7940007; Tue, 14 Sep 2021 03:36:20 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 59F0A94000E; Tue, 14 Sep 2021 03:36:20 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0047.hostedemail.com [216.40.44.47]) by kanga.kvack.org (Postfix) with ESMTP id 45185940007 for ; Tue, 14 Sep 2021 03:36:20 -0400 (EDT) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 04335299AE for ; Tue, 14 Sep 2021 07:36:20 +0000 (UTC) X-FDA: 78585370920.24.76C663C Received: from mail-pg1-f172.google.com (mail-pg1-f172.google.com [209.85.215.172]) by imf25.hostedemail.com (Postfix) with ESMTP id CA060B00008E for ; Tue, 14 Sep 2021 07:36:19 +0000 (UTC) Received: by mail-pg1-f172.google.com with SMTP id 17so11943168pgp.4 for ; Tue, 14 Sep 2021 00:36:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=2+jHdCSClltB9FI22Ll4F7nlE0cYnSoMAJ/pgRqeUyY=; b=Qa1CB41JszknO5iUAFVKP5tnoMJ5zaTdsFCurqvfaQAPp2j+/PIYhmIvkWtZVe0jM+ mTysdz133i3FgFs75Ssv6HINhWeujFnA53YdMT4O2pr+ZrXb4UFFiJwZOZ4v1eVX/n+/ P7PDvo/ufosDKLazyo7XH3kXoOm9AODc3zs7szd4sewKkN+ZrA8fgvMWkoK2unm+G5lt E/TsooaWK4vn6GXWxGlBcdwaBGzHSFvP7BdG0zcaxaSG/Zd7EqyaCNA4YQjgeiDlFyba +RfFyYSpuu6CnzQRPSftWc2TiZ3x5D4o1Pj69L8wB+fbArnp9BfE1BxaDLyyZyITahUr s05w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=2+jHdCSClltB9FI22Ll4F7nlE0cYnSoMAJ/pgRqeUyY=; b=Kpoon0QHvxbzyZQptoQANclqLDkjvLICI70nUa/1lsj8UfmRpW0cifcacSrHgUN3oP QsaOCCN+3w1FdvNcBfWJ7bFkS00qPXSMZUYbesqf44uz0/d9HcoGnNxV28GruLkjaVxX sTt7JxpGmzlj7BM8sp+Xsuf0vBfTjUrxo83/WruAljtOjA2Ows/9yadL4UBhGOqXauGm rZlzgXP5tEJiO3NimB+1jvWgPb9XNp+y5ugc3/vnnl7TDfEZ/+LJ2DpAVfp+c+rKKNjB 0sck4JwGSk/qSH7uHgU67IAlQYxrHjrdkNfxz6Tz04rAJi7ioIUk90lZa22GyQYWSCrx hjUQ== X-Gm-Message-State: AOAM530BHNE2Fb+1ZZGTKgw4/AufHlpT9SZZaY6kqClxs1g9uZmFOdmU UDfdcSWx2uCVAPkTIsWT6pqZHw== X-Google-Smtp-Source: ABdhPJwctFphhFhWs/bWkeeC0RdCL1kXqNOlfsHVSrc2XDnpWHndExIIdyOPD0y3DZaVEx7ikQY2tA== X-Received: by 2002:a05:6a00:21c7:b0:412:bb0b:850d with SMTP id t7-20020a056a0021c700b00412bb0b850dmr3479074pfj.33.1631604978955; Tue, 14 Sep 2021 00:36:18 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.244]) by smtp.gmail.com with ESMTPSA id s3sm9377839pfd.188.2021.09.14.00.36.11 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Sep 2021 00:36:18 -0700 (PDT) From: Muchun Song To: willy@infradead.org, akpm@linux-foundation.org, hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, shakeelb@google.com, guro@fb.com, shy828301@gmail.com, alexs@kernel.org, richard.weiyang@gmail.com, david@fromorbit.com, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, zhengqi.arch@bytedance.com, duanxiongchun@bytedance.com, fam.zheng@bytedance.com, smuchun@gmail.com, Muchun Song Subject: [PATCH v3 28/76] fat: allocate inode by using alloc_inode_sb() Date: Tue, 14 Sep 2021 15:28:50 +0800 Message-Id: <20210914072938.6440-29-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20210914072938.6440-1-songmuchun@bytedance.com> References: <20210914072938.6440-1-songmuchun@bytedance.com> MIME-Version: 1.0 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: CA060B00008E X-Stat-Signature: wyn7jxmo8azwp57tajhsyhcicmo844bi Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=Qa1CB41J; spf=pass (imf25.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.215.172 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com X-HE-Tag: 1631604979-639981 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 inode allocation is supposed to use alloc_inode_sb(), so convert kmem_cache_alloc() to alloc_inode_sb(). Signed-off-by: Muchun Song --- fs/fat/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/fat/inode.c b/fs/fat/inode.c index de0c9b013a85..5439831c725a 100644 --- a/fs/fat/inode.c +++ b/fs/fat/inode.c @@ -745,7 +745,7 @@ static struct kmem_cache *fat_inode_cachep; static struct inode *fat_alloc_inode(struct super_block *sb) { struct msdos_inode_info *ei; - ei = kmem_cache_alloc(fat_inode_cachep, GFP_NOFS); + ei = alloc_inode_sb(sb, fat_inode_cachep, GFP_NOFS); if (!ei) return NULL; From patchwork Tue Sep 14 07:28:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12492025 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_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 C20F3C433EF for ; Tue, 14 Sep 2021 07:36:28 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7058761166 for ; Tue, 14 Sep 2021 07:36:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 7058761166 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 0BB3C940012; Tue, 14 Sep 2021 03:36:28 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 04479940007; Tue, 14 Sep 2021 03:36:27 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E0072940012; Tue, 14 Sep 2021 03:36:27 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0038.hostedemail.com [216.40.44.38]) by kanga.kvack.org (Postfix) with ESMTP id CB7E0940007 for ; Tue, 14 Sep 2021 03:36:27 -0400 (EDT) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 8A8E78249980 for ; Tue, 14 Sep 2021 07:36:27 +0000 (UTC) X-FDA: 78585371214.11.CC2D92C Received: from mail-pj1-f44.google.com (mail-pj1-f44.google.com [209.85.216.44]) by imf22.hostedemail.com (Postfix) with ESMTP id 5224A1902 for ; Tue, 14 Sep 2021 07:36:27 +0000 (UTC) Received: by mail-pj1-f44.google.com with SMTP id t20so8230714pju.5 for ; Tue, 14 Sep 2021 00:36:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=GpuZrN7lVo6ohiZi0x9Y9gco3KIsT7Yu4UJF7LQ+Src=; b=XK2YVgvEnC8eo561Zj8YudwmEx/4PDfdTQ9dKb5DvB/DKuFgYUzpUolHYO2djH6KgZ KL90gWeOPaKl3X/lVfC0rvtEfSKcHaA5BE7Wo6UQTiVU2LjC+Q8/7cMn32P7aGUZcrc8 Cok0BiIp8dMuTRs4sWjgZFzbpsy5A0ucWr7qqASyrwnGf34usBwod+EVjMfjwvnLcq7F GzJUHULfkk0hRQKS93PSPZ2YP8Kj/+mlP/1TgoUpnjC/QOOLKyRA5diUxnfn5ru/s2p9 sM8rW3p38fz3zEqC4WE4lL4gXhfChJPS+h17cCngl+uXsVn8tDH0LtenenRAe5DMCMnL e3lA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=GpuZrN7lVo6ohiZi0x9Y9gco3KIsT7Yu4UJF7LQ+Src=; b=qjR08ouqbL90UZ8AHI8v9ugXK7mlGxiN+/g5E3n4sLbRrXvTuPtbUZdglCB88gW8qo vx6UzfYtYhG+sAMkhA532ZLGaBfm9x00Uka6ecYgLfjYwET/1mZ+GMkd0lxmBcljysi7 mHIyKE2Ufr1CoHV5mX4W3GmYdoib3WNbvZSk9O1xilf9jkkfgoYbkGwNnfd4hTNNZLy1 g6/eo98zLpBC5gDWtaSN198rO+S35NMN4yCGqUdKkYCvGMQj71dzeJJv9i370R2972ab TQ/J5Cx1RH6mZMOUQI4r40I71pH9L8VFbjbhHyYdW7Qmhd4aksx3Kfw/PyB4PMZAr0aj RNgQ== X-Gm-Message-State: AOAM532pjPzh9r9A+LM65SaiqZx6gJpiz62QKJmnYWJbSjByifpDNIVz lN43kJb3pvGrP4KdECwMyDx3yA== X-Google-Smtp-Source: ABdhPJw0ASs2RIdhxbbR2O/YDK5qRhA5nrg4Z8m8PgOz0RuFsVoSPDmc2jQVl8bkdrait64wdD0EGg== X-Received: by 2002:a17:90b:250e:: with SMTP id ns14mr573022pjb.84.1631604986552; Tue, 14 Sep 2021 00:36:26 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.244]) by smtp.gmail.com with ESMTPSA id s3sm9377839pfd.188.2021.09.14.00.36.19 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Sep 2021 00:36:26 -0700 (PDT) From: Muchun Song To: willy@infradead.org, akpm@linux-foundation.org, hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, shakeelb@google.com, guro@fb.com, shy828301@gmail.com, alexs@kernel.org, richard.weiyang@gmail.com, david@fromorbit.com, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, zhengqi.arch@bytedance.com, duanxiongchun@bytedance.com, fam.zheng@bytedance.com, smuchun@gmail.com, Muchun Song Subject: [PATCH v3 29/76] freevxfs: allocate inode by using alloc_inode_sb() Date: Tue, 14 Sep 2021 15:28:51 +0800 Message-Id: <20210914072938.6440-30-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20210914072938.6440-1-songmuchun@bytedance.com> References: <20210914072938.6440-1-songmuchun@bytedance.com> MIME-Version: 1.0 Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=XK2YVgvE; spf=pass (imf22.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.216.44 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com X-Stat-Signature: xs5ybz4scsq6sdy3juek9s7pxm765x8i X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 5224A1902 X-HE-Tag: 1631604987-422923 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 inode allocation is supposed to use alloc_inode_sb(), so convert kmem_cache_alloc() to alloc_inode_sb(). Signed-off-by: Muchun Song --- fs/freevxfs/vxfs_super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/freevxfs/vxfs_super.c b/fs/freevxfs/vxfs_super.c index 578a5062706e..22eed5a73ac2 100644 --- a/fs/freevxfs/vxfs_super.c +++ b/fs/freevxfs/vxfs_super.c @@ -124,7 +124,7 @@ static struct inode *vxfs_alloc_inode(struct super_block *sb) { struct vxfs_inode_info *vi; - vi = kmem_cache_alloc(vxfs_inode_cachep, GFP_KERNEL); + vi = alloc_inode_sb(sb, vxfs_inode_cachep, GFP_KERNEL); if (!vi) return NULL; inode_init_once(&vi->vfs_inode); From patchwork Tue Sep 14 07:28:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12492027 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_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 14F4EC433EF for ; Tue, 14 Sep 2021 07:36:37 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B7B9960238 for ; Tue, 14 Sep 2021 07:36:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org B7B9960238 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 5C4E4940007; Tue, 14 Sep 2021 03:36:36 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 54CD9900002; Tue, 14 Sep 2021 03:36:36 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3EDC8940007; Tue, 14 Sep 2021 03:36:36 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0243.hostedemail.com [216.40.44.243]) by kanga.kvack.org (Postfix) with ESMTP id 2CD69900002 for ; Tue, 14 Sep 2021 03:36:36 -0400 (EDT) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id E379C2D001 for ; Tue, 14 Sep 2021 07:36:35 +0000 (UTC) X-FDA: 78585371550.13.1BCC468 Received: from mail-pj1-f45.google.com (mail-pj1-f45.google.com [209.85.216.45]) by imf22.hostedemail.com (Postfix) with ESMTP id 9BF6C1900 for ; Tue, 14 Sep 2021 07:36:34 +0000 (UTC) Received: by mail-pj1-f45.google.com with SMTP id on12-20020a17090b1d0c00b001997c60aa29so1558448pjb.1 for ; Tue, 14 Sep 2021 00:36:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=tqeEB6Z1lu1YikTUjiCI3SOPcDMSLqCAf74hbamBzSk=; b=QoSWUeR65uEahiEKqRTucDY0Wp5Y3nKeDQz+RwKu+bXIO6FI9E7mLfiV5M3mk1I0vQ CINhG0Z7eKGHFS54U6wB5LI1BPDocuQCKLS/4Pg4h92qe2GhRj8xTBu7WArvYORkaRX3 +iy8lSraS7pjYVR7KzEfcR65lTLifqj9wdRaEmEqe3QGG+7rdea8/OIHOMvoiGuCD9hV BcxDW2AQfO4losbPjoUUz6VZc++Ls7XJIYxAAEhnsXDbm01fLmm6SgAxQzx3nTKzrrw+ iPkxUoOvtqb0u01J2FuU1ugdp33XWMeUKkZXUUmnqmqykKPe+0Zs9T8sLzEmF3ZfV6sR 8QHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=tqeEB6Z1lu1YikTUjiCI3SOPcDMSLqCAf74hbamBzSk=; b=lu5zKJiErbkCDeFDn1bNxvHLy2bCPqspikgMe9CApMPh/oYiXrjVgHzzhqAgzrWrB8 i4JB/5WsYYeLsIZz0rGvhsn/XB5+mHsi3OsjU6/4MXSgWjszzvqAoe90IreRig+IgdQG 6w8ih4b6Fw4Y+mtgNggKrcWmz3L//n4UAZR8sa6euBQeuljguxMQiHo5u5T26N36q1pD nIwqbNv2zm9tL6FpjqL9hNGY77pE5PoUh0DtmrsLBJxPg5GvWQHE/MYk1/tm9K3pcEgp YYX/E6UaZm8iFhQOYAHpT1ACHR8X79CJP4XAci1HCVyPrJAuUR7r0RxVATNIW1APvoi6 LEXg== X-Gm-Message-State: AOAM5326LvRFHGEk9aR7c0FXOK3iDjA5D2tukVi0NLyAGASrGv6Q685G EDcGAv76SKg9I6CnWvNlA0EzlA== X-Google-Smtp-Source: ABdhPJwaxpmIuEPcMTXjjIYbJvFSyhYriXYhvhKQEm4ywlA78+6xQFYUylgy3qJj1WpGr5jNpjYEig== X-Received: by 2002:a17:902:76c1:b0:13a:95b:c138 with SMTP id j1-20020a17090276c100b0013a095bc138mr14100410plt.34.1631604993769; Tue, 14 Sep 2021 00:36:33 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.244]) by smtp.gmail.com with ESMTPSA id s3sm9377839pfd.188.2021.09.14.00.36.27 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Sep 2021 00:36:33 -0700 (PDT) From: Muchun Song To: willy@infradead.org, akpm@linux-foundation.org, hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, shakeelb@google.com, guro@fb.com, shy828301@gmail.com, alexs@kernel.org, richard.weiyang@gmail.com, david@fromorbit.com, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, zhengqi.arch@bytedance.com, duanxiongchun@bytedance.com, fam.zheng@bytedance.com, smuchun@gmail.com, Muchun Song Subject: [PATCH v3 30/76] fuse: allocate inode by using alloc_inode_sb() Date: Tue, 14 Sep 2021 15:28:52 +0800 Message-Id: <20210914072938.6440-31-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20210914072938.6440-1-songmuchun@bytedance.com> References: <20210914072938.6440-1-songmuchun@bytedance.com> MIME-Version: 1.0 X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 9BF6C1900 Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=QoSWUeR6; dmarc=pass (policy=none) header.from=bytedance.com; spf=pass (imf22.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.216.45 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com X-Stat-Signature: 3gjjqzbmt7cstkxb8sxht9hpi3mtah9y X-HE-Tag: 1631604994-139968 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 inode allocation is supposed to use alloc_inode_sb(), so convert kmem_cache_alloc() to alloc_inode_sb(). Signed-off-by: Muchun Song --- fs/fuse/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c index 8baa76b4ae41..bab5c564301e 100644 --- a/fs/fuse/inode.c +++ b/fs/fuse/inode.c @@ -73,7 +73,7 @@ static struct inode *fuse_alloc_inode(struct super_block *sb) { struct fuse_inode *fi; - fi = kmem_cache_alloc(fuse_inode_cachep, GFP_KERNEL); + fi = alloc_inode_sb(sb, fuse_inode_cachep, GFP_KERNEL); if (!fi) return NULL; From patchwork Tue Sep 14 07:28:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12492029 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_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 15EB9C433EF for ; Tue, 14 Sep 2021 07:36:43 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id BD76360F21 for ; Tue, 14 Sep 2021 07:36:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org BD76360F21 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 6AE3994000A; Tue, 14 Sep 2021 03:36:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 636ED900002; Tue, 14 Sep 2021 03:36:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4D7B494000A; Tue, 14 Sep 2021 03:36:42 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0239.hostedemail.com [216.40.44.239]) by kanga.kvack.org (Postfix) with ESMTP id 3E9E4900002 for ; Tue, 14 Sep 2021 03:36:42 -0400 (EDT) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 00DC0267C1 for ; Tue, 14 Sep 2021 07:36:42 +0000 (UTC) X-FDA: 78585371844.16.0D542FF Received: from mail-pj1-f53.google.com (mail-pj1-f53.google.com [209.85.216.53]) by imf03.hostedemail.com (Postfix) with ESMTP id BEB213000099 for ; Tue, 14 Sep 2021 07:36:41 +0000 (UTC) Received: by mail-pj1-f53.google.com with SMTP id j1so8234778pjv.3 for ; Tue, 14 Sep 2021 00:36:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=1vhKSYO+w5+4UqN2xprDDrSRBUlSs7Rk18R8p/1ECvE=; b=PVmqXYProQrcarodCcC4uggaknivjAPZiqZ6CuwNwesKmZMr9vBBg8yL9oIo6lcW97 HVjprM/kYvwD+OUEGw2/BuVl1KywqBrEUtLgMCy26VGtzMOHgN4hPNCRl2i98AUnV8pm sNN6qYjhFVWO+KD4E7M3V8Infq2cPZjyXQl2Rf4poYTBSp7BIj6i3Ge1qgdpIb5G5inS E3Dks7TcvHY1+Wh16+c4m9H1dsXomllFPzajPoUQMJNpjGLT/Q1Bq740Sqvu43ltveth 6lwek+7KgpEoFymETX3BjWvPUiHZ4SEYNb0g0pTHotd6nG+R08tGFZ6vTkUDAt++QB+x y7+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=1vhKSYO+w5+4UqN2xprDDrSRBUlSs7Rk18R8p/1ECvE=; b=7mWKcffRKn7koBqsLOIMw2/oJ/YkvfE8GK+/KWovuwI5isBABKX4LDzFu6BTdqt1AZ rjASbSIc48IDhVIaZHbSE/bZ9xRd45tG9GKCYxePWSX7gi3ApvDdhv8Jml8zn1fXgjGM 8qCxrunPm21GM55CwCtbIA6FmpCC160m0NWxjGZyzzQKFhhdquN7XCgj7gcVCaFXqpuw FbGt7fsoMAUSsMuPiXBaiNsyhJgTZAI6WdDxbOmXKlNEBTPZLjo3Unn1tSNkqHVm0Im2 VExnkQMxvc2HBxcDZ7IifljcbeTuE6/qxET6afIrsmnE029IbZAjSHcPyVys3DMKFt4/ I0og== X-Gm-Message-State: AOAM531HatHb80hv77FcBCL6SbAapSHc0oPfSP3q0ICrB1pjK/q3+goo y8D8K2CAK1YClAj43VyFqPvERQ== X-Google-Smtp-Source: ABdhPJxZRW9q9YfVoKHGbbYCVmcBarXPBCCzFRBWTZUPztDMhMBmHBtSYhMDCAEx/F313PGE17/HoQ== X-Received: by 2002:a17:903:2c2:b029:101:9c88:d928 with SMTP id s2-20020a17090302c2b02901019c88d928mr13898475plk.62.1631605000969; Tue, 14 Sep 2021 00:36:40 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.244]) by smtp.gmail.com with ESMTPSA id s3sm9377839pfd.188.2021.09.14.00.36.34 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Sep 2021 00:36:40 -0700 (PDT) From: Muchun Song To: willy@infradead.org, akpm@linux-foundation.org, hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, shakeelb@google.com, guro@fb.com, shy828301@gmail.com, alexs@kernel.org, richard.weiyang@gmail.com, david@fromorbit.com, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, zhengqi.arch@bytedance.com, duanxiongchun@bytedance.com, fam.zheng@bytedance.com, smuchun@gmail.com, Muchun Song Subject: [PATCH v3 31/76] gfs2: allocate inode by using alloc_inode_sb() Date: Tue, 14 Sep 2021 15:28:53 +0800 Message-Id: <20210914072938.6440-32-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20210914072938.6440-1-songmuchun@bytedance.com> References: <20210914072938.6440-1-songmuchun@bytedance.com> MIME-Version: 1.0 X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: BEB213000099 Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=PVmqXYPr; dmarc=pass (policy=none) header.from=bytedance.com; spf=pass (imf03.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.216.53 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com X-Stat-Signature: 9hbmw4uki3qhmqyj1f7peiw8unit7pw4 X-HE-Tag: 1631605001-736859 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 inode allocation is supposed to use alloc_inode_sb(), so convert kmem_cache_alloc() to alloc_inode_sb(). Signed-off-by: Muchun Song --- fs/gfs2/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c index 6e00d15ef0a8..2778d4349b66 100644 --- a/fs/gfs2/super.c +++ b/fs/gfs2/super.c @@ -1427,7 +1427,7 @@ static struct inode *gfs2_alloc_inode(struct super_block *sb) { struct gfs2_inode *ip; - ip = kmem_cache_alloc(gfs2_inode_cachep, GFP_KERNEL); + ip = alloc_inode_sb(sb, gfs2_inode_cachep, GFP_KERNEL); if (!ip) return NULL; ip->i_flags = 0; From patchwork Tue Sep 14 07:28:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12492031 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_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 54CD2C433EF for ; Tue, 14 Sep 2021 07:36:51 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 0811860F21 for ; Tue, 14 Sep 2021 07:36:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 0811860F21 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id A0A676B006C; Tue, 14 Sep 2021 03:36:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 99243900002; Tue, 14 Sep 2021 03:36:50 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8332C6B0072; Tue, 14 Sep 2021 03:36:50 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0119.hostedemail.com [216.40.44.119]) by kanga.kvack.org (Postfix) with ESMTP id 715BE6B006C for ; Tue, 14 Sep 2021 03:36:50 -0400 (EDT) Received: from smtpin38.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 3E4D78249980 for ; Tue, 14 Sep 2021 07:36:50 +0000 (UTC) X-FDA: 78585372180.38.BC0FB0E Received: from mail-pg1-f179.google.com (mail-pg1-f179.google.com [209.85.215.179]) by imf27.hostedemail.com (Postfix) with ESMTP id 0BB247000081 for ; Tue, 14 Sep 2021 07:36:49 +0000 (UTC) Received: by mail-pg1-f179.google.com with SMTP id t1so11939294pgv.3 for ; Tue, 14 Sep 2021 00:36:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=85ranNZdyaGfIOzMylg5hKugOz3EzRoTjtK/I6Bf/uc=; b=scs+UQEpQpVrbhxG/18iJA5iDDX5adwTaPjyTj1/tlfT8b0WEFYeJxSeuk0hq9oFGf KiuHBuMXlggevT7VbeCvO0Nzj5flt40abbEYfZapdScLVNqAOrrd33blZSHe6m9GL1Nc nGmuczfYWt1v2BoGnc7kjCgklwI3rluKyQ4jw6Erv6RYmGtQi0JH0Pm+b0JN7tQqU6Wy 9Ik8pdsjFRHQN+PDPhkDjvqH0z9CuTyx9zk8yluDPCMeBnmd4pa9jfO/iBb8MORiUbnk ebvWdrJNF3aLWVgh3Xn2GT+GyvQbs5cktdqb35Jcauxi5iuXbEmUQspCHgqNhJGzGsda 6zPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=85ranNZdyaGfIOzMylg5hKugOz3EzRoTjtK/I6Bf/uc=; b=QNgaZ6S2ezwAwWHEscRTJRPShvE3QhH/oGGyHvcyYyH9ntVjsrllA+Yc4btUcpzOo9 cvLR9KzFhtgWGZmDqS7sR4Kr4MFghgLInaSFzWX71jDUdLGfPiryUANMa5sLbIy4mezh 9bzSuvA0tECFvgNsTBcVb9CRO0eSU3sgegXRjqVOE014J2DwCVywd9+7tf1tWXrfSiqZ Be1y0p1KangG6r/q2FvkVE4Qzt7CSqgyGNFeFnLavFnMDP2jzgI+kqPn3POLMf4Yam+y lu6oB8qs660M49oXnBk1fD89Je+YzTtPfxxo7Q+TgvwDTimJwKwqBO7otacqEX0dUMsA rreg== X-Gm-Message-State: AOAM533xcnvbnfx+Djm/xhRQyHnS32wK0Hk669eCdfYlkMJ3XD4dBAxY aVV+dJCbgvF1VTY+S/4AIXPuIw== X-Google-Smtp-Source: ABdhPJwGllShuPmxOvjVu6jph61EmdMYmV0yMEMvXmW9o6lRUA3dKq91tPkQW7t7gbAxo5+jDS7LSA== X-Received: by 2002:a63:4b5a:: with SMTP id k26mr14357882pgl.241.1631605009165; Tue, 14 Sep 2021 00:36:49 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.244]) by smtp.gmail.com with ESMTPSA id s3sm9377839pfd.188.2021.09.14.00.36.41 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Sep 2021 00:36:48 -0700 (PDT) From: Muchun Song To: willy@infradead.org, akpm@linux-foundation.org, hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, shakeelb@google.com, guro@fb.com, shy828301@gmail.com, alexs@kernel.org, richard.weiyang@gmail.com, david@fromorbit.com, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, zhengqi.arch@bytedance.com, duanxiongchun@bytedance.com, fam.zheng@bytedance.com, smuchun@gmail.com, Muchun Song Subject: [PATCH v3 32/76] hfs: allocate inode by using alloc_inode_sb() Date: Tue, 14 Sep 2021 15:28:54 +0800 Message-Id: <20210914072938.6440-33-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20210914072938.6440-1-songmuchun@bytedance.com> References: <20210914072938.6440-1-songmuchun@bytedance.com> MIME-Version: 1.0 Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=scs+UQEp; spf=pass (imf27.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.215.179 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 0BB247000081 X-Stat-Signature: xwzf8a8c7aw3dt1wiyje1ah9xkim36yp X-HE-Tag: 1631605009-907603 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 inode allocation is supposed to use alloc_inode_sb(), so convert kmem_cache_alloc() to alloc_inode_sb(). Signed-off-by: Muchun Song --- fs/hfs/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/hfs/super.c b/fs/hfs/super.c index 12d9bae39363..6764afa98a6f 100644 --- a/fs/hfs/super.c +++ b/fs/hfs/super.c @@ -162,7 +162,7 @@ static struct inode *hfs_alloc_inode(struct super_block *sb) { struct hfs_inode_info *i; - i = kmem_cache_alloc(hfs_inode_cachep, GFP_KERNEL); + i = alloc_inode_sb(sb, hfs_inode_cachep, GFP_KERNEL); return i ? &i->vfs_inode : NULL; } From patchwork Tue Sep 14 07:28:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12492033 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_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 94033C433FE for ; Tue, 14 Sep 2021 07:36:58 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 493C060F3A for ; Tue, 14 Sep 2021 07:36:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 493C060F3A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id E7648900002; Tue, 14 Sep 2021 03:36:57 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DFF57940007; Tue, 14 Sep 2021 03:36:57 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CA0AB900004; Tue, 14 Sep 2021 03:36:57 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0165.hostedemail.com [216.40.44.165]) by kanga.kvack.org (Postfix) with ESMTP id BA3D1900002 for ; Tue, 14 Sep 2021 03:36:57 -0400 (EDT) Received: from smtpin25.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 7D5CD1802EF19 for ; Tue, 14 Sep 2021 07:36:57 +0000 (UTC) X-FDA: 78585372474.25.3EDDF1E Received: from mail-pf1-f182.google.com (mail-pf1-f182.google.com [209.85.210.182]) by imf29.hostedemail.com (Postfix) with ESMTP id 43539900013E for ; Tue, 14 Sep 2021 07:36:57 +0000 (UTC) Received: by mail-pf1-f182.google.com with SMTP id w19so6953510pfn.12 for ; Tue, 14 Sep 2021 00:36:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=AIgyRDPnSS/1J7ag3xqeLWjyouPh4gl6PlA+qRTekZA=; b=PyOW/6GoK2XsRe2NJ7cCpiZLTaeT6F6pQKixcs2KAyvR+5Z/mRQxtEi0pP+vOjwEPO PAncKSttmDhCH49J1Gr6mtp8yGewJZDUJBBcwfLuSQYbBNZ/TI1LD4s1CxA3lH6TGEpo pdEP6cmECZIzLXxI8HQNVd4iZ50JSx2LapChtha0k5RqUSw5X4zBGJpaCQoHKK8hzcTu /MmDJc+NdtSatcI7E33E3jT/Rl8ublvlEtJTCwdJchle8cnvY8065nce6hh4uTvCrnjL Rd2voYUwAWg7g4s7EtR87k+jnfmazVddeuWYTEAOr4ug//3HYNtFpgcdVGLcTwOMwpwg d6hA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=AIgyRDPnSS/1J7ag3xqeLWjyouPh4gl6PlA+qRTekZA=; b=RPc3oeu8nm0iSLmoJIxjdEsgBnGWdDN9fTl8Zb7t+BN0S6Z/M3XP4KN8brIgnHRGou 5mjCEg0n7tUA+0+t1QZZXC1glE1pF8G5k8wy2ohEBMO5xM6H/H01FfkEv9m3r4xaBBwG fmwqFkcTmSSf+ZIlusjVXrlO4U68ERBiUnN9OQaRbh9QBU4Mk6vjLu20ztiT19DGsZBW S0RKx4oXjaW8D+ku4t/bpPr95Dxi75wwZljJzahtH+8Ttt7LITVAgwwdays6R1nOJob6 mrtuSdHAawTj5t7hUK+ifhRsI6PBMI9TholsexFu3opWCoowvNiYTzCaf7yDiMX/ORcV TxSw== X-Gm-Message-State: AOAM5300xhF98fm8p4qsMloIfxYlZdVylc0xf4GZcHHFjT0MIrnGxg6Z i+vpJBcvwKthPEKrWJzzb4Rr/g== X-Google-Smtp-Source: ABdhPJzBqv8a97y97tqrOm4MQyzpy5XU/BTSSq6lA22I2sLvRfI63XF8fDmB9QhcEgokLAlwmntHuQ== X-Received: by 2002:a63:3602:: with SMTP id d2mr14279308pga.390.1631605016459; Tue, 14 Sep 2021 00:36:56 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.244]) by smtp.gmail.com with ESMTPSA id s3sm9377839pfd.188.2021.09.14.00.36.49 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Sep 2021 00:36:56 -0700 (PDT) From: Muchun Song To: willy@infradead.org, akpm@linux-foundation.org, hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, shakeelb@google.com, guro@fb.com, shy828301@gmail.com, alexs@kernel.org, richard.weiyang@gmail.com, david@fromorbit.com, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, zhengqi.arch@bytedance.com, duanxiongchun@bytedance.com, fam.zheng@bytedance.com, smuchun@gmail.com, Muchun Song Subject: [PATCH v3 33/76] hfsplus: allocate inode by using alloc_inode_sb() Date: Tue, 14 Sep 2021 15:28:55 +0800 Message-Id: <20210914072938.6440-34-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20210914072938.6440-1-songmuchun@bytedance.com> References: <20210914072938.6440-1-songmuchun@bytedance.com> MIME-Version: 1.0 X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 43539900013E Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b="PyOW/6Go"; dmarc=pass (policy=none) header.from=bytedance.com; spf=pass (imf29.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.210.182 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com X-Stat-Signature: gch3ppc8hwewfr5obhcmbtyte1478aqh X-HE-Tag: 1631605017-986164 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 inode allocation is supposed to use alloc_inode_sb(), so convert kmem_cache_alloc() to alloc_inode_sb(). Signed-off-by: Muchun Song --- fs/hfsplus/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/hfsplus/super.c b/fs/hfsplus/super.c index b9e3db3f855f..8479add998b5 100644 --- a/fs/hfsplus/super.c +++ b/fs/hfsplus/super.c @@ -624,7 +624,7 @@ static struct inode *hfsplus_alloc_inode(struct super_block *sb) { struct hfsplus_inode_info *i; - i = kmem_cache_alloc(hfsplus_inode_cachep, GFP_KERNEL); + i = alloc_inode_sb(sb, hfsplus_inode_cachep, GFP_KERNEL); return i ? &i->vfs_inode : NULL; } From patchwork Tue Sep 14 07:28:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12492035 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_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 DD61AC433F5 for ; Tue, 14 Sep 2021 07:37:05 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 8FD6460F21 for ; Tue, 14 Sep 2021 07:37:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 8FD6460F21 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 37A5F94000F; Tue, 14 Sep 2021 03:37:05 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3029A940007; Tue, 14 Sep 2021 03:37:05 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1A3A994000F; Tue, 14 Sep 2021 03:37:05 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0171.hostedemail.com [216.40.44.171]) by kanga.kvack.org (Postfix) with ESMTP id 0C4F2940007 for ; Tue, 14 Sep 2021 03:37:05 -0400 (EDT) Received: from smtpin14.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id C670C2BA99 for ; Tue, 14 Sep 2021 07:37:04 +0000 (UTC) X-FDA: 78585372768.14.673A281 Received: from mail-pf1-f172.google.com (mail-pf1-f172.google.com [209.85.210.172]) by imf08.hostedemail.com (Postfix) with ESMTP id 8EA0A30000A9 for ; Tue, 14 Sep 2021 07:37:04 +0000 (UTC) Received: by mail-pf1-f172.google.com with SMTP id 18so11318731pfh.9 for ; Tue, 14 Sep 2021 00:37:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=v0G9QgPg+hfzr8x+8Bx7OvscmO6lHALpSRI/OEyBuHk=; b=uATwrDbNiKHs9A7JcSMurQYgFjrqGaAO75qRq8TzmBt1Rpc2g67hGH2yRdHL4jZi4G hYnWKMCzOyhKim3DowkY0wtEoLF2nGbkmHrkrR5ZCNto7iZ31dVwTvv3/hGqSgD1On4O B0ZV5zdqMy/vIb9hXB4LxN/ZT7qcw3bhzAzXJa9xvIP26Fs0Z8oDVn2uERxib8SKqySV l1eNsBvpM1/48WN2d9Cvc6KA5W9rebm12c3l7Gp188hSoC4uzgVZJ5ENUmKoNfO2XC8w o29ubWCMaEQEPnOXZEBR+pzVqP9EuZu3b4YQRgUAbJYR7Twx1UOwT1Z04DCXTFSjcOzW KviQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=v0G9QgPg+hfzr8x+8Bx7OvscmO6lHALpSRI/OEyBuHk=; b=XnbENPS7N5nlmvRrfb8q5xgYS1aY4cGsQdBVzdPsVRJP/S0eIX8b2eWwxORJbO0+U2 tgu/L8YyZT3bx/35SQn+FjQWQqFJ30p8Pc0sui/7CBDWKEPwyVsrXIhkU76nnSpSZ4CC 0EwVpMOSbIWA16fOEU/ZGZg/sp4iNNHoQ9Uu0sYW0hVuMHR2tn3RKqc9P4ufnkpKUXl2 aVh13WB+FVScHrd5aYPePkYX0gSybD789WQScW9a5Y7CmFP/BZCBmtOTT/z8+KKcFbNH q14K7oXEuJ4yXGi4JfSxKn0rGzsybevxd/Q4rp/ne7e8nJYzOjN78zTwpvVCCS6WA5xL 4d7g== X-Gm-Message-State: AOAM532RS3C1E+7nCFwcrxTwzCZuFhR0QNMz94U8P0mSSaeTaRv7ARFl R7GI1ZE5z+f9S0Bpeq+K2/8vug== X-Google-Smtp-Source: ABdhPJxFZacq7xaIgBaomiZ8xQ8HnyQqJjq+FaOSbVOzDFUzBUGypQEmmhDAS0VvitHHAR9ty4tO1Q== X-Received: by 2002:a05:6a00:2a2:b0:43d:ea13:9c06 with SMTP id q2-20020a056a0002a200b0043dea139c06mr3386511pfs.37.1631605023758; Tue, 14 Sep 2021 00:37:03 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.244]) by smtp.gmail.com with ESMTPSA id s3sm9377839pfd.188.2021.09.14.00.36.56 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Sep 2021 00:37:03 -0700 (PDT) From: Muchun Song To: willy@infradead.org, akpm@linux-foundation.org, hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, shakeelb@google.com, guro@fb.com, shy828301@gmail.com, alexs@kernel.org, richard.weiyang@gmail.com, david@fromorbit.com, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, zhengqi.arch@bytedance.com, duanxiongchun@bytedance.com, fam.zheng@bytedance.com, smuchun@gmail.com, Muchun Song Subject: [PATCH v3 34/76] hostfs: allocate inode by using alloc_inode_sb() Date: Tue, 14 Sep 2021 15:28:56 +0800 Message-Id: <20210914072938.6440-35-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20210914072938.6440-1-songmuchun@bytedance.com> References: <20210914072938.6440-1-songmuchun@bytedance.com> MIME-Version: 1.0 X-Stat-Signature: bsosknbzjgtoauo9ckwokghfi3s65o9b Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=uATwrDbN; dmarc=pass (policy=none) header.from=bytedance.com; spf=pass (imf08.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.210.172 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 8EA0A30000A9 X-HE-Tag: 1631605024-852882 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 inode allocation is supposed to use alloc_inode_sb(), so convert kmem_cache_alloc() to alloc_inode_sb(). Signed-off-by: Muchun Song --- fs/hostfs/hostfs_kern.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/hostfs/hostfs_kern.c b/fs/hostfs/hostfs_kern.c index d5c9d886cd9f..2123d2bed55b 100644 --- a/fs/hostfs/hostfs_kern.c +++ b/fs/hostfs/hostfs_kern.c @@ -222,7 +222,7 @@ static struct inode *hostfs_alloc_inode(struct super_block *sb) { struct hostfs_inode_info *hi; - hi = kmem_cache_alloc(hostfs_inode_cache, GFP_KERNEL_ACCOUNT); + hi = alloc_inode_sb(sb, hostfs_inode_cache, GFP_KERNEL_ACCOUNT); if (hi == NULL) return NULL; hi->fd = -1; From patchwork Tue Sep 14 07:28:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12492037 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_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 448CDC433F5 for ; Tue, 14 Sep 2021 07:37:13 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E317660F21 for ; Tue, 14 Sep 2021 07:37:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org E317660F21 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 88314900002; Tue, 14 Sep 2021 03:37:12 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 80BBD6B0071; Tue, 14 Sep 2021 03:37:12 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6D343900002; Tue, 14 Sep 2021 03:37:12 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0235.hostedemail.com [216.40.44.235]) by kanga.kvack.org (Postfix) with ESMTP id 5F4566B006C for ; Tue, 14 Sep 2021 03:37:12 -0400 (EDT) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 2B5062AF1F for ; Tue, 14 Sep 2021 07:37:12 +0000 (UTC) X-FDA: 78585373104.07.8439704 Received: from mail-pj1-f49.google.com (mail-pj1-f49.google.com [209.85.216.49]) by imf22.hostedemail.com (Postfix) with ESMTP id D19181904 for ; Tue, 14 Sep 2021 07:37:11 +0000 (UTC) Received: by mail-pj1-f49.google.com with SMTP id k23so8267429pji.0 for ; Tue, 14 Sep 2021 00:37:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=5iPQxmNGx8c9eY92mOopijUPDhnAgGjqRDHLpg8cWBc=; b=KnZSj8IleHoM8Qx7qtmx3jQgoCMLpLoyaVdHTTemIHbLy0HrzLLLGL2+x8Wvaaut2w GfGAmMnE/WY1PQtlqD4lXmGKfLluDTSogGWQ5fTa2VSkpA2bbn+SHjpxleHUPRe2fXOA VuZgEkG6inLqa8VANrweOCbrTdb0r5FWN5luXOcT4540XcPRSjY6SYPCfHYDggNXT9di lS0LbesxwPuQlNRDJfWT6a1UIBefry9JgwLo4oLwVtYP/U8c8QUPcgBj4tqShi7FJDd9 nyEh0jfTQFRcSbHb86SJ9ndHBs7qHNa9KKuGp3NcGROL/MUGCqcfvr1I+hyyoV/G/mUu NqNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=5iPQxmNGx8c9eY92mOopijUPDhnAgGjqRDHLpg8cWBc=; b=vIGhUX6xJc2H4PXQI/8LU81Yzk6gqQt4jIVeXdLUgngPHtS2cvO6V33uz5DRLp+tec 6VioKVps5bukUDIJzF68KEIT3wIly+bRr5RGpA4ZxTT02K8h6Bz30yCz3Nl3Xhmx6Qfj aarwHDmJg+tS6IMcIxWnVpxm9i1tA46gL25MHVUevaGc9F9wTj+m3XtXRWWNRhPyOqKy zM2CXcTW8kLa5x4N5HddXTnRZDmDLtibA4TQQOpqfCnrTWfqspwJsyLDBu0oaOJvKqHz IOJOR+nWBAU7bqXkgxxvIyfR82JM1VYvVwvhvmv+/xcqDxSC5cY5cEF/G0M22TMtb1hE r1RQ== X-Gm-Message-State: AOAM5313+FN+EARfeUoynesiGmmM5hxM4wJIz5xEpadJekX2cXNCV2Ob EbTtuVpqFTRGO9W+/auKCN3DTg== X-Google-Smtp-Source: ABdhPJxSG/kZh9LKDmkEuJyth73ipjaHCl1rtnOHTh4Hm2UylXX9XWCMskyVYqB8MJ5g19LpZwHl9Q== X-Received: by 2002:a17:90a:d516:: with SMTP id t22mr558209pju.208.1631605031038; Tue, 14 Sep 2021 00:37:11 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.244]) by smtp.gmail.com with ESMTPSA id s3sm9377839pfd.188.2021.09.14.00.37.04 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Sep 2021 00:37:10 -0700 (PDT) From: Muchun Song To: willy@infradead.org, akpm@linux-foundation.org, hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, shakeelb@google.com, guro@fb.com, shy828301@gmail.com, alexs@kernel.org, richard.weiyang@gmail.com, david@fromorbit.com, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, zhengqi.arch@bytedance.com, duanxiongchun@bytedance.com, fam.zheng@bytedance.com, smuchun@gmail.com, Muchun Song Subject: [PATCH v3 35/76] hpfs: allocate inode by using alloc_inode_sb() Date: Tue, 14 Sep 2021 15:28:57 +0800 Message-Id: <20210914072938.6440-36-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20210914072938.6440-1-songmuchun@bytedance.com> References: <20210914072938.6440-1-songmuchun@bytedance.com> MIME-Version: 1.0 X-Stat-Signature: bs4fzoekqfq69kysiiuau76f7q7zhes9 Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=KnZSj8Il; dmarc=pass (policy=none) header.from=bytedance.com; spf=pass (imf22.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.216.49 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: D19181904 X-HE-Tag: 1631605031-799691 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 inode allocation is supposed to use alloc_inode_sb(), so convert kmem_cache_alloc() to alloc_inode_sb(). Signed-off-by: Muchun Song --- fs/hpfs/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/hpfs/super.c b/fs/hpfs/super.c index a7dbfc892022..1cb89595b875 100644 --- a/fs/hpfs/super.c +++ b/fs/hpfs/super.c @@ -232,7 +232,7 @@ static struct kmem_cache * hpfs_inode_cachep; static struct inode *hpfs_alloc_inode(struct super_block *sb) { struct hpfs_inode_info *ei; - ei = kmem_cache_alloc(hpfs_inode_cachep, GFP_NOFS); + ei = alloc_inode_sb(sb, hpfs_inode_cachep, GFP_NOFS); if (!ei) return NULL; return &ei->vfs_inode; From patchwork Tue Sep 14 07:28:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12492039 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_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 881A8C433FE for ; Tue, 14 Sep 2021 07:37:21 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 41AEC61213 for ; Tue, 14 Sep 2021 07:37:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 41AEC61213 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id E00CA6B006C; Tue, 14 Sep 2021 03:37:20 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D89B694000B; Tue, 14 Sep 2021 03:37:20 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BDC61940007; Tue, 14 Sep 2021 03:37:20 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0169.hostedemail.com [216.40.44.169]) by kanga.kvack.org (Postfix) with ESMTP id AFE066B006C for ; Tue, 14 Sep 2021 03:37:20 -0400 (EDT) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 74C8C2D3A3 for ; Tue, 14 Sep 2021 07:37:20 +0000 (UTC) X-FDA: 78585373440.16.A33CBF4 Received: from mail-pg1-f178.google.com (mail-pg1-f178.google.com [209.85.215.178]) by imf09.hostedemail.com (Postfix) with ESMTP id 3D2883000106 for ; Tue, 14 Sep 2021 07:37:20 +0000 (UTC) Received: by mail-pg1-f178.google.com with SMTP id f129so11936926pgc.1 for ; Tue, 14 Sep 2021 00:37:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=WnGM/PRTC9jwFbDFCB/2m9CedfSUEGg6Hy8faW8vi6Q=; b=OhYR8FWISzxldmNkyTeWRV+8xTGvr4dqB4cS2QUDh23NDVHpiZ1n957iYAnpMHFAlQ WhZ5S1+/jgEl9pdC2hn4i0f2pPXPFZ9ev8JPEv7ywnd4llEFF8FkoxwFC33ctp5VUjiZ ar2gT7OmgM9vODLaK9lBpHihej376ah/Kg3kTvAJmyozWOLtMuQfzwg0UblBH9gJDUP4 n2lwp/YkbrERfya3uHVQT0pkCjSeLkA/QUqOo1Om5Jw9zXXpSa+/eCo2TSvLlardxL9I 9ywIJKnAR8KkhS/xpu2lx8Rf6WAGTCv+ODR46zfpjOSCVE+8T0kMqA3gkg/uGget54Pt 9fRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=WnGM/PRTC9jwFbDFCB/2m9CedfSUEGg6Hy8faW8vi6Q=; b=goudgz+JqHyqVD/zMZxsGsL4WcBkrMceosUN1FjwaErsy5xm3IWyXVyyBBhn+cp1BL WOBhfc0aToIVe60ji/H3QXFvUTS+VM0CiuW5loh7aDTQeXhV4WiZPPg7B45dx21GQD1D mgFaA5xoVUCGslgfSAMW0US56SMbHD9XuizSQwtGfUUHUj8eZ4LemEmU5KZ6di7OG7Qv 0rCg9GGzoL9tZ6NfRBs84SnQH8jkSJLTru3hVbRU2ckwoSVaeu2FKLchk82+enu5riCn FrRfW1qUhX2BCwfdIQoM1NKAuHFFJ1A9oYruSqByXBGkf2p161pTutOCzGt/M3kLYJTr WmxQ== X-Gm-Message-State: AOAM531p/cfAv28SbwHTIJflS2ZisnqZQOebH+OzEtjZgAd4x5jv4Sgi hxgSJRkeeOVYE4UZhxQu5hkvYA== X-Google-Smtp-Source: ABdhPJznasl++Bo/8nsxFcSls7diNHfauicqmG5JsXp6/a9c5KW9mqNfxnfLFev5Q52O7vsAKyvHWw== X-Received: by 2002:a63:150e:: with SMTP id v14mr14430074pgl.126.1631605039422; Tue, 14 Sep 2021 00:37:19 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.244]) by smtp.gmail.com with ESMTPSA id s3sm9377839pfd.188.2021.09.14.00.37.11 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Sep 2021 00:37:19 -0700 (PDT) From: Muchun Song To: willy@infradead.org, akpm@linux-foundation.org, hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, shakeelb@google.com, guro@fb.com, shy828301@gmail.com, alexs@kernel.org, richard.weiyang@gmail.com, david@fromorbit.com, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, zhengqi.arch@bytedance.com, duanxiongchun@bytedance.com, fam.zheng@bytedance.com, smuchun@gmail.com, Muchun Song Subject: [PATCH v3 36/76] hugetlbfs: allocate inode by using alloc_inode_sb() Date: Tue, 14 Sep 2021 15:28:58 +0800 Message-Id: <20210914072938.6440-37-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20210914072938.6440-1-songmuchun@bytedance.com> References: <20210914072938.6440-1-songmuchun@bytedance.com> MIME-Version: 1.0 Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=OhYR8FWI; spf=pass (imf09.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.215.178 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com X-Stat-Signature: e7waip4h5h8ubas3t8ut8r7amz7hs9k9 X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 3D2883000106 X-HE-Tag: 1631605040-932493 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 inode allocation is supposed to use alloc_inode_sb(), so convert kmem_cache_alloc() to alloc_inode_sb(). Signed-off-by: Muchun Song --- fs/hugetlbfs/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c index cdfb1ae78a3f..b1885a3723f7 100644 --- a/fs/hugetlbfs/inode.c +++ b/fs/hugetlbfs/inode.c @@ -1109,7 +1109,7 @@ static struct inode *hugetlbfs_alloc_inode(struct super_block *sb) if (unlikely(!hugetlbfs_dec_free_inodes(sbinfo))) return NULL; - p = kmem_cache_alloc(hugetlbfs_inode_cachep, GFP_KERNEL); + p = alloc_inode_sb(sb, hugetlbfs_inode_cachep, GFP_KERNEL); if (unlikely(!p)) { hugetlbfs_inc_free_inodes(sbinfo); return NULL; From patchwork Tue Sep 14 07:28:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12492041 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_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 38195C433EF for ; Tue, 14 Sep 2021 07:37:28 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id DF27160238 for ; Tue, 14 Sep 2021 07:37:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org DF27160238 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 8F7796B0071; Tue, 14 Sep 2021 03:37:27 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8804D94000B; Tue, 14 Sep 2021 03:37:27 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 74962940007; Tue, 14 Sep 2021 03:37:27 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0170.hostedemail.com [216.40.44.170]) by kanga.kvack.org (Postfix) with ESMTP id 668EE6B0071 for ; Tue, 14 Sep 2021 03:37:27 -0400 (EDT) Received: from smtpin38.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 29C2E181B8AF2 for ; Tue, 14 Sep 2021 07:37:27 +0000 (UTC) X-FDA: 78585373734.38.FBAACF8 Received: from mail-pj1-f42.google.com (mail-pj1-f42.google.com [209.85.216.42]) by imf18.hostedemail.com (Postfix) with ESMTP id E8C054002088 for ; Tue, 14 Sep 2021 07:37:26 +0000 (UTC) Received: by mail-pj1-f42.google.com with SMTP id u13-20020a17090abb0db0290177e1d9b3f7so1467594pjr.1 for ; Tue, 14 Sep 2021 00:37:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Z46CAf++vWNuCvheHpcgLnfLOzy9VY+omC7eSMsVmCI=; b=eQSaW7lNBdHi5KgQh+gECuNfuAwoGGyc50ZyaMiu4wpArjjQ8tBFBQsn9xlNelCQmv 5OBK9Q/SXI6FRGMt9XGoScmrzTOb2U7PbWXM9NAETS4ja9/wswF+Gn/LrHnXAn0Z4fUL EWHBtDtcIIcLWoZGTmMyNdduKYiQQP2LBF0coVdVnNaTt3YM0pvs+TlXLvK4dSWJYMeV BkeFc6BO7cZz5FXVB8hX2fX6RalfjWZhAtKhpOvHLDnFm2pXBcSGbsISAn0sqIP/M1YZ /EZ+Z9xtEZqp4/704+ZMqJmj3XS8afiHk4EKSvX3WJfURXaHUhwVNgFktYnxkCSwOHv3 wq+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Z46CAf++vWNuCvheHpcgLnfLOzy9VY+omC7eSMsVmCI=; b=xGux7/7zDFbeyxVhxuXeUy7tfSso8ZN2A2+8KBSLH39DORycajI8/PbduJSvmJl06O vpfIHOiBPW7st6YMuYXEk3iLjj3Hn2T+EI48SIXK/Ng9dNNsnGxh/7rQi/BKSePIIJPL 72qTOoJ+uusxJnu59PFT2LQ8B+Ocn4OLuMYRrx0eBaHHtab4BNj5NqCq+uLnhjGZXDPs JMZSpcX6K7T06uxfpmEczO1H9CPuIKgCrAMxgj75DnCg2Gkq1aTmXe6ugm0LXY2COj/A vpkZ4J73DtgSQ2OO07eUrEUL9PnhCiP1tjZMhjXWdaCQ8oOClrIpKlVSeqGegvf8gIFL NRHQ== X-Gm-Message-State: AOAM5333B2NZGspbjoi4NPukM1+G7oGV0D8PytpoengU9a5yd+/Tr0Kn SdfkvsxtS9DT/FKfs7LdTr7cgA== X-Google-Smtp-Source: ABdhPJwj8mp/hBHtqM8sVnXiQ7xQ8bihltPI4ouJRqOv/AopUxToiy3SFXDC76z/VupeU/zM/k58uw== X-Received: by 2002:a17:90a:8817:: with SMTP id s23mr527246pjn.181.1631605046111; Tue, 14 Sep 2021 00:37:26 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.244]) by smtp.gmail.com with ESMTPSA id s3sm9377839pfd.188.2021.09.14.00.37.19 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Sep 2021 00:37:25 -0700 (PDT) From: Muchun Song To: willy@infradead.org, akpm@linux-foundation.org, hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, shakeelb@google.com, guro@fb.com, shy828301@gmail.com, alexs@kernel.org, richard.weiyang@gmail.com, david@fromorbit.com, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, zhengqi.arch@bytedance.com, duanxiongchun@bytedance.com, fam.zheng@bytedance.com, smuchun@gmail.com, Muchun Song Subject: [PATCH v3 37/76] isofs: allocate inode by using alloc_inode_sb() Date: Tue, 14 Sep 2021 15:28:59 +0800 Message-Id: <20210914072938.6440-38-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20210914072938.6440-1-songmuchun@bytedance.com> References: <20210914072938.6440-1-songmuchun@bytedance.com> MIME-Version: 1.0 X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: E8C054002088 X-Stat-Signature: ysr3a5ecbd4ew5krzpdhgk3tbz8dp4kk Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=eQSaW7lN; spf=pass (imf18.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.216.42 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com X-HE-Tag: 1631605046-870156 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 inode allocation is supposed to use alloc_inode_sb(), so convert kmem_cache_alloc() to alloc_inode_sb(). Signed-off-by: Muchun Song --- fs/isofs/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/isofs/inode.c b/fs/isofs/inode.c index 678e2c51b855..ea8fb73ae3e7 100644 --- a/fs/isofs/inode.c +++ b/fs/isofs/inode.c @@ -70,7 +70,7 @@ static struct kmem_cache *isofs_inode_cachep; static struct inode *isofs_alloc_inode(struct super_block *sb) { struct iso_inode_info *ei; - ei = kmem_cache_alloc(isofs_inode_cachep, GFP_KERNEL); + ei = alloc_inode_sb(sb, isofs_inode_cachep, GFP_KERNEL); if (!ei) return NULL; return &ei->vfs_inode; From patchwork Tue Sep 14 07:29:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12492043 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_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 ACEAFC433F5 for ; Tue, 14 Sep 2021 07:37:35 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 5E9A460F4A for ; Tue, 14 Sep 2021 07:37:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 5E9A460F4A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 06BBF940007; Tue, 14 Sep 2021 03:37:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id F36B76B0073; Tue, 14 Sep 2021 03:37:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DD781940007; Tue, 14 Sep 2021 03:37:34 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0156.hostedemail.com [216.40.44.156]) by kanga.kvack.org (Postfix) with ESMTP id CDD426B0072 for ; Tue, 14 Sep 2021 03:37:34 -0400 (EDT) Received: from smtpin06.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 944AF26DE9 for ; Tue, 14 Sep 2021 07:37:34 +0000 (UTC) X-FDA: 78585374028.06.BFAF244 Received: from mail-pf1-f172.google.com (mail-pf1-f172.google.com [209.85.210.172]) by imf08.hostedemail.com (Postfix) with ESMTP id 5C50130000A8 for ; Tue, 14 Sep 2021 07:37:34 +0000 (UTC) Received: by mail-pf1-f172.google.com with SMTP id n30so8648992pfq.5 for ; Tue, 14 Sep 2021 00:37:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=0tJ4LzCSiQNWlTK3v6ATr4GS5677vmJWHcgwSa7aCbg=; b=BXZkZbQfSd1qtezLFpJh8Hmqcad9Ntv+OyGHQ29vR2Mj6M0LFVrUWDUMYfLmUU1wvO KWuQ8ulc8fpG60BPuOQeoPfs95CDTRkTh+aLrQjk+MJc3jkMebS8bljQ+TSSe0y6PqdK x5Yswt2zN3uzOZGhos42+wGlhg6FW2DHfSg6AjX62Pu5bA8sxFovzAL/LtJgUzty/t8c oJN96DiB54fPw0Y4g6eMyj5qWFtsAdk+gFst6u+A8uJPIwc2t1uehq+0q3jdSKrmslsy W1snw7T7V6i0r923NINiMMN7+ZpI04pY9bAqgW2uYmxX9FF5jt8UqgPG70r5lQss7LmJ D/pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=0tJ4LzCSiQNWlTK3v6ATr4GS5677vmJWHcgwSa7aCbg=; b=07ZGSSrU0iqoOe5t9AdlpvMXQtMHqFPLWtL8/J+6RS17+GYRRfq9qq2CugcOecE6W/ O6f3IK38ePEUfiKCgSEMa6iG+OWywq1P6+Ouc0Oldq1at4mwAC4F9yzv7Zd9LjoyIx29 3jY9G0N/qOFd1r3fpm/DU+5U+onA21g45oBLep4oQJ1cD0aUYi2mfPHfTinI5/cfGFPa qg4aP0vhm4nfDMJTrOGDmHMCegCPzSCB09XfY9vHMy0nbP49UPMhkvKm1FzvOa3+pc04 bhphUZ8hWwWCnAoM9mVVDiYCXOQcVOiI4EOALePFW1PLJR1mON8EkVlYT6Vys/0VqBCg G4RQ== X-Gm-Message-State: AOAM532O4K/n+6M8ZQRWq8C+WR7YuJBYxALgjElrR+0IAa+0n11UiyoV m9oflZvNff841FZKMmJEWYqumg== X-Google-Smtp-Source: ABdhPJxKZ/dodBMrWu+ghMW0cf3Yf3jYjylcfThuGwO/YNFccWKegglZTgb34Bk4MJukfITA4YrVew== X-Received: by 2002:a05:6a00:a10:b0:412:448c:89c7 with SMTP id p16-20020a056a000a1000b00412448c89c7mr3397757pfh.83.1631605053581; Tue, 14 Sep 2021 00:37:33 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.244]) by smtp.gmail.com with ESMTPSA id s3sm9377839pfd.188.2021.09.14.00.37.26 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Sep 2021 00:37:32 -0700 (PDT) From: Muchun Song To: willy@infradead.org, akpm@linux-foundation.org, hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, shakeelb@google.com, guro@fb.com, shy828301@gmail.com, alexs@kernel.org, richard.weiyang@gmail.com, david@fromorbit.com, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, zhengqi.arch@bytedance.com, duanxiongchun@bytedance.com, fam.zheng@bytedance.com, smuchun@gmail.com, Muchun Song Subject: [PATCH v3 38/76] jffs2: allocate inode by using alloc_inode_sb() Date: Tue, 14 Sep 2021 15:29:00 +0800 Message-Id: <20210914072938.6440-39-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20210914072938.6440-1-songmuchun@bytedance.com> References: <20210914072938.6440-1-songmuchun@bytedance.com> MIME-Version: 1.0 Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=BXZkZbQf; spf=pass (imf08.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.210.172 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 5C50130000A8 X-Stat-Signature: 3wcwa5suyyhas7ub5iehqaha49fa4u6m X-HE-Tag: 1631605054-324534 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 inode allocation is supposed to use alloc_inode_sb(), so convert kmem_cache_alloc() to alloc_inode_sb(). Signed-off-by: Muchun Song --- fs/jffs2/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/jffs2/super.c b/fs/jffs2/super.c index 81ca58c10b72..7ea37f49f1e1 100644 --- a/fs/jffs2/super.c +++ b/fs/jffs2/super.c @@ -39,7 +39,7 @@ static struct inode *jffs2_alloc_inode(struct super_block *sb) { struct jffs2_inode_info *f; - f = kmem_cache_alloc(jffs2_inode_cachep, GFP_KERNEL); + f = alloc_inode_sb(sb, jffs2_inode_cachep, GFP_KERNEL); if (!f) return NULL; return &f->vfs_inode; From patchwork Tue Sep 14 07:29:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12492045 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_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 60CFFC433FE for ; Tue, 14 Sep 2021 07:37:42 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 149C260238 for ; Tue, 14 Sep 2021 07:37:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 149C260238 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id ACDDB94000B; Tue, 14 Sep 2021 03:37:41 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A7BA86B0073; Tue, 14 Sep 2021 03:37:41 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 96AA594000B; Tue, 14 Sep 2021 03:37:41 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0191.hostedemail.com [216.40.44.191]) by kanga.kvack.org (Postfix) with ESMTP id 888276B0072 for ; Tue, 14 Sep 2021 03:37:41 -0400 (EDT) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 4C7648249980 for ; Tue, 14 Sep 2021 07:37:41 +0000 (UTC) X-FDA: 78585374322.16.C5C6DB2 Received: from mail-pj1-f54.google.com (mail-pj1-f54.google.com [209.85.216.54]) by imf05.hostedemail.com (Postfix) with ESMTP id 0F7EC5058A37 for ; Tue, 14 Sep 2021 07:37:40 +0000 (UTC) Received: by mail-pj1-f54.google.com with SMTP id k23so8268463pji.0 for ; Tue, 14 Sep 2021 00:37:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ug2CfhnpXnTircvAyexMndzlOWvwUpbYkNH+XVMb7RY=; b=t+GIzASmHdVakA4h5l+IAozDzezhapoL3sp1pcm/t65BJX3rutl/KWV3Qm2QPbhjYz p/rRF+BphO+PrkXJilhr3xhnO2wB5hDhNE6uCCqWfyVH7Ad3pGBSIAHJO4FrLzNTrf5e ETmN4X1zqYqSimY9WNapyBUeOuVYn2nimycKQaUbBsdGVsSbuaNK4u+TDxc+R0bX+bnM akbw90cRwY9ax0h7jalRVbH4jUogRZITjRvHfLnF4Nqf3lSzi4bs84oRMgVMniknUq9V Qfq9QagKXmezJpUEaHacD1HAxC+kQsE5jjYZ8RLPY0/r/TSkhgNd6NK1BBdl5049vaD+ eZ2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ug2CfhnpXnTircvAyexMndzlOWvwUpbYkNH+XVMb7RY=; b=wmc2/8zBMBmtfp+vEynqAizxK73uEot6vAClNsxhmk64Da91M+fLozc2F0QQKC77hs ThiGlzJy5MLspmZqP1nts+eWLznPEk3IdrHd6KXpYh0owjQANjfYSR7/LT3xIpghRQCI fPStvMSbdzT8MplCnghNOviV4Me8w2oDZE8c11AUneP7U6YVKIqCsH70oDixB+oidrUh mtYzuULo1BZ+sHJvk/ynAq8TNbhiEh1WGMVmZiK/jtbODSimb3707izs/7BIc3hyxCoJ cHN97VuB87ZIfDZNa3NjMtJ0AxDFcihlX1N0wRPHcGHVnBeoTr+Ou6ljjtbIPeiQbIjn /vYg== X-Gm-Message-State: AOAM532H/KpXmJUG5eIIT86QMoTvXzb8fVIA+Y9X5Tz9IdRpHXIzULYU A2/XRZMzLP6BKS5qPIrOttu9+Q== X-Google-Smtp-Source: ABdhPJzoEWc0JweX9N6Ga3zaYNr1bmeJZgLXN1Uyt173hJeXuTknck19EkElbOg2kxH46qCDstqdiQ== X-Received: by 2002:a17:90a:ab07:: with SMTP id m7mr551052pjq.27.1631605060269; Tue, 14 Sep 2021 00:37:40 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.244]) by smtp.gmail.com with ESMTPSA id s3sm9377839pfd.188.2021.09.14.00.37.33 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Sep 2021 00:37:39 -0700 (PDT) From: Muchun Song To: willy@infradead.org, akpm@linux-foundation.org, hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, shakeelb@google.com, guro@fb.com, shy828301@gmail.com, alexs@kernel.org, richard.weiyang@gmail.com, david@fromorbit.com, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, zhengqi.arch@bytedance.com, duanxiongchun@bytedance.com, fam.zheng@bytedance.com, smuchun@gmail.com, Muchun Song Subject: [PATCH v3 39/76] jfs: allocate inode by using alloc_inode_sb() Date: Tue, 14 Sep 2021 15:29:01 +0800 Message-Id: <20210914072938.6440-40-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20210914072938.6440-1-songmuchun@bytedance.com> References: <20210914072938.6440-1-songmuchun@bytedance.com> MIME-Version: 1.0 Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=t+GIzASm; spf=pass (imf05.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.216.54 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 0F7EC5058A37 X-Stat-Signature: 3nnj4siqm5j1mxcy6w3r9d9bjkc3sdxm X-HE-Tag: 1631605060-596334 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 inode allocation is supposed to use alloc_inode_sb(), so convert kmem_cache_alloc() to alloc_inode_sb(). Signed-off-by: Muchun Song --- fs/jfs/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/jfs/super.c b/fs/jfs/super.c index 9030aeaf0f88..5e77b5769464 100644 --- a/fs/jfs/super.c +++ b/fs/jfs/super.c @@ -102,7 +102,7 @@ static struct inode *jfs_alloc_inode(struct super_block *sb) { struct jfs_inode_info *jfs_inode; - jfs_inode = kmem_cache_alloc(jfs_inode_cachep, GFP_NOFS); + jfs_inode = alloc_inode_sb(sb, jfs_inode_cachep, GFP_NOFS); if (!jfs_inode) return NULL; #ifdef CONFIG_QUOTA From patchwork Tue Sep 14 07:29:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12492047 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_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 1F4A3C433F5 for ; Tue, 14 Sep 2021 07:37:49 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C744B60F21 for ; Tue, 14 Sep 2021 07:37:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org C744B60F21 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 74A9F94000A; Tue, 14 Sep 2021 03:37:48 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6F9586B0074; Tue, 14 Sep 2021 03:37:48 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5C17C94000A; Tue, 14 Sep 2021 03:37:48 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0073.hostedemail.com [216.40.44.73]) by kanga.kvack.org (Postfix) with ESMTP id 4CF6E6B0073 for ; Tue, 14 Sep 2021 03:37:48 -0400 (EDT) Received: from smtpin33.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 104CB8249980 for ; Tue, 14 Sep 2021 07:37:48 +0000 (UTC) X-FDA: 78585374616.33.F4FB439 Received: from mail-pj1-f51.google.com (mail-pj1-f51.google.com [209.85.216.51]) by imf07.hostedemail.com (Postfix) with ESMTP id C864010000A7 for ; Tue, 14 Sep 2021 07:37:47 +0000 (UTC) Received: by mail-pj1-f51.google.com with SMTP id v19so5566390pjh.2 for ; Tue, 14 Sep 2021 00:37:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Pk/g/5Ewh/BWbS+r3Zv89u3wQLvB5lvkiHidZy1oV4s=; b=WcY1yPh80TMJjBnbbZGtw/GMPkEzyaMHqlULd/NRUKXt8pI4DFQ48vleP7H1vE+xgZ hRxFd59Mq4NsGlRtjpmK2x5LpWLAQYeQFBDqRmENDo32s1LIcASy5xWfUrYjkoZah/VQ oVxqt22Ky7knQ+tVD3kq3XyLg/uaBhHDTOxc6/ej4r5Net3HI8MccZjHzIigwFKdgea8 8PCWLWL82eHmzNQP69G+UrnMBcqm/xsVmXxC4b4wKzHRBu/EM8iYQg621F5+BXcaQvaG ay+FP0jNrKylQJlKN0ly0UWA/32zT83i11WoYwI8X4Jx7IHeJdR2TKFMAF7Ydcnwf2GF /fyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Pk/g/5Ewh/BWbS+r3Zv89u3wQLvB5lvkiHidZy1oV4s=; b=CBYV1HbKl3IicAYJQ95d7krEeLrREBLe9unG5H+/TEumaOjHmcK/N8g9jQhINCln8f /qoLJCS5gWluYFheGrKX5kFgEwq6VFDJ5p2ZLRpWGon0XRiJNn3D5FOzuzj7TsmIQVPB i7wKIG+GyV5m8nfMhiz9LuDBwdqIdoayrAa3GiGUSqx/Jr+TFsXTzFAWZjI3vkeyv/9v +l7booCuSI9F/bBYK2Bnt2Ld0Akfb7Nyi+3ve3u3+cwlaR6TECmUB6QUoUkq+2RGxPnq BuOWS6hchixAElvWczdG8hY5ereEz/flc/4R0nciu529FZ0EWuM48yR++7cIDi5baBe8 JwlA== X-Gm-Message-State: AOAM531i/f+X2rRtjhNLw6a45t18AGBMX46fVmZXMOpdu8Vci/ycyUJi gCKAKokY4ARk0LKyabjwKxA/Mg== X-Google-Smtp-Source: ABdhPJwAGMeu1lrF7aTg+QBhRC0+UWnw9p6bJoyt7yw1ZBNdvK+yJAu5u1J+ZNfa1KsLG6IJbI0Fcw== X-Received: by 2002:a17:90a:4ce3:: with SMTP id k90mr524134pjh.237.1631605067036; Tue, 14 Sep 2021 00:37:47 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.244]) by smtp.gmail.com with ESMTPSA id s3sm9377839pfd.188.2021.09.14.00.37.40 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Sep 2021 00:37:46 -0700 (PDT) From: Muchun Song To: willy@infradead.org, akpm@linux-foundation.org, hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, shakeelb@google.com, guro@fb.com, shy828301@gmail.com, alexs@kernel.org, richard.weiyang@gmail.com, david@fromorbit.com, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, zhengqi.arch@bytedance.com, duanxiongchun@bytedance.com, fam.zheng@bytedance.com, smuchun@gmail.com, Muchun Song Subject: [PATCH v3 40/76] minix: allocate inode by using alloc_inode_sb() Date: Tue, 14 Sep 2021 15:29:02 +0800 Message-Id: <20210914072938.6440-41-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20210914072938.6440-1-songmuchun@bytedance.com> References: <20210914072938.6440-1-songmuchun@bytedance.com> MIME-Version: 1.0 Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=WcY1yPh8; spf=pass (imf07.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.216.51 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com X-Stat-Signature: sptn484ci8x5j71osgqxd6uunow163fh X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: C864010000A7 X-HE-Tag: 1631605067-793749 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 inode allocation is supposed to use alloc_inode_sb(), so convert kmem_cache_alloc() to alloc_inode_sb(). Signed-off-by: Muchun Song --- fs/minix/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/minix/inode.c b/fs/minix/inode.c index a71f1cf894b9..8a0af80741b5 100644 --- a/fs/minix/inode.c +++ b/fs/minix/inode.c @@ -63,7 +63,7 @@ static struct kmem_cache * minix_inode_cachep; static struct inode *minix_alloc_inode(struct super_block *sb) { struct minix_inode_info *ei; - ei = kmem_cache_alloc(minix_inode_cachep, GFP_KERNEL); + ei = alloc_inode_sb(sb, minix_inode_cachep, GFP_KERNEL); if (!ei) return NULL; return &ei->vfs_inode; From patchwork Tue Sep 14 07:29:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12492049 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_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 8452EC433EF for ; Tue, 14 Sep 2021 07:37:55 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3A49B60F4A for ; Tue, 14 Sep 2021 07:37:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 3A49B60F4A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id D15C494000D; Tue, 14 Sep 2021 03:37:54 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CC55F6B0075; Tue, 14 Sep 2021 03:37:54 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B8D3294000D; Tue, 14 Sep 2021 03:37:54 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0156.hostedemail.com [216.40.44.156]) by kanga.kvack.org (Postfix) with ESMTP id A8B736B0074 for ; Tue, 14 Sep 2021 03:37:54 -0400 (EDT) Received: from smtpin37.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 77421181A3499 for ; Tue, 14 Sep 2021 07:37:54 +0000 (UTC) X-FDA: 78585374868.37.90B371E Received: from mail-pj1-f45.google.com (mail-pj1-f45.google.com [209.85.216.45]) by imf29.hostedemail.com (Postfix) with ESMTP id 3BDEB9000247 for ; Tue, 14 Sep 2021 07:37:54 +0000 (UTC) Received: by mail-pj1-f45.google.com with SMTP id m21-20020a17090a859500b00197688449c4so2101361pjn.0 for ; Tue, 14 Sep 2021 00:37:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=PmuZFesbpf8uQ/0U/I68C6j1VVIpTQ3yrDpf1uAvzL4=; b=bgSbC9nMXbIXpDtFIbUvIIBISucVdUce6cYRarD5Z+zO9DijpzRA0GAKx4Qr7XknRb IAa6m+MXFI0tcemn4JjcyIkXKnkn9KfmBAp/hMCGMwHnkAXA1BP6ikF+03Bm5Ofbae8/ /nTLzMwKnBb/FfZARyMkXjPhVfl/+/uAtq93mA8m+ZMqy1vcfPbnhArVMb/QC4peXL87 iq1K2GDZJvUR7B6LHv6aaUmHEYlmqlaAtPeJ5LVM/yKgO3U4JSdOOVUNKlESs8GBZJrc NWa/Tas0VNSeOvqaLMV2UYYE9Hu/CfqNNYdxpTPdtOZRg0ubamiyDOeOuH1ZgMlBLEUw D9Fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=PmuZFesbpf8uQ/0U/I68C6j1VVIpTQ3yrDpf1uAvzL4=; b=MiWRO0HTTpdqvL1cRhEnal5da0nfKLBLAYTvLIJ/V7BWKdwwMMvaz2hVn3zOHoLS9v FmQ8ETydpKkj8B0C1Dk55Q/GwMjrthyHGldJXMkQtolTBpxwkwtLgxdmQ2X8bi2bfCtZ rI6Skt8BQI6jlH/JE4I+QO0IrTlyTfYrj+6gzuEbvI0JdhvSgyTA1c44Dp4prMLf1UrK RsV9n0Ir7n001EOP+BGhEnNahjQQl/iocPM/1X05LAl5y/V/0wnwiUu9wPVaBkXIhYNM cnfMxXFXbycXFcxxksZDnoew9zL5o1yfb1ViFTSvvZrgrNpPHIHyLMCMcdXw9JUGRJYl rbKg== X-Gm-Message-State: AOAM531obpGVzOwkMiIoQJJ37llalm/9QmaEwD41qxohKRymrQFH/I+h d+nL+jfXnbig0OSKh8D2hIABbA== X-Google-Smtp-Source: ABdhPJw90nC1k6rLS9wrGcxTCSyCDkf3544V1/e7PHbcVflNDzWUqiUYKuHW04uAGZMqykcw6JX3Bw== X-Received: by 2002:a17:90b:390c:: with SMTP id ob12mr567246pjb.196.1631605073432; Tue, 14 Sep 2021 00:37:53 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.244]) by smtp.gmail.com with ESMTPSA id s3sm9377839pfd.188.2021.09.14.00.37.47 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Sep 2021 00:37:53 -0700 (PDT) From: Muchun Song To: willy@infradead.org, akpm@linux-foundation.org, hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, shakeelb@google.com, guro@fb.com, shy828301@gmail.com, alexs@kernel.org, richard.weiyang@gmail.com, david@fromorbit.com, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, zhengqi.arch@bytedance.com, duanxiongchun@bytedance.com, fam.zheng@bytedance.com, smuchun@gmail.com, Muchun Song Subject: [PATCH v3 41/76] nfs: allocate inode by using alloc_inode_sb() Date: Tue, 14 Sep 2021 15:29:03 +0800 Message-Id: <20210914072938.6440-42-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20210914072938.6440-1-songmuchun@bytedance.com> References: <20210914072938.6440-1-songmuchun@bytedance.com> MIME-Version: 1.0 X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 3BDEB9000247 X-Stat-Signature: n3tpdkg1hzub6y9a9ocxrd1x6mxbxp5t Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=bgSbC9nM; spf=pass (imf29.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.216.45 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com X-HE-Tag: 1631605074-984709 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 inode allocation is supposed to use alloc_inode_sb(), so convert kmem_cache_alloc() to alloc_inode_sb(). Signed-off-by: Muchun Song --- fs/nfs/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index 853213b3a209..b759264885e9 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c @@ -2221,7 +2221,7 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr) struct inode *nfs_alloc_inode(struct super_block *sb) { struct nfs_inode *nfsi; - nfsi = kmem_cache_alloc(nfs_inode_cachep, GFP_KERNEL); + nfsi = alloc_inode_sb(sb, nfs_inode_cachep, GFP_KERNEL); if (!nfsi) return NULL; nfsi->flags = 0UL; From patchwork Tue Sep 14 07:29:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12492051 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_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 4BDD5C433F5 for ; Tue, 14 Sep 2021 07:38:02 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 02D6560238 for ; Tue, 14 Sep 2021 07:38:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 02D6560238 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 9B9A06B0075; Tue, 14 Sep 2021 03:38:01 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9431A940010; Tue, 14 Sep 2021 03:38:01 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7E45094000E; Tue, 14 Sep 2021 03:38:01 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0250.hostedemail.com [216.40.44.250]) by kanga.kvack.org (Postfix) with ESMTP id 6DCE86B0075 for ; Tue, 14 Sep 2021 03:38:01 -0400 (EDT) Received: from smtpin36.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 35A94181BC816 for ; Tue, 14 Sep 2021 07:38:01 +0000 (UTC) X-FDA: 78585375162.36.014B657 Received: from mail-pf1-f179.google.com (mail-pf1-f179.google.com [209.85.210.179]) by imf06.hostedemail.com (Postfix) with ESMTP id E7187801A8A3 for ; Tue, 14 Sep 2021 07:38:00 +0000 (UTC) Received: by mail-pf1-f179.google.com with SMTP id y17so11332359pfl.13 for ; Tue, 14 Sep 2021 00:38:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Ve9NmyEqViIV//dT1LdQKGfIMDinAsMmZ30wI0oWs1c=; b=EK1/Er6hRnVX2fZvCHsw8jkFa2Ov0/UEkz1sfPKz4MtyYRIdqAmwWsSyxtzaII34Nz 9e83C/WbK0FuFRdNf91dfjq7dgGwtSNhk8uyhUMCzUu80LykfTTolGOAZVBRRERE/kYI 3rYNpkJXSsaVMbdOfjreRbbNjkfn+/koajYsJ9jNXdQZ4O33b/pzTWEC3+bG+sjaJ7SX VWDLjdaBoB9i2RiWWJdxJdwSucyjxxkAx2LLpJhF7/Zq9fyIE2WQI5evsxwxJfVZegsK 89iWFS2Mf9N0+v5ulDPu020wnvrnVNS5QcIsoELSBgldNohXdvu4JkCxEdF+FV7U8lTF Q5Cw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Ve9NmyEqViIV//dT1LdQKGfIMDinAsMmZ30wI0oWs1c=; b=CoDJoPnF2RCT5wz6/BKzu+8DfL95gaaUbsgOs8OgZnDWUzFI+9vgGzaChFS8Xx9XjY Sx3pMCYRVN73Ps7rN3tm3T80f0nH2xRmYm1cwsYdo0Dtut4IGhp4KQ8MxPQWmtl9SL1R mGZsawMTEjsG594/7vogdqUTEfmAD5WRVpE4l9lmaAcrzgrCmWS98fxo3SQw35EtRuwU 4iyjJk+BHXUfT9pi/zNZkMBw4XmyW8T20zZWsyCt5yFzGTS4bljoe7OrWX4hBnM0hihq JgR45m9WKmx1jMuZSYudVIw7GthVPyLt9EnnfMYooo9l2PsGCwXE21XOxndfTDl8hYJC y+6Q== X-Gm-Message-State: AOAM5312wQGLTJFa2KRiu+36wtdGiBxj7XAlLNrh1hqXKiu1PDW8HZTF rMbm0qDU6JU0Z+GvQ90nU/E/AA== X-Google-Smtp-Source: ABdhPJzeNhtU+sPaFsnWmu7S41gs1Nsar9HXfmTanwRyM0Ad3KnBzwvJjy1sI44y8s95uozfMgdnWw== X-Received: by 2002:a63:da49:: with SMTP id l9mr14258029pgj.277.1631605080003; Tue, 14 Sep 2021 00:38:00 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.244]) by smtp.gmail.com with ESMTPSA id s3sm9377839pfd.188.2021.09.14.00.37.53 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Sep 2021 00:37:59 -0700 (PDT) From: Muchun Song To: willy@infradead.org, akpm@linux-foundation.org, hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, shakeelb@google.com, guro@fb.com, shy828301@gmail.com, alexs@kernel.org, richard.weiyang@gmail.com, david@fromorbit.com, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, zhengqi.arch@bytedance.com, duanxiongchun@bytedance.com, fam.zheng@bytedance.com, smuchun@gmail.com, Muchun Song Subject: [PATCH v3 42/76] nilfs2: allocate inode by using alloc_inode_sb() Date: Tue, 14 Sep 2021 15:29:04 +0800 Message-Id: <20210914072938.6440-43-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20210914072938.6440-1-songmuchun@bytedance.com> References: <20210914072938.6440-1-songmuchun@bytedance.com> MIME-Version: 1.0 X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: E7187801A8A3 X-Stat-Signature: 8yg8d4gf36sm6nqz1exk93kmscocem1d Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b="EK1/Er6h"; spf=pass (imf06.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.210.179 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com X-HE-Tag: 1631605080-974425 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 inode allocation is supposed to use alloc_inode_sb(), so convert kmem_cache_alloc() to alloc_inode_sb(). Signed-off-by: Muchun Song --- fs/nilfs2/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/nilfs2/super.c b/fs/nilfs2/super.c index f6b2d280aab5..cf1de3ed9f8b 100644 --- a/fs/nilfs2/super.c +++ b/fs/nilfs2/super.c @@ -151,7 +151,7 @@ struct inode *nilfs_alloc_inode(struct super_block *sb) { struct nilfs_inode_info *ii; - ii = kmem_cache_alloc(nilfs_inode_cachep, GFP_NOFS); + ii = alloc_inode_sb(sb, nilfs_inode_cachep, GFP_NOFS); if (!ii) return NULL; ii->i_bh = NULL; From patchwork Tue Sep 14 07:29:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12492053 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_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 2C5FCC433EF for ; Tue, 14 Sep 2021 07:38:09 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D3D3960238 for ; Tue, 14 Sep 2021 07:38:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org D3D3960238 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 79705940010; Tue, 14 Sep 2021 03:38:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 750E094000E; Tue, 14 Sep 2021 03:38:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 60F03940010; Tue, 14 Sep 2021 03:38:08 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0151.hostedemail.com [216.40.44.151]) by kanga.kvack.org (Postfix) with ESMTP id 5338294000E for ; Tue, 14 Sep 2021 03:38:08 -0400 (EDT) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 1EB2E8249980 for ; Tue, 14 Sep 2021 07:38:08 +0000 (UTC) X-FDA: 78585375456.13.156A35D Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) by imf25.hostedemail.com (Postfix) with ESMTP id B2326B000181 for ; Tue, 14 Sep 2021 07:38:07 +0000 (UTC) Received: by mail-pl1-f175.google.com with SMTP id v1so7595086plo.10 for ; Tue, 14 Sep 2021 00:38:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=P8hlIcDfk0mow6llnUEv9/58AX1omPaJoCkY30fcKWY=; b=fGvI7crPN7y2wB7zugMSVMD934Rpx18owGNJqX667ywd7wjVyIEVf68TUocK6k8Biq 0qxPe5D1SShPrdfucXUFLWGS3ekJaSpwv32maWMZRKeiCb8roNmC00EUhRyPN6kyCs6h eMrUxk+YqESaxDXnJRE5Ojjd7g/Y7cnlqzM5KVuGCmweYIh6v065qQ1YlyZsFq3bdjRF hh3i2wJdIoIPvB6++RUiegYh9oxErKNxyyw50T1L+zev55HJf0ChPw7lfmILcARbqI+Y itOpA48+irtTc+zZzxHwFQty9pb1lM6NTEzw+TiwKNAgMmrH05j0JRZllHytGgz30WYl 1yHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=P8hlIcDfk0mow6llnUEv9/58AX1omPaJoCkY30fcKWY=; b=iDxrouyMBk03L5Qu8z/pLAhf5KXbV8S/WvTPyQIjptlj+bdG3M5pvP7ebkVkU+p8g6 LhiZjUbr0yPksbVPdPwRCII64p4Wc16sFP69N7hmg2cIcKWm1iP3lzzPznd+Nk4uirDg A6NRUe8pLkQTUJN+VRl2vepzm18IXJun4Vx4KVX/oxB5OtrbMytD0GI7kaOG2ZswRe2N vufx2sZx1OzZptalIl5b1w4XBgvkP9a/4Af0w4S/yokGka1VaZD11fUS0JvshcpXqBZf 431h/7UN5gsJfYs5hLr6o/yhihgoxqkrtIdn/7qSJr6I+G+G1n54WsniBUIVXyrxlzXh xCCQ== X-Gm-Message-State: AOAM530h1IiAFbkUXZVFpdj6oKebFBMEyo4SbkTAIP9LMa4Tcj3OHOD3 9WOXPgZgZaUCkP4u511tEljXCQ== X-Google-Smtp-Source: ABdhPJwdMtQMYVXYBSOM8G6vlPmp0Zlhj0YG5SwPDq2spUGsssa5kLTHoX9Qr5rBUcowcrrjr8bl1A== X-Received: by 2002:a17:902:dac6:b0:138:85a7:ef80 with SMTP id q6-20020a170902dac600b0013885a7ef80mr13793050plx.45.1631605086892; Tue, 14 Sep 2021 00:38:06 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.244]) by smtp.gmail.com with ESMTPSA id s3sm9377839pfd.188.2021.09.14.00.38.00 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Sep 2021 00:38:06 -0700 (PDT) From: Muchun Song To: willy@infradead.org, akpm@linux-foundation.org, hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, shakeelb@google.com, guro@fb.com, shy828301@gmail.com, alexs@kernel.org, richard.weiyang@gmail.com, david@fromorbit.com, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, zhengqi.arch@bytedance.com, duanxiongchun@bytedance.com, fam.zheng@bytedance.com, smuchun@gmail.com, Muchun Song Subject: [PATCH v3 43/76] ntfs: allocate inode by using alloc_inode_sb() Date: Tue, 14 Sep 2021 15:29:05 +0800 Message-Id: <20210914072938.6440-44-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20210914072938.6440-1-songmuchun@bytedance.com> References: <20210914072938.6440-1-songmuchun@bytedance.com> MIME-Version: 1.0 Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=fGvI7crP; spf=pass (imf25.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.214.175 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com X-Stat-Signature: rcn8hgfa6fdkzdx6sub8s6ig1myuq1ui X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: B2326B000181 X-HE-Tag: 1631605087-36372 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 inode allocation is supposed to use alloc_inode_sb(), so convert kmem_cache_alloc() to alloc_inode_sb(). Signed-off-by: Muchun Song --- fs/ntfs/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ntfs/inode.c b/fs/ntfs/inode.c index 4474adb393ca..fca18ac72b4f 100644 --- a/fs/ntfs/inode.c +++ b/fs/ntfs/inode.c @@ -310,7 +310,7 @@ struct inode *ntfs_alloc_big_inode(struct super_block *sb) ntfs_inode *ni; ntfs_debug("Entering."); - ni = kmem_cache_alloc(ntfs_big_inode_cache, GFP_NOFS); + ni = alloc_inode_sb(sb, ntfs_big_inode_cache, GFP_NOFS); if (likely(ni != NULL)) { ni->state = 0; return VFS_I(ni); From patchwork Tue Sep 14 07:29:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12492055 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_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 B743BC433EF for ; Tue, 14 Sep 2021 07:38:15 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 673A960F21 for ; Tue, 14 Sep 2021 07:38:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 673A960F21 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 12DBE900002; Tue, 14 Sep 2021 03:38:15 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0DF4594000E; Tue, 14 Sep 2021 03:38:15 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EE859900004; Tue, 14 Sep 2021 03:38:14 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0138.hostedemail.com [216.40.44.138]) by kanga.kvack.org (Postfix) with ESMTP id DEC67900002 for ; Tue, 14 Sep 2021 03:38:14 -0400 (EDT) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 9DD262D4C1 for ; Tue, 14 Sep 2021 07:38:14 +0000 (UTC) X-FDA: 78585375708.30.9B70ABB Received: from mail-pj1-f44.google.com (mail-pj1-f44.google.com [209.85.216.44]) by imf05.hostedemail.com (Postfix) with ESMTP id 6F13E505EABF for ; Tue, 14 Sep 2021 07:38:14 +0000 (UTC) Received: by mail-pj1-f44.google.com with SMTP id c13-20020a17090a558d00b00198e6497a4fso1450348pji.4 for ; Tue, 14 Sep 2021 00:38:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=kDI0Aoe7eT1WdPk/YAFlqrx6K3CnKuQcRsWNZhlvGYc=; b=xmAVwDPGqQgJ4ViOkNcgEdLsmrxLdgD4nzwJ67CzaKU4Gh5OML8j/82b/juelP9nDl dS02vJ+dVl8pzb/vku+BjPvvG9g9JYAl6me/jLf71Rea0xorlDpTO+z/wqztU5LcMFjA haYHB/sXqNfZU/nvJrwiOk3BiTzncYQb/wwxHn39vbv9kIRt6QG0O/faUEgjPtPyLVTG 5uEw3UynCL3jRk3K5yYBwxCToAxr+Av0xazp8WItfLAxdFWuFsd9TBb77caoXY1gTlfz r3J2wzT60oicpMvNiJyR01mTe8DFp/1DX3WKELu7cwnteoHIjIgHzBlgj8PoPSNmVSFX QPMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=kDI0Aoe7eT1WdPk/YAFlqrx6K3CnKuQcRsWNZhlvGYc=; b=KdHAh/SRghQ9Fkz2Dk48rKj5q+EycbFEttB5Lx1BmFXzyXiOr+npBp8m/vckLEhVFN cXDMSO1wW0V/5yTaVQNPKlowCbPuo5FyNydqv78u2m1F/+NlIPAt6g1auClqS3ihTbmC LUZ1tSYJvd5y9dSk0qJA9kF54zhCFpU4Dip8J3ZR/EjXZ9OO/RgwEnVTs6/tlvOQWN2a +RDSwboe+r3wxwmZCpvbBl4DVU62k10vQnFa89AbyNzcZE+jegGwaCaI3WR/x8R0MgQo Nso0kDBlN+cs/l3hXdGM2WRo/pI6prMBX6hLKd6yASZyPEZO/TAG7kMN3kuHDbPan1FI T3Ug== X-Gm-Message-State: AOAM533QnCEDVil0vH6RixqbVOFP1zXNV9mo7E5tt/39bimZskf2J3Te GJFHcB/Nc7u3oc73iIs54rGtww== X-Google-Smtp-Source: ABdhPJx4nRZTniyyUS2frGvxC8q+96wmQPLzlD/q8gPXNAbizsbYA949H3H7LiYRJPbuhZAhNGZDMw== X-Received: by 2002:a17:90a:12:: with SMTP id 18mr576576pja.104.1631605093651; Tue, 14 Sep 2021 00:38:13 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.244]) by smtp.gmail.com with ESMTPSA id s3sm9377839pfd.188.2021.09.14.00.38.07 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Sep 2021 00:38:13 -0700 (PDT) From: Muchun Song To: willy@infradead.org, akpm@linux-foundation.org, hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, shakeelb@google.com, guro@fb.com, shy828301@gmail.com, alexs@kernel.org, richard.weiyang@gmail.com, david@fromorbit.com, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, zhengqi.arch@bytedance.com, duanxiongchun@bytedance.com, fam.zheng@bytedance.com, smuchun@gmail.com, Muchun Song Subject: [PATCH v3 44/76] ocfs2: allocate inode by using alloc_inode_sb() Date: Tue, 14 Sep 2021 15:29:06 +0800 Message-Id: <20210914072938.6440-45-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20210914072938.6440-1-songmuchun@bytedance.com> References: <20210914072938.6440-1-songmuchun@bytedance.com> MIME-Version: 1.0 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 6F13E505EABF X-Stat-Signature: 31hw11nb9fe4q1bpfoaj1fs7oja1bk8x Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=xmAVwDPG; spf=pass (imf05.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.216.44 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com X-HE-Tag: 1631605094-592049 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 inode allocation is supposed to use alloc_inode_sb(), so convert kmem_cache_alloc() to alloc_inode_sb(). Signed-off-by: Muchun Song --- fs/ocfs2/dlmfs/dlmfs.c | 2 +- fs/ocfs2/super.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/ocfs2/dlmfs/dlmfs.c b/fs/ocfs2/dlmfs/dlmfs.c index fa0a14f199eb..e360543ad7e7 100644 --- a/fs/ocfs2/dlmfs/dlmfs.c +++ b/fs/ocfs2/dlmfs/dlmfs.c @@ -280,7 +280,7 @@ static struct inode *dlmfs_alloc_inode(struct super_block *sb) { struct dlmfs_inode_private *ip; - ip = kmem_cache_alloc(dlmfs_inode_cache, GFP_NOFS); + ip = alloc_inode_sb(sb, dlmfs_inode_cache, GFP_NOFS); if (!ip) return NULL; diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c index c86bd4e60e20..cf044448130f 100644 --- a/fs/ocfs2/super.c +++ b/fs/ocfs2/super.c @@ -549,7 +549,7 @@ static struct inode *ocfs2_alloc_inode(struct super_block *sb) { struct ocfs2_inode_info *oi; - oi = kmem_cache_alloc(ocfs2_inode_cachep, GFP_NOFS); + oi = alloc_inode_sb(sb, ocfs2_inode_cachep, GFP_NOFS); if (!oi) return NULL; From patchwork Tue Sep 14 07:29:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12492057 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_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 23ECDC433F5 for ; Tue, 14 Sep 2021 07:38:23 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id CCBA660F4A for ; Tue, 14 Sep 2021 07:38:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org CCBA660F4A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 6FA40940011; Tue, 14 Sep 2021 03:38:22 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6AA8394000E; Tue, 14 Sep 2021 03:38:22 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5723F940011; Tue, 14 Sep 2021 03:38:22 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0115.hostedemail.com [216.40.44.115]) by kanga.kvack.org (Postfix) with ESMTP id 479E594000E for ; Tue, 14 Sep 2021 03:38:22 -0400 (EDT) Received: from smtpin04.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 04C6518014EB7 for ; Tue, 14 Sep 2021 07:38:22 +0000 (UTC) X-FDA: 78585376044.04.FD6E671 Received: from mail-pf1-f180.google.com (mail-pf1-f180.google.com [209.85.210.180]) by imf20.hostedemail.com (Postfix) with ESMTP id B905AD0000AB for ; Tue, 14 Sep 2021 07:38:21 +0000 (UTC) Received: by mail-pf1-f180.google.com with SMTP id 18so11322371pfh.9 for ; Tue, 14 Sep 2021 00:38:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=t4KSe7AjEWCOQhYQ4BKRxMdYZ3ES9HItolt5HRTGpI0=; b=xzje0lYjgtiYHB/0iy5+pQyezpDMVsZnP2cxTJfS1TYBvIaCpk7rc+/+B6Z/Zxx6WW 8S0zvXD3c824X/qZyTd8IWPWU9M2jSXSysb3dbB6jDqSkEt+zYiV0VD4Mdtru/cROuke 5b+6ZQKuaJyFa9sfYE4SePn+eF6sswksdq/g4FLZsLQJUA3ZFj1EGXpxLbtchmZbaLG4 LR2jcADw4D0AjIpv+pnz93RAxWRGa+W4LUe2JYF7NfA51Ht1R50bhEPZlfbgI5m6/fsQ KBH4+cpE4O3pnNQpDc8mnlskadIdSSb5c65P8flpkapQUwG+6ZQRbEt7JhRqT5s55lKH qnDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=t4KSe7AjEWCOQhYQ4BKRxMdYZ3ES9HItolt5HRTGpI0=; b=N4GGsQxRD9fZCsoV6hxLt0RgQoAu/33AdA2AYpyPe1iDX7en6N4bEIsOXbHRHgHKGq 8eG4aL9ej4d05Bm8Sq4YgL79bqfN9/ZtA7A7JFcKi8/wCiDtszuK4c+N1/QI1h7GlywW nFuueMQgoDCOVMHfHuNrxmgo8ilUJjlAXyT166+l6wfTS031l/Nb6q2SGRouNQniCtRT qfv9GBvyNJ2CnhNJSue/HPDj4JtyIBKE/hq8o5enZo1XqBzl1+AB4g26EEFevcsjtV3l fEnlNxMANPiP5Hh21NSZ8bhI1DZZqnOBUN5FCmSGZ/65yM72YIIWhHiaVvtEyXCLffAm yVpg== X-Gm-Message-State: AOAM533prE8ssvYxeZSs4tk2RZGfZHr5/rugBzMDVzTJqbAvJIvx05nt dzmh9vFc6Z3fT+xopw3CsG8C7Q== X-Google-Smtp-Source: ABdhPJxryW6NCxFQfOwl0VgErjFN4YVibym7a89eiIqVNquSMjlh33A61h3eZANYF0n3jL0KiGKDtw== X-Received: by 2002:a62:870e:0:b0:416:4820:a208 with SMTP id i14-20020a62870e000000b004164820a208mr3430714pfe.0.1631605100936; Tue, 14 Sep 2021 00:38:20 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.244]) by smtp.gmail.com with ESMTPSA id s3sm9377839pfd.188.2021.09.14.00.38.13 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Sep 2021 00:38:20 -0700 (PDT) From: Muchun Song To: willy@infradead.org, akpm@linux-foundation.org, hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, shakeelb@google.com, guro@fb.com, shy828301@gmail.com, alexs@kernel.org, richard.weiyang@gmail.com, david@fromorbit.com, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, zhengqi.arch@bytedance.com, duanxiongchun@bytedance.com, fam.zheng@bytedance.com, smuchun@gmail.com, Muchun Song Subject: [PATCH v3 45/76] openpromfs: allocate inode by using alloc_inode_sb() Date: Tue, 14 Sep 2021 15:29:07 +0800 Message-Id: <20210914072938.6440-46-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20210914072938.6440-1-songmuchun@bytedance.com> References: <20210914072938.6440-1-songmuchun@bytedance.com> MIME-Version: 1.0 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: B905AD0000AB X-Stat-Signature: b5odc9otw688yj5mjttjiewmd3eif31y Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=xzje0lYj; spf=pass (imf20.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.210.180 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com X-HE-Tag: 1631605101-805697 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 inode allocation is supposed to use alloc_inode_sb(), so convert kmem_cache_alloc() to alloc_inode_sb(). Signed-off-by: Muchun Song --- fs/openpromfs/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/openpromfs/inode.c b/fs/openpromfs/inode.c index f825176ff4ed..f0b7f4d51a17 100644 --- a/fs/openpromfs/inode.c +++ b/fs/openpromfs/inode.c @@ -335,7 +335,7 @@ static struct inode *openprom_alloc_inode(struct super_block *sb) { struct op_inode_info *oi; - oi = kmem_cache_alloc(op_inode_cachep, GFP_KERNEL); + oi = alloc_inode_sb(sb, op_inode_cachep, GFP_KERNEL); if (!oi) return NULL; From patchwork Tue Sep 14 07:29:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12492059 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_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 DEFE0C433F5 for ; Tue, 14 Sep 2021 07:38:31 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 9597B60F4A for ; Tue, 14 Sep 2021 07:38:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 9597B60F4A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 3EEF4940012; Tue, 14 Sep 2021 03:38:31 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3A92B94000E; Tue, 14 Sep 2021 03:38:31 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 28BEE940012; Tue, 14 Sep 2021 03:38:31 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0114.hostedemail.com [216.40.44.114]) by kanga.kvack.org (Postfix) with ESMTP id 1844594000E for ; Tue, 14 Sep 2021 03:38:31 -0400 (EDT) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id D39272C59D for ; Tue, 14 Sep 2021 07:38:30 +0000 (UTC) X-FDA: 78585376380.11.5094505 Received: from mail-pf1-f175.google.com (mail-pf1-f175.google.com [209.85.210.175]) by imf09.hostedemail.com (Postfix) with ESMTP id 9BA623000105 for ; Tue, 14 Sep 2021 07:38:30 +0000 (UTC) Received: by mail-pf1-f175.google.com with SMTP id q22so11383162pfu.0 for ; Tue, 14 Sep 2021 00:38:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=5L3/NHaCGqFlXi1PgtyPXPldesWisd5M2MzkdPFswpU=; b=aawds+ZdgmQfgr4O19Bbjb1tnmHppDZeHQM28obpBAxc63f/d3ki+9vg8HMeNgCvZ9 l1fv4U38sV9NVGlyrHRR/L3biZ3qMuBgMcBJ9/4d/3OdwQf3VnFrxWRGbbepAVI7sArV AfkHKSDuNhvgEgZEYICVo1qqRY2XolcCiBTM1eqKKDTjabKr7vU/Ew7prI441h+yxe0U psjwfhIeEXa1UIUGkoULi4SOGfFHhOQyRxNyt5yf1UEVjJttnJu7DoFDtotNJ2hUvFWV UUH2szXMKPJVLVV9cXPKc0GnOYjr5NDBAiQOCIjsR5oBilqlzVRdV4l0VMHkUaTBja1J 3l4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=5L3/NHaCGqFlXi1PgtyPXPldesWisd5M2MzkdPFswpU=; b=3UEMFhLK823KnTqbGp4hRrXbZruTvQ5F+6crzA+dPQfM5lFZTPj2u+me/W4e6wHfEf 8/fLLlzfAMnpEuOmGMkQ9OiIYO3lpfhz3SOb3MQ5PnrKv+2FSzhxovnkQND0KcujwbTv DhiTzaCnF4y5Mm9p5pg6kg78RyT7jsqooOODVMRmATzF8GwL7rG8iobFZ1GLgJWB06I5 U+yuzTPOUvZAIvzzQj8QdV5UDfe9mFra/Oww/imAUeQ9SLsDCTdH8D84uqgKaYPIkq3e aKoWvdmRVDXB9jQ3iKQuS35B2HFHs8kuTYEnnotgxF8u4rV3tjeF6nlJ/2f2HqQUOQ6w 6GdQ== X-Gm-Message-State: AOAM531a9Kmm1jmQ9+ldHlJUD+qIBfoq1JPZibIk+F575CfLKP9stxU+ qKszwYhJDbWJwrqpSR+5NSHAGQ== X-Google-Smtp-Source: ABdhPJy8+rOLc14+gnFDljhOryw2SP31lFSN5DwaxpCdBACFxg01n2dIXxGl5EEh/bqyueZ408ipGg== X-Received: by 2002:a63:7454:: with SMTP id e20mr14244578pgn.136.1631605109791; Tue, 14 Sep 2021 00:38:29 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.244]) by smtp.gmail.com with ESMTPSA id s3sm9377839pfd.188.2021.09.14.00.38.21 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Sep 2021 00:38:29 -0700 (PDT) From: Muchun Song To: willy@infradead.org, akpm@linux-foundation.org, hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, shakeelb@google.com, guro@fb.com, shy828301@gmail.com, alexs@kernel.org, richard.weiyang@gmail.com, david@fromorbit.com, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, zhengqi.arch@bytedance.com, duanxiongchun@bytedance.com, fam.zheng@bytedance.com, smuchun@gmail.com, Muchun Song Subject: [PATCH v3 46/76] orangefs: allocate inode by using alloc_inode_sb() Date: Tue, 14 Sep 2021 15:29:08 +0800 Message-Id: <20210914072938.6440-47-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20210914072938.6440-1-songmuchun@bytedance.com> References: <20210914072938.6440-1-songmuchun@bytedance.com> MIME-Version: 1.0 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 9BA623000105 X-Stat-Signature: bs6gz3mkoczr7fp64qo71sxsbrrbqyq3 Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=aawds+Zd; spf=pass (imf09.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.210.175 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com X-HE-Tag: 1631605110-835320 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 inode allocation is supposed to use alloc_inode_sb(), so convert kmem_cache_alloc() to alloc_inode_sb(). Signed-off-by: Muchun Song --- fs/orangefs/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/orangefs/super.c b/fs/orangefs/super.c index 2f2e430461b2..1deb411ca5e8 100644 --- a/fs/orangefs/super.c +++ b/fs/orangefs/super.c @@ -106,7 +106,7 @@ static struct inode *orangefs_alloc_inode(struct super_block *sb) { struct orangefs_inode_s *orangefs_inode; - orangefs_inode = kmem_cache_alloc(orangefs_inode_cache, GFP_KERNEL); + orangefs_inode = alloc_inode_sb(sb, orangefs_inode_cache, GFP_KERNEL); if (!orangefs_inode) return NULL; From patchwork Tue Sep 14 07:29:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12492061 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_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 AB463C433F5 for ; Tue, 14 Sep 2021 07:38:39 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 56FB960F4A for ; Tue, 14 Sep 2021 07:38:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 56FB960F4A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id EE9E8940013; Tue, 14 Sep 2021 03:38:38 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E98E294000E; Tue, 14 Sep 2021 03:38:38 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D62AF940013; Tue, 14 Sep 2021 03:38:38 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0092.hostedemail.com [216.40.44.92]) by kanga.kvack.org (Postfix) with ESMTP id C53B494000E for ; Tue, 14 Sep 2021 03:38:38 -0400 (EDT) Received: from smtpin35.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 8AFC22D223 for ; Tue, 14 Sep 2021 07:38:38 +0000 (UTC) X-FDA: 78585376716.35.EFAB529 Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) by imf20.hostedemail.com (Postfix) with ESMTP id 51BC8D0000A7 for ; Tue, 14 Sep 2021 07:38:38 +0000 (UTC) Received: by mail-pl1-f177.google.com with SMTP id n18so7593717plp.7 for ; Tue, 14 Sep 2021 00:38:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=8Qc/LiwupPFvLM5PjYz1016FD4bXKawBQsMG6Y+2qQc=; b=Vt4T+99aUqqmK/2gRbOdiuTv8LFaIEnqMYscXlXYrrXZ9klxmtSKfdh8ea2MgqYSfO NnQS/Nsp4yjEsHeMD1eoI39VwM+q+33icicv11HpoRFb92fPs0y5B0jTlqWXyroZTm5L 27H0F/8ukxcLz+lzc4pkfDte0ofTVl1cM+AZck8nCWhKYWVMqez2otMrz/VdanyIjf6P 6QRsryXSIR/it0XwcnDjVH9lS5nRcQ/gs/WzzyXrch/ehXNE2TQHcyzBGMzZgNgibUfn 3a5saAN504MO3x0ZUlQR+AfRVeUKFLc+Up+oi5X5/beXqlWX1B/omQF66oO0u6ztjAJW zhzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=8Qc/LiwupPFvLM5PjYz1016FD4bXKawBQsMG6Y+2qQc=; b=5cy/khkLiz0MSzgt419f1yoZTwhGVQk+tT2C4gZ4FahQXT8KJou2k6Rvw0XxLofOSj yg8o42dt6SRMw9dB/nSZCpckgdA3EiDwvMMxPEdq4IFcLbKelow1GuIZnWweA7anKpOA VKb11topqPfZqL7V3XjYQOXfYwq2STYigpeGO1Kg8YgtbD/VtWV49gZLBjBCF1ieX2Hk zW1oyYUpX5lPIH6m+nKjnxWuRFijkuR6FfGrymTGP00+FZFUIyMMlykg3cDexncCVKng CLwjeTjPe2fODulyXc8RU6nF1cdZ1bbz0B6Fdis4GSUYnzmn9BPoizafwYwW2yCx+9Wn 31nw== X-Gm-Message-State: AOAM532qfou0g2HatmuTpZGDT5yT4DTtBFUKHGGLLGTTHnSmNcHWPbh1 tpnTn0Jak/7i3q7fn/B7P9Q1/w== X-Google-Smtp-Source: ABdhPJwnBjb+nXzxqyWjL0Fk9lx/rUaL7hrM3TuzCo/oPyxIZ3sIl5O4e3jS1LKm/iLzXYJDQo/5GA== X-Received: by 2002:a17:902:e0c1:b0:13b:76f5:c3b4 with SMTP id e1-20020a170902e0c100b0013b76f5c3b4mr13740150pla.85.1631605117505; Tue, 14 Sep 2021 00:38:37 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.244]) by smtp.gmail.com with ESMTPSA id s3sm9377839pfd.188.2021.09.14.00.38.30 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Sep 2021 00:38:37 -0700 (PDT) From: Muchun Song To: willy@infradead.org, akpm@linux-foundation.org, hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, shakeelb@google.com, guro@fb.com, shy828301@gmail.com, alexs@kernel.org, richard.weiyang@gmail.com, david@fromorbit.com, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, zhengqi.arch@bytedance.com, duanxiongchun@bytedance.com, fam.zheng@bytedance.com, smuchun@gmail.com, Muchun Song Subject: [PATCH v3 47/76] overlayfs: allocate inode by using alloc_inode_sb() Date: Tue, 14 Sep 2021 15:29:09 +0800 Message-Id: <20210914072938.6440-48-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20210914072938.6440-1-songmuchun@bytedance.com> References: <20210914072938.6440-1-songmuchun@bytedance.com> MIME-Version: 1.0 X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 51BC8D0000A7 X-Stat-Signature: k165xruxas1zsrpo9dc7mrcekg61tjgs Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=Vt4T+99a; spf=pass (imf20.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.214.177 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com X-HE-Tag: 1631605118-538723 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 inode allocation is supposed to use alloc_inode_sb(), so convert kmem_cache_alloc() to alloc_inode_sb(). Signed-off-by: Muchun Song --- fs/overlayfs/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c index 178daa5e82c9..0e2a38a0b857 100644 --- a/fs/overlayfs/super.c +++ b/fs/overlayfs/super.c @@ -174,7 +174,7 @@ static struct kmem_cache *ovl_inode_cachep; static struct inode *ovl_alloc_inode(struct super_block *sb) { - struct ovl_inode *oi = kmem_cache_alloc(ovl_inode_cachep, GFP_KERNEL); + struct ovl_inode *oi = alloc_inode_sb(sb, ovl_inode_cachep, GFP_KERNEL); if (!oi) return NULL; From patchwork Tue Sep 14 07:29:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12492063 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_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 A03E8C433EF for ; Tue, 14 Sep 2021 07:38:47 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 5240761029 for ; Tue, 14 Sep 2021 07:38:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 5240761029 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id EE95A940014; Tue, 14 Sep 2021 03:38:46 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E9A2C94000E; Tue, 14 Sep 2021 03:38:46 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D60EA940014; Tue, 14 Sep 2021 03:38:46 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0120.hostedemail.com [216.40.44.120]) by kanga.kvack.org (Postfix) with ESMTP id C558594000E for ; Tue, 14 Sep 2021 03:38:46 -0400 (EDT) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 8CE8D1804EA77 for ; Tue, 14 Sep 2021 07:38:46 +0000 (UTC) X-FDA: 78585377052.16.2F1E7D5 Received: from mail-pf1-f171.google.com (mail-pf1-f171.google.com [209.85.210.171]) by imf10.hostedemail.com (Postfix) with ESMTP id 5122D6001980 for ; Tue, 14 Sep 2021 07:38:46 +0000 (UTC) Received: by mail-pf1-f171.google.com with SMTP id e16so11354137pfc.6 for ; Tue, 14 Sep 2021 00:38:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=aplee84Zb9DYoAB52arCh7gLLArJ+QtTZ9BkGVcgL3k=; b=j/KITuWPMbeYdulQFVpeP/6fD0wVWiV4+zVQkMSI3HkkPRSP+6UzBOZTn/DmoIwtuB uVkKwiZKIEvgt2hIWH1jffF8/MDudPq8wolnKMz+MPQW0Twzt4nEZ7yNGYbN23SULu+P kfm0rJ+lud7zRbJDyVRoUiIeT2U25ECHdNNVR8FifNLG0U88xJb02YWMMw+1VWBYJv0X IrpPE96zahuNqa3wxty4Lm1YBWwFzyH7pdLBphKs2gahsTWQs/tFHqlnHsEGoZ1nT3aG XFxOFpWgHJXxA3Pfacjy+4fOQEI4QvRB9AzxhRJe6KTgEZ8TRBD4l+yG8TuH5pYtMuJ6 4Wng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=aplee84Zb9DYoAB52arCh7gLLArJ+QtTZ9BkGVcgL3k=; b=PPTkSwcNMfhQf2K6Re3ipdzpMgn2YXNmqYrK3Ik4ZwUUKX4KhJiM0W80MwFkk2ZUPL wzeDJW5dzhFm6EMh+MRSLQkix7Ac4CAx/0NJCYhu4hq98wGucG9/NIgPionK8KCPJhZa vmBXWg5DRXSGMo26eCIODqBU1S/3H8g7DpVHco4hztgHoIEFPaxhJWt1alQi7d76fx87 1Ifbby1Pdap5Adz4HnMRcvdSglWv3B9FfF69K0OiTczjXvQKSpVkR6/62S0WMZv/F8AM q9O2hhF3MlTHFDVw8AcDWAida/Z1SbZXlfWf+ljulKx57gzuxwXWRi1hyWZfQUWQIAZP 5FDA== X-Gm-Message-State: AOAM532aaH+6rXqr0LxoNG+ImIoDBL7xLWyGX5Ps7zWJK73n/Q1idwpk GsYs69IjX9g3/sKxnzPBSDgcwA== X-Google-Smtp-Source: ABdhPJykIrXy8sqRbqD6MNKLcstRJMKicys4LzbaDZQB+C6WEgf2Ke4IbCOJzMR4/p4v17199zqJ6w== X-Received: by 2002:a05:6a00:1147:b029:3e0:8c37:938e with SMTP id b7-20020a056a001147b02903e08c37938emr3328209pfm.65.1631605125499; Tue, 14 Sep 2021 00:38:45 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.244]) by smtp.gmail.com with ESMTPSA id s3sm9377839pfd.188.2021.09.14.00.38.37 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Sep 2021 00:38:45 -0700 (PDT) From: Muchun Song To: willy@infradead.org, akpm@linux-foundation.org, hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, shakeelb@google.com, guro@fb.com, shy828301@gmail.com, alexs@kernel.org, richard.weiyang@gmail.com, david@fromorbit.com, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, zhengqi.arch@bytedance.com, duanxiongchun@bytedance.com, fam.zheng@bytedance.com, smuchun@gmail.com, Muchun Song Subject: [PATCH v3 48/76] proc: allocate inode by using alloc_inode_sb() Date: Tue, 14 Sep 2021 15:29:10 +0800 Message-Id: <20210914072938.6440-49-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20210914072938.6440-1-songmuchun@bytedance.com> References: <20210914072938.6440-1-songmuchun@bytedance.com> MIME-Version: 1.0 X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 5122D6001980 X-Stat-Signature: ic8yh9wyyh4jqwdhy59aopjf9toetikr Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b="j/KITuWP"; spf=pass (imf10.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.210.171 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com X-HE-Tag: 1631605126-385593 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 inode allocation is supposed to use alloc_inode_sb(), so convert kmem_cache_alloc() to alloc_inode_sb(). Signed-off-by: Muchun Song --- fs/proc/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/proc/inode.c b/fs/proc/inode.c index 599eb724ff2d..cc0a406d3a19 100644 --- a/fs/proc/inode.c +++ b/fs/proc/inode.c @@ -66,7 +66,7 @@ static struct inode *proc_alloc_inode(struct super_block *sb) { struct proc_inode *ei; - ei = kmem_cache_alloc(proc_inode_cachep, GFP_KERNEL); + ei = alloc_inode_sb(sb, proc_inode_cachep, GFP_KERNEL); if (!ei) return NULL; ei->pid = NULL; From patchwork Tue Sep 14 07:29:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12492065 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_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 61F04C433F5 for ; Tue, 14 Sep 2021 07:38:54 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 15D9A61029 for ; Tue, 14 Sep 2021 07:38:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 15D9A61029 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id B3EF6940015; Tue, 14 Sep 2021 03:38:53 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AEF3894000E; Tue, 14 Sep 2021 03:38:53 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 99098940015; Tue, 14 Sep 2021 03:38:53 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0208.hostedemail.com [216.40.44.208]) by kanga.kvack.org (Postfix) with ESMTP id 8984894000E for ; Tue, 14 Sep 2021 03:38:53 -0400 (EDT) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 4A9991804EA77 for ; Tue, 14 Sep 2021 07:38:53 +0000 (UTC) X-FDA: 78585377346.01.11AAACA Received: from mail-pj1-f47.google.com (mail-pj1-f47.google.com [209.85.216.47]) by imf29.hostedemail.com (Postfix) with ESMTP id 13CA29000247 for ; Tue, 14 Sep 2021 07:38:52 +0000 (UTC) Received: by mail-pj1-f47.google.com with SMTP id lb1-20020a17090b4a4100b001993f863df2so2053757pjb.5 for ; Tue, 14 Sep 2021 00:38:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=lHAYrFVB3RupwivCJS+aERvoyQvRbyNrf4+TX1u/TIc=; b=dLa8zy+WFMum3slpu1hEamUL6WRBtZ2Mf8Xczm6b6ik9Lbn2bq+2CyXLI11zGlHD/b T0eOAqG8HIOqkPOPCdnATP8WQgVa/Tqanrkrt0b9DYB3Be859skSNP3LAKqljBYfz3or unMHOSaKJQ1tzFBGL6w0IBMawqgu/Ozsm/roPZrZ/ynSGGv1f/MHA95SBzKacryL1F9r 80lU8GdHzLN/yd2Yg1725qYCBtSRW7XkzlU3NMkSBEDB6SfljOHTDMpXH2KlRACjciBf 9Lw3cXONutEJawugdkQHx9FJbf7Jp6JjBD5e5FxmdqbH8KYbaWUhzDyFji+ZZqCxCTpw 8+cA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=lHAYrFVB3RupwivCJS+aERvoyQvRbyNrf4+TX1u/TIc=; b=ylIQyNCWKI3VRoTesMiEwhsU+lHVFjNiJ1Absstp/KOa/urqyP65/nauYiH/2EGH41 sCealknKnATduQyyuujCmWUfUFB1UDbmYTcKSartH1Ti7HxCeBN+tSUwetdqRlplQrwZ gUgS3S89VQHLgGVG2PQAo9Q6SE7irSPsFdeJ65c42PrQEU07HZuqBjzLsfr/ewLMV93b G9f9oZLOCjFZ84kqfebn+XPf9B0B8B5s+0//RCn22zIXS78YcWlcqraDxG6KFelfzdAd ltxQyOIdov+Sfp9BJWcNdTM9yLb+8YSjK9uA22pm7Drywi4feXGA2fMmeZjlzv/3UMs/ ZnDw== X-Gm-Message-State: AOAM530YQgu/1SEG1blD9WzvPV2qMk9IeOk1OgM8zeV8PlJ+Os0YyOQd +0Nd5yy4tPglB8LGv1xZ7ebZ8w== X-Google-Smtp-Source: ABdhPJyZ1gNoJwBwjSapufsGc0K+8Vsg5NtnDUWiyf6tHPBRFeHWboDHp+Gdig8QAOL5Yo1gLndiSQ== X-Received: by 2002:a17:90b:250e:: with SMTP id ns14mr582898pjb.84.1631605132200; Tue, 14 Sep 2021 00:38:52 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.244]) by smtp.gmail.com with ESMTPSA id s3sm9377839pfd.188.2021.09.14.00.38.45 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Sep 2021 00:38:51 -0700 (PDT) From: Muchun Song To: willy@infradead.org, akpm@linux-foundation.org, hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, shakeelb@google.com, guro@fb.com, shy828301@gmail.com, alexs@kernel.org, richard.weiyang@gmail.com, david@fromorbit.com, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, zhengqi.arch@bytedance.com, duanxiongchun@bytedance.com, fam.zheng@bytedance.com, smuchun@gmail.com, Muchun Song Subject: [PATCH v3 49/76] qnx4: allocate inode by using alloc_inode_sb() Date: Tue, 14 Sep 2021 15:29:11 +0800 Message-Id: <20210914072938.6440-50-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20210914072938.6440-1-songmuchun@bytedance.com> References: <20210914072938.6440-1-songmuchun@bytedance.com> MIME-Version: 1.0 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 13CA29000247 X-Stat-Signature: 77whfyqribsepcgt7gfn8nqo7jmosfbr Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=dLa8zy+W; spf=pass (imf29.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.216.47 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com X-HE-Tag: 1631605132-887701 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 inode allocation is supposed to use alloc_inode_sb(), so convert kmem_cache_alloc() to alloc_inode_sb(). Signed-off-by: Muchun Song --- fs/qnx4/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/qnx4/inode.c b/fs/qnx4/inode.c index 3fb7fc819b4f..a635bb6615e9 100644 --- a/fs/qnx4/inode.c +++ b/fs/qnx4/inode.c @@ -338,7 +338,7 @@ static struct kmem_cache *qnx4_inode_cachep; static struct inode *qnx4_alloc_inode(struct super_block *sb) { struct qnx4_inode_info *ei; - ei = kmem_cache_alloc(qnx4_inode_cachep, GFP_KERNEL); + ei = alloc_inode_sb(sb, qnx4_inode_cachep, GFP_KERNEL); if (!ei) return NULL; return &ei->vfs_inode; From patchwork Tue Sep 14 07:29:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12492067 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_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 1F966C433F5 for ; Tue, 14 Sep 2021 07:39:01 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id CC5B761029 for ; Tue, 14 Sep 2021 07:39:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org CC5B761029 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 747E994000C; Tue, 14 Sep 2021 03:39:00 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6F817940007; Tue, 14 Sep 2021 03:39:00 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5E6EA94000C; Tue, 14 Sep 2021 03:39:00 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0078.hostedemail.com [216.40.44.78]) by kanga.kvack.org (Postfix) with ESMTP id 4E8B8940007 for ; Tue, 14 Sep 2021 03:39:00 -0400 (EDT) Received: from smtpin14.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 200AF2D223 for ; Tue, 14 Sep 2021 07:39:00 +0000 (UTC) X-FDA: 78585377640.14.A3FE9DB Received: from mail-pg1-f176.google.com (mail-pg1-f176.google.com [209.85.215.176]) by imf10.hostedemail.com (Postfix) with ESMTP id C4F626001988 for ; Tue, 14 Sep 2021 07:38:59 +0000 (UTC) Received: by mail-pg1-f176.google.com with SMTP id f129so11940901pgc.1 for ; Tue, 14 Sep 2021 00:38:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=8tfJW48CdajlpEr//bxTkoQM7dMrKW0BR9obc+XDZx8=; b=CzL8a0WJBmY6SwGPNmLPx/k5vpDf+8VMg88jAVRQqxI8uyOwWeyOnsuhUhU/l4kER4 aeCe0udAbcUb4GAWt+t4EiUTZISaqaxp9peXfdvPVoL6noWYo8M4tGGheg9uOHYG6eNH 669wezAhWuJ+BeY+qERd2h0dSfMNu3A1VXQpepM5IxdgJP3GPE/NYVV1mt8MRnYwIHy3 96nb+luBrrhhMhM1BKpvpW6D9q1HKlWm2VlXh6nCJ2Vwkboqw/4eP7WwyPFXaMcNBbPs 3oFL4FKE29we0HsXSFnG/rI4aRI31n5M7t6jKM0YMjHXybZF1bwIBf/zRktmC3vze/+Y Xwyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=8tfJW48CdajlpEr//bxTkoQM7dMrKW0BR9obc+XDZx8=; b=vLJh2WYfSFMiXnNyJC2BiAiF+fAuqgLUTSvyDayoeq5C7LIF2UAIBhCn5HT5Z+8/at kVBWTzg59sufpGk4DqzcO4XcvgN0eEOfaasfy72V4Js062pD0/EyKyLqznCM+AOF0ur5 3eyefu7fwkxSvxaqqC6Gc/YlohMrBwWyyIPfzY2Mj5rjJY4HBTG3tDEubw2INOfRGpZU QRwd1L9JfPl/iK81QFFGlVMXN3Xu4kjSa6WcPcd6qOV0MZPkGMP6Poar1d8RwA0+hV1E jtwGv7+/BwvBB+qSUyPWNjcGt/kosWXJ5To1E/LTa09Pxi+k3ahe3gwoIPWX00UPePau 7xKQ== X-Gm-Message-State: AOAM531mC9iQSpND7aZjJ4q0y7bKeZuissDA4ABW3+v21y5wByL3vNpq qOdSboM9/UcjGBNdMgRKwokxmA== X-Google-Smtp-Source: ABdhPJx7F/RW3Hj4k+6kLMVkWPhpu4fKdKubdGsytH2FezipocHXumP+ARuMMHC88pPtbi/407OOxQ== X-Received: by 2002:a63:cf41:: with SMTP id b1mr14330436pgj.407.1631605138942; Tue, 14 Sep 2021 00:38:58 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.244]) by smtp.gmail.com with ESMTPSA id s3sm9377839pfd.188.2021.09.14.00.38.52 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Sep 2021 00:38:58 -0700 (PDT) From: Muchun Song To: willy@infradead.org, akpm@linux-foundation.org, hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, shakeelb@google.com, guro@fb.com, shy828301@gmail.com, alexs@kernel.org, richard.weiyang@gmail.com, david@fromorbit.com, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, zhengqi.arch@bytedance.com, duanxiongchun@bytedance.com, fam.zheng@bytedance.com, smuchun@gmail.com, Muchun Song Subject: [PATCH v3 50/76] qnx6: allocate inode by using alloc_inode_sb() Date: Tue, 14 Sep 2021 15:29:12 +0800 Message-Id: <20210914072938.6440-51-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20210914072938.6440-1-songmuchun@bytedance.com> References: <20210914072938.6440-1-songmuchun@bytedance.com> MIME-Version: 1.0 Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=CzL8a0WJ; spf=pass (imf10.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.215.176 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: C4F626001988 X-Stat-Signature: wxjjmtxd5fhzy3otfk3txyfpd86grx1y X-HE-Tag: 1631605139-725713 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000001, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: The inode allocation is supposed to use alloc_inode_sb(), so convert kmem_cache_alloc() to alloc_inode_sb(). Signed-off-by: Muchun Song --- fs/qnx6/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/qnx6/inode.c b/fs/qnx6/inode.c index 61191f7bdf62..9d8e7e9788a1 100644 --- a/fs/qnx6/inode.c +++ b/fs/qnx6/inode.c @@ -597,7 +597,7 @@ static struct kmem_cache *qnx6_inode_cachep; static struct inode *qnx6_alloc_inode(struct super_block *sb) { struct qnx6_inode_info *ei; - ei = kmem_cache_alloc(qnx6_inode_cachep, GFP_KERNEL); + ei = alloc_inode_sb(sb, qnx6_inode_cachep, GFP_KERNEL); if (!ei) return NULL; return &ei->vfs_inode; From patchwork Tue Sep 14 07:29:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12492069 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_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 AA906C433F5 for ; Tue, 14 Sep 2021 07:39:07 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 5E82A60F21 for ; Tue, 14 Sep 2021 07:39:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 5E82A60F21 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 0914794000E; Tue, 14 Sep 2021 03:39:07 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 040D8940007; Tue, 14 Sep 2021 03:39:06 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E4BE594000E; Tue, 14 Sep 2021 03:39:06 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0210.hostedemail.com [216.40.44.210]) by kanga.kvack.org (Postfix) with ESMTP id D4070940007 for ; Tue, 14 Sep 2021 03:39:06 -0400 (EDT) Received: from smtpin05.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 9E2EB8249980 for ; Tue, 14 Sep 2021 07:39:06 +0000 (UTC) X-FDA: 78585377892.05.12903D7 Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) by imf29.hostedemail.com (Postfix) with ESMTP id 64D63900013E for ; Tue, 14 Sep 2021 07:39:06 +0000 (UTC) Received: by mail-pl1-f180.google.com with SMTP id v1so7596646plo.10 for ; Tue, 14 Sep 2021 00:39:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=by9NfbxzyA9OaU41O415kc2mnEvP01WDocZm+uGoCXI=; b=lDvvzY0uEA3X/+hq1dQH9zDz/ubjo0Dqpy4DFm8dgjth7TNPsAgsg7nkg7/yqzvUE1 WqaLt5T+Soiuh5YENtaxfVOJsNK1dz9wvizCFZpKgtImRU3yCtYtTlqyr6jMw9iN7pUZ fcbXR/5eEZ2iyj28KJAddteqj3wGgAQ87gbMdap5r/uBLJqvwoX2GLTT/twasEGndVZO zRhg+pzuTp63xBaKB93cVBrd2qthIp4O68AQbutKy/WthW7fuhkauWwAUwnzXxCprZ0u hVvFagzNBb6FEOgL91BQx0mq1qH1a0XoBq0pG3yZ4Hz+HEPAPzhQTrMAxNivNB75M3Jf 7lJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=by9NfbxzyA9OaU41O415kc2mnEvP01WDocZm+uGoCXI=; b=vcAtbSXkWTxvqrF83epobEAESKeMwG15J6Z91D7I7C9bKrfxl4rF8OoYH0bR2j2CAZ jHu/vmrz+RMlwA8vQTqvqebRO12tauFQaCUczYMbPBsAJnmhPruShq64YPG7932WckKF gqQdUWVh4eBQ+DTi5SGcn6cIKvmDfY3B+345cMuxIMJ9BV0CuY/gFEVVZjsQ1cBgOxGt TX7yUdoN682Vmb5xKW7AceVyTT+CA7G/9o3FB20ehSkRYuosKsSToA161jcKzA0vEQvC HSW4PQssn+dIYeKiYHsrt7Irb2hgU6h77Gp6b+tz6SwKVv6r+hFBZiLumXspgHl2205J Ie8w== X-Gm-Message-State: AOAM5314balwCbDmNlOkdjxdSZ1Q+6NUV7Bt9+CUPqt1NvAPJASQSzf+ xVFXZhkVliQ0tSu7IKJ3K4kpKg== X-Google-Smtp-Source: ABdhPJwWCz+YhluUHhHodW2PrbNo6vi+zerFmcFdV98Ijs8yYhsRbP2lKnBz3Rx4FUr7kVF3FNyXBQ== X-Received: by 2002:a17:90a:12:: with SMTP id 18mr579942pja.104.1631605145552; Tue, 14 Sep 2021 00:39:05 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.244]) by smtp.gmail.com with ESMTPSA id s3sm9377839pfd.188.2021.09.14.00.38.59 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Sep 2021 00:39:05 -0700 (PDT) From: Muchun Song To: willy@infradead.org, akpm@linux-foundation.org, hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, shakeelb@google.com, guro@fb.com, shy828301@gmail.com, alexs@kernel.org, richard.weiyang@gmail.com, david@fromorbit.com, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, zhengqi.arch@bytedance.com, duanxiongchun@bytedance.com, fam.zheng@bytedance.com, smuchun@gmail.com, Muchun Song Subject: [PATCH v3 51/76] reiserfs: allocate inode by using alloc_inode_sb() Date: Tue, 14 Sep 2021 15:29:13 +0800 Message-Id: <20210914072938.6440-52-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20210914072938.6440-1-songmuchun@bytedance.com> References: <20210914072938.6440-1-songmuchun@bytedance.com> MIME-Version: 1.0 X-Stat-Signature: gzwafixm6ekuhyk3g7e66cce9yu7h3ik Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=lDvvzY0u; dmarc=pass (policy=none) header.from=bytedance.com; spf=pass (imf29.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.214.180 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 64D63900013E X-HE-Tag: 1631605146-586570 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 inode allocation is supposed to use alloc_inode_sb(), so convert kmem_cache_alloc() to alloc_inode_sb(). Signed-off-by: Muchun Song --- fs/reiserfs/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c index 58481f8d63d5..e7beba4dae09 100644 --- a/fs/reiserfs/super.c +++ b/fs/reiserfs/super.c @@ -639,7 +639,7 @@ static struct kmem_cache *reiserfs_inode_cachep; static struct inode *reiserfs_alloc_inode(struct super_block *sb) { struct reiserfs_inode_info *ei; - ei = kmem_cache_alloc(reiserfs_inode_cachep, GFP_KERNEL); + ei = alloc_inode_sb(sb, reiserfs_inode_cachep, GFP_KERNEL); if (!ei) return NULL; atomic_set(&ei->openers, 0); From patchwork Tue Sep 14 07:29:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12492071 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_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 79AA7C433FE for ; Tue, 14 Sep 2021 07:39:14 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3279A61029 for ; Tue, 14 Sep 2021 07:39:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 3279A61029 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id D13CB940016; Tue, 14 Sep 2021 03:39:13 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CC407940007; Tue, 14 Sep 2021 03:39:13 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B64B1940016; Tue, 14 Sep 2021 03:39:13 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0190.hostedemail.com [216.40.44.190]) by kanga.kvack.org (Postfix) with ESMTP id A7007940007 for ; Tue, 14 Sep 2021 03:39:13 -0400 (EDT) Received: from smtpin12.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 6AA4B2D4C1 for ; Tue, 14 Sep 2021 07:39:13 +0000 (UTC) X-FDA: 78585378186.12.D6E166C Received: from mail-pf1-f178.google.com (mail-pf1-f178.google.com [209.85.210.178]) by imf15.hostedemail.com (Postfix) with ESMTP id ECD45D000096 for ; Tue, 14 Sep 2021 07:39:12 +0000 (UTC) Received: by mail-pf1-f178.google.com with SMTP id w19so6959667pfn.12 for ; Tue, 14 Sep 2021 00:39:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=KLwSLItUUbxEPpVEnwv3KG1SZ3tGwAvn5sD4ZvAasTc=; b=nAekrZ8SZV3otNsv32xt5cXXTDRyz4rT+/2mGlHPWBZbfrdUVcKCVDBgu8lz9OFr6Q eefiAutrNR4OdBSiICnIdWzqTRfYHRW6CswBOzvni1kLgkveu7Khy9o1IC/yvwDPujPS ZbxDI8uDhYmPVAd+UYaKviTFfTiXARERhu+zHzKgMBHWWL9CFU9ADUYjrMvuQxN6w0gx Z8Qydwqs05G8IC/KolxN6Co9nr/vCbAxYUyXFQi39XcZ5/lGoawvabIkbyECvq6+5ij7 Cc/D2RObnncaivMpGinm1j17jyADvl/BDxd+Lh4/3v2709eHMswvJCUQ0eVloEbvF9hY JAjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=KLwSLItUUbxEPpVEnwv3KG1SZ3tGwAvn5sD4ZvAasTc=; b=p6lOeMF9MPjHlpANk3OTmWaTDKKAWMQPXelJ7G/q0Xa+o+YSY7cEtfr/T9OlmwFJPK gBJsncbNinIFI/vJZaYh+6VnVaCkCVPGH5LR1H+x6nAbcKK7zrca0zdTEgVmF+1T2Tk/ kpgzIH2Klpkw9uzvN3VUKYIVI874bYBfEbFrlv18Nr4sgZ4sTwp1DmyPwWrwLNB+Xep7 UNt7PQ7CcgljhW8cVK6bRS0ZDVYFHJ+iqCgdv1nPNPJcG3vxZlGXk78OwUf7pHcD0EZ0 xH/TRRyWbZl9n5lZsSz3zBisMmnoU6kahQtyHieQEt8cnulDwp432V7mU9u8QBIfSo9L Y1pg== X-Gm-Message-State: AOAM53249bwUfYdXxlrtz7RenMxfxpFb9sffycz/NvFh1NZLfxojukGg sk1Vj4MM7bwlRn9b8orRtnPfkA== X-Google-Smtp-Source: ABdhPJxyAZ06R6AcjWqBJbE24Y8W52oJPZDJl4pJ/f0ZzGzzDT6XNSmTMLkWlGAnZpRhNGK7SmMRKw== X-Received: by 2002:a62:1d10:0:b0:408:9989:3c88 with SMTP id d16-20020a621d10000000b0040899893c88mr3374356pfd.22.1631605152160; Tue, 14 Sep 2021 00:39:12 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.244]) by smtp.gmail.com with ESMTPSA id s3sm9377839pfd.188.2021.09.14.00.39.05 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Sep 2021 00:39:11 -0700 (PDT) From: Muchun Song To: willy@infradead.org, akpm@linux-foundation.org, hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, shakeelb@google.com, guro@fb.com, shy828301@gmail.com, alexs@kernel.org, richard.weiyang@gmail.com, david@fromorbit.com, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, zhengqi.arch@bytedance.com, duanxiongchun@bytedance.com, fam.zheng@bytedance.com, smuchun@gmail.com, Muchun Song Subject: [PATCH v3 52/76] romfs: allocate inode by using alloc_inode_sb() Date: Tue, 14 Sep 2021 15:29:14 +0800 Message-Id: <20210914072938.6440-53-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20210914072938.6440-1-songmuchun@bytedance.com> References: <20210914072938.6440-1-songmuchun@bytedance.com> MIME-Version: 1.0 X-Stat-Signature: rym3jxdcu771uti4gygnbi9gn11irg5y Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=nAekrZ8S; dmarc=pass (policy=none) header.from=bytedance.com; spf=pass (imf15.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.210.178 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: ECD45D000096 X-HE-Tag: 1631605152-737520 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 inode allocation is supposed to use alloc_inode_sb(), so convert kmem_cache_alloc() to alloc_inode_sb(). Signed-off-by: Muchun Song --- fs/romfs/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/romfs/super.c b/fs/romfs/super.c index 259f684d9236..9e6bbb4219de 100644 --- a/fs/romfs/super.c +++ b/fs/romfs/super.c @@ -375,7 +375,7 @@ static struct inode *romfs_alloc_inode(struct super_block *sb) { struct romfs_inode_info *inode; - inode = kmem_cache_alloc(romfs_inode_cachep, GFP_KERNEL); + inode = alloc_inode_sb(sb, romfs_inode_cachep, GFP_KERNEL); return inode ? &inode->vfs_inode : NULL; } From patchwork Tue Sep 14 07:29:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12492073 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_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 86FB7C433EF for ; Tue, 14 Sep 2021 07:39:21 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 35C1361056 for ; Tue, 14 Sep 2021 07:39:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 35C1361056 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id C9F1E940017; Tue, 14 Sep 2021 03:39:20 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C4F93940007; Tue, 14 Sep 2021 03:39:20 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B16A4940017; Tue, 14 Sep 2021 03:39:20 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id A1D4B940007 for ; Tue, 14 Sep 2021 03:39:20 -0400 (EDT) Received: from smtpin37.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 6883F18081B02 for ; Tue, 14 Sep 2021 07:39:20 +0000 (UTC) X-FDA: 78585378480.37.8D6F13A Received: from mail-pj1-f48.google.com (mail-pj1-f48.google.com [209.85.216.48]) by imf02.hostedemail.com (Postfix) with ESMTP id 364CD7001A0A for ; Tue, 14 Sep 2021 07:39:20 +0000 (UTC) Received: by mail-pj1-f48.google.com with SMTP id u13-20020a17090abb0db0290177e1d9b3f7so1471820pjr.1 for ; Tue, 14 Sep 2021 00:39:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=mHRI7i94nkkwALVkJUru65wTIGyTMAu5yxZLJ0urhMs=; b=WLFvf0yPGpxYDITgQsoRZISgK1oizMjzYNnbCPzbiVPdq7IswUpVIxTsw4DygWSs9y uw8VmNGrWvIgI1Z7O3sQslX3re3c0eiPxnRwtt+F2g3PKev2n5MSnVJTBE6y6AVbRPhv HzPzwHvAFcd4LTE2VwMAwljMc6uRFXkEiPsKrbPs3qly5ey42l/L1BPTOMSoA9ZEM91E MNCZL1crssjdApZjU/gh2xl53+6G92GXfk9+7Hs7m2k2minNnGwgqa2qNEYOjSirX6c+ csOZuB+w+r8rsjzG9WceNzCiTuYhYzZNTfrqjf5pdPzN4S39bm8v8pt5NGC+UsJ407lT qmPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=mHRI7i94nkkwALVkJUru65wTIGyTMAu5yxZLJ0urhMs=; b=Cn7wEzKpVo2pEmgATOpaIs752ikYi/KDVv35sM2A6KcmFaiql2ua4hbgWwVuu/gXZ8 iTNVLuY0DeoDvSlERBZA0iKKw8qlCzbL153JazdznR2BePwvJRP9iUQyNt9f6inbtw3+ kND+YajszsYqf5wYN8wNYupLj0RXvkjnrCsWSxiocFFSXC0Rs6LZtP0ZPlNbGsfxIVAc WtmTmpfGoi9OfwvAANDeGhRvy2Y7co0yzAFl65pEQLbN2Cor+oAoHxHYZ6VX1ksd8d4O XARdUOz1uWJJnfeiSzeFQoXMDgHEkNLGx1jWL2cNRqPjTIu9PkZ9cG4BX1VFDtA/6eoz TJFA== X-Gm-Message-State: AOAM5317GLj7XZU/98rjokLgwA5bKZUghgkr8LiA6Z/vcN30qXZ6424o pTNXFb3msZY+lekVsg8L/rVgAg== X-Google-Smtp-Source: ABdhPJy/HLUtiT+SQqdbf+XTfxJE1/QsuKyIRhd9fdS50+avblVckJ4d5s8cFJbFgkEZEIkF661tLw== X-Received: by 2002:a17:90a:d516:: with SMTP id t22mr566682pju.208.1631605159109; Tue, 14 Sep 2021 00:39:19 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.244]) by smtp.gmail.com with ESMTPSA id s3sm9377839pfd.188.2021.09.14.00.39.12 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Sep 2021 00:39:18 -0700 (PDT) From: Muchun Song To: willy@infradead.org, akpm@linux-foundation.org, hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, shakeelb@google.com, guro@fb.com, shy828301@gmail.com, alexs@kernel.org, richard.weiyang@gmail.com, david@fromorbit.com, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, zhengqi.arch@bytedance.com, duanxiongchun@bytedance.com, fam.zheng@bytedance.com, smuchun@gmail.com, Muchun Song Subject: [PATCH v3 53/76] squashfs: allocate inode by using alloc_inode_sb() Date: Tue, 14 Sep 2021 15:29:15 +0800 Message-Id: <20210914072938.6440-54-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20210914072938.6440-1-songmuchun@bytedance.com> References: <20210914072938.6440-1-songmuchun@bytedance.com> MIME-Version: 1.0 X-Stat-Signature: deo61gyy7yrob9acm37qsmzi89774inf Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=WLFvf0yP; dmarc=pass (policy=none) header.from=bytedance.com; spf=pass (imf02.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.216.48 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 364CD7001A0A X-HE-Tag: 1631605160-813116 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 inode allocation is supposed to use alloc_inode_sb(), so convert kmem_cache_alloc() to alloc_inode_sb(). Signed-off-by: Muchun Song --- fs/squashfs/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/squashfs/super.c b/fs/squashfs/super.c index 60d6951915f4..e51625e93b00 100644 --- a/fs/squashfs/super.c +++ b/fs/squashfs/super.c @@ -550,7 +550,7 @@ static void __exit exit_squashfs_fs(void) static struct inode *squashfs_alloc_inode(struct super_block *sb) { struct squashfs_inode_info *ei = - kmem_cache_alloc(squashfs_inode_cachep, GFP_KERNEL); + alloc_inode_sb(sb, squashfs_inode_cachep, GFP_KERNEL); return ei ? &ei->vfs_inode : NULL; } From patchwork Tue Sep 14 07:29:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12492075 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_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 1B35AC433F5 for ; Tue, 14 Sep 2021 07:39:28 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C305A60F4A for ; Tue, 14 Sep 2021 07:39:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org C305A60F4A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 6AC8B940018; Tue, 14 Sep 2021 03:39:27 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 65B5D940007; Tue, 14 Sep 2021 03:39:27 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 52320940018; Tue, 14 Sep 2021 03:39:27 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0173.hostedemail.com [216.40.44.173]) by kanga.kvack.org (Postfix) with ESMTP id 41630940007 for ; Tue, 14 Sep 2021 03:39:27 -0400 (EDT) Received: from smtpin25.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 029728249980 for ; Tue, 14 Sep 2021 07:39:27 +0000 (UTC) X-FDA: 78585378774.25.B8D9E83 Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) by imf26.hostedemail.com (Postfix) with ESMTP id B95F620019C3 for ; Tue, 14 Sep 2021 07:39:26 +0000 (UTC) Received: by mail-pl1-f180.google.com with SMTP id o8so4522830pll.1 for ; Tue, 14 Sep 2021 00:39:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=GnyAEe3d2TiVZpmYe6sQEf4ZzdDTOfGkYHI/ZKXydW4=; b=yMTl6iHpS7yMpDJa6emRP/798/2i8AWBdHk9JLeEuF/RDFOxwWc51GBkOw/SGLixkT ftk+WfR5/hwrDz08rAuXYurn10yNsk3i95MpALU212CvQyC+x2vPgb5QwJxZXg2ldJq8 Vyk/8HWpe2w8DmjsFLc5IjcJ1UgupWU7vP04uSHeCDjW3cBEehIeobpMnPix5qJL51eM cT8hiT9MKTN7hZIE2OzpEL9m7MgnFLZacJu8z+zKRNCmLA1luGqOOkLzFwkKE8/FKVYp vXEa9Tf6Scze/4dFYS7E3Qyk/pIxetVMT6y2WGE7jcLt699+aV3Y4yq1MW60VnkLWI+3 89VQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=GnyAEe3d2TiVZpmYe6sQEf4ZzdDTOfGkYHI/ZKXydW4=; b=3tHrlnGdvtAwz+GSXOC0N9IAm64npdo+iANgjqbU/L7iSod2GY6yJKwr8I+1lHVobw MFmVUFam47GqmAVP/84n6pM+0NrUGX24yiodxcxUwkdwSHCiy+PpmR8L3fuDmvhph5PJ yREYBuqAHAX/ZQBd8mOMVg05d94S4Ipd2f62+Vwq/zVav0ZgawIzIz2q4r96ytRpW3WL GAZCBxnw5AVGdthOPKaU2/jjK2J8RZiqFlrUeqUQHSLuq9QiFdQ3V6oODHLE/uN9RyMY +nSyp9iaI6YcXXcNSzlWE4vaf644qhVxAfeYVy3OD6K6b/XlpZ3a5EZVVSgfQnFPnK+g MagQ== X-Gm-Message-State: AOAM5334OHmTey/jcjps6Hlf3MCiA3M+q+up621ANFmR0y63PJWz/PW9 B0jYMKaSeRwZ38VT9XWbxW6U+Q== X-Google-Smtp-Source: ABdhPJzmRx2/jJtkjn7cdw4ltYah7hA6Trt9mfJsbQ974TSh8hhnpLfCH6CPvS2vjdnbP+u1WL2vTA== X-Received: by 2002:a17:902:ce84:b0:138:9422:512e with SMTP id f4-20020a170902ce8400b001389422512emr14199423plg.12.1631605165944; Tue, 14 Sep 2021 00:39:25 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.244]) by smtp.gmail.com with ESMTPSA id s3sm9377839pfd.188.2021.09.14.00.39.19 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Sep 2021 00:39:25 -0700 (PDT) From: Muchun Song To: willy@infradead.org, akpm@linux-foundation.org, hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, shakeelb@google.com, guro@fb.com, shy828301@gmail.com, alexs@kernel.org, richard.weiyang@gmail.com, david@fromorbit.com, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, zhengqi.arch@bytedance.com, duanxiongchun@bytedance.com, fam.zheng@bytedance.com, smuchun@gmail.com, Muchun Song Subject: [PATCH v3 54/76] sysv: allocate inode by using alloc_inode_sb() Date: Tue, 14 Sep 2021 15:29:16 +0800 Message-Id: <20210914072938.6440-55-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20210914072938.6440-1-songmuchun@bytedance.com> References: <20210914072938.6440-1-songmuchun@bytedance.com> MIME-Version: 1.0 X-Stat-Signature: at3sdns94q4n56iuqeh5dypdenzm8sjw Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=yMTl6iHp; dmarc=pass (policy=none) header.from=bytedance.com; spf=pass (imf26.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.214.180 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: B95F620019C3 X-HE-Tag: 1631605166-546924 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 inode allocation is supposed to use alloc_inode_sb(), so convert kmem_cache_alloc() to alloc_inode_sb(). Signed-off-by: Muchun Song --- fs/sysv/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/sysv/inode.c b/fs/sysv/inode.c index be47263b8605..9e8d4a6fb2f3 100644 --- a/fs/sysv/inode.c +++ b/fs/sysv/inode.c @@ -306,7 +306,7 @@ static struct inode *sysv_alloc_inode(struct super_block *sb) { struct sysv_inode_info *si; - si = kmem_cache_alloc(sysv_inode_cachep, GFP_KERNEL); + si = alloc_inode_sb(sb, sysv_inode_cachep, GFP_KERNEL); if (!si) return NULL; return &si->vfs_inode; From patchwork Tue Sep 14 07:29:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12492077 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_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 7841CC433EF for ; Tue, 14 Sep 2021 07:39:34 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 2AA7F6112E for ; Tue, 14 Sep 2021 07:39:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 2AA7F6112E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id C4FF9940008; Tue, 14 Sep 2021 03:39:33 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C0198940007; Tue, 14 Sep 2021 03:39:33 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AC865940008; Tue, 14 Sep 2021 03:39:33 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0093.hostedemail.com [216.40.44.93]) by kanga.kvack.org (Postfix) with ESMTP id 9C52D940007 for ; Tue, 14 Sep 2021 03:39:33 -0400 (EDT) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 5E6CA18150C51 for ; Tue, 14 Sep 2021 07:39:33 +0000 (UTC) X-FDA: 78585379026.07.575BB5B Received: from mail-pj1-f54.google.com (mail-pj1-f54.google.com [209.85.216.54]) by imf30.hostedemail.com (Postfix) with ESMTP id 2C6D2E001981 for ; Tue, 14 Sep 2021 07:39:33 +0000 (UTC) Received: by mail-pj1-f54.google.com with SMTP id m21-20020a17090a859500b00197688449c4so2104401pjn.0 for ; Tue, 14 Sep 2021 00:39:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Jq1ii8A4uQXumPf/NnNFLaE389Tt0HeSx3fXMRSpHEY=; b=mT4FkMAo0C9XvgGm7TTt1y2GGwp6xYsyTEyh37SSuVDZxf4eK7SKxsMqb30qkdoseX oKPLNqiO0xX7L7dj4fzYOpaFYrK0ux6Mob00Kaxx5nssQqOLDQQU9kq10h2rvO44/dKw dnxMA8j8877MzbRnf4MOF+sisgWX3j1StFcKANodUOY0BjcjxomePimI9sO0INBeGoja ysUOwHxnZdDmtmca/YNTEJ+JdJ9nCvxRBjng1nmfsvYJoGFqaFuV0RHWnnB5VC7PdV4c RXzO38ez4IIZvh0e72G8X4hH+GQMUD5mZ7lAB4rJNlofF+KHbzqmGHMljrx0pV0QbwYe jIfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Jq1ii8A4uQXumPf/NnNFLaE389Tt0HeSx3fXMRSpHEY=; b=FSkEeDGCH6UHiiNjs0nJzjMQKLkM/zNbbkO6bCA7Mm3CJEDGWOuIvS+gGWHJ9W/1qk cizYqMUC1vFux+dtz34TzS0csCvtAvo5cwvPE5GzpB6CCSR9T7VCOYpQmWL+OzdI/2WX tQhRiLEgl/uHIISsl1H1nzc8mZX4llAwDW4Ij0MBjHwUKrDtHtFJ2uWwAvjtFPSG4ss+ 3RVOluhmG7Rv9ZObaI+9++Udlglw107VRss9uYRHfe381NWSh4qyitk+cCs8cwdA33Lo 7FEIoybpE6bkLSyEmsP0dNT/mpqBIN3Fol4Kwk4xaHh9ylZwsfcDF3iyqOGgewJfGRUh uhPw== X-Gm-Message-State: AOAM533QRkR+CiETPNcNz9aHdF6jx4CshaH2E5x+05bHfv+i5TO5WBD5 heVhG4C3QesbZI/QZQI7GLG73g== X-Google-Smtp-Source: ABdhPJyKG+S3Gscm6xr8oqCH8qcvg04CqYQ0tSL54xAPfDg7x5NyQJSymcpp2OEzNTwQ6Ju0NLBrTA== X-Received: by 2002:a17:902:c40e:b0:138:e2f9:6c97 with SMTP id k14-20020a170902c40e00b00138e2f96c97mr13786006plk.26.1631605172395; Tue, 14 Sep 2021 00:39:32 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.244]) by smtp.gmail.com with ESMTPSA id s3sm9377839pfd.188.2021.09.14.00.39.26 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Sep 2021 00:39:32 -0700 (PDT) From: Muchun Song To: willy@infradead.org, akpm@linux-foundation.org, hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, shakeelb@google.com, guro@fb.com, shy828301@gmail.com, alexs@kernel.org, richard.weiyang@gmail.com, david@fromorbit.com, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, zhengqi.arch@bytedance.com, duanxiongchun@bytedance.com, fam.zheng@bytedance.com, smuchun@gmail.com, Muchun Song Subject: [PATCH v3 55/76] ubifs: allocate inode by using alloc_inode_sb() Date: Tue, 14 Sep 2021 15:29:17 +0800 Message-Id: <20210914072938.6440-56-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20210914072938.6440-1-songmuchun@bytedance.com> References: <20210914072938.6440-1-songmuchun@bytedance.com> MIME-Version: 1.0 X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 2C6D2E001981 X-Stat-Signature: we4xadtqzctdatfja4ghzyicpz9xwun6 Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=mT4FkMAo; spf=pass (imf30.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.216.54 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com X-HE-Tag: 1631605173-208421 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 inode allocation is supposed to use alloc_inode_sb(), so convert kmem_cache_alloc() to alloc_inode_sb(). Signed-off-by: Muchun Song --- fs/ubifs/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c index f0fb25727d96..73b51f8e6817 100644 --- a/fs/ubifs/super.c +++ b/fs/ubifs/super.c @@ -268,7 +268,7 @@ static struct inode *ubifs_alloc_inode(struct super_block *sb) { struct ubifs_inode *ui; - ui = kmem_cache_alloc(ubifs_inode_slab, GFP_NOFS); + ui = alloc_inode_sb(sb, ubifs_inode_slab, GFP_NOFS); if (!ui) return NULL; From patchwork Tue Sep 14 07:29:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12492201 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_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 9DD3AC433FE for ; Tue, 14 Sep 2021 07:39:41 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 524AD61029 for ; Tue, 14 Sep 2021 07:39:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 524AD61029 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id F0EA1940019; Tue, 14 Sep 2021 03:39:40 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EBF5D940007; Tue, 14 Sep 2021 03:39:40 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D8775940019; Tue, 14 Sep 2021 03:39:40 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0080.hostedemail.com [216.40.44.80]) by kanga.kvack.org (Postfix) with ESMTP id C5952940007 for ; Tue, 14 Sep 2021 03:39:40 -0400 (EDT) Received: from smtpin25.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 86D7618022CF8 for ; Tue, 14 Sep 2021 07:39:40 +0000 (UTC) X-FDA: 78585379320.25.92FEB01 Received: from mail-pj1-f49.google.com (mail-pj1-f49.google.com [209.85.216.49]) by imf11.hostedemail.com (Postfix) with ESMTP id 51F91F0000AE for ; Tue, 14 Sep 2021 07:39:40 +0000 (UTC) Received: by mail-pj1-f49.google.com with SMTP id t20so8236540pju.5 for ; Tue, 14 Sep 2021 00:39:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3qZ3HM2fEOM8GlV59xjjOZKTYma6jyboi290AZRWTfs=; b=swLJ8MDrNcfBrHijdBeesk26tLZ9evHXGmrABe6JiHEC2dMct3uDEfFsFS9KVcnBfn QfZXodJK0a5ZnQosZhJSuYIa3Lix2y4kJLdl7v/hSBX8B/rX1/SFC3xmojH6F862U65c c/fKb/ZpcKlQF45RcJE0hU5BkVN7y5JsmZWIPIASs8Gzs5vsNcXERPhQQF7jDqnbwmOK 9RjIsdvCbquMfvCvBbDuv5t+PsiqIk96BR55T0j9az5qtbRmIgHkImWRhZGNiGMb/7gf QMtsKp2pCZFNHPvohSX7niH6czQnhkjJgkH1/cGaJrNrfnpsiUBWm1BhFml/DIXEmWzy HV+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3qZ3HM2fEOM8GlV59xjjOZKTYma6jyboi290AZRWTfs=; b=RBdcKodaI5ouhaUcrKWPoQtRkkOnnpmZ+B+XsIxRlrwEc5o0U/tDgPoEgQbLAMtL73 WY+duw2VLzVTJLUP3v6qNcJOuylANFo8NlQDk9l3MwvJco17kjZarZLYb0+RfRqqT4EB P68LQwnhOErbMY9LvKZlx/lOyVtyqllm1MmGgt5Q9IqOYqiDl3taIWp2+A+Y8PeF5S6B i7xcWoB8YUetHlqRzvbv1lh/Rkf/cn9Ggn9I/ked1xfR6DAfYQ90AkfPPTkAnm2RsQfu GM6WPptNgy3JZ2XtEldEgHvYKB7wRa5NHHxmrCzBgk6z0Gp6ZatK4XU1+MKxzBsxKUx8 Jmeg== X-Gm-Message-State: AOAM530ZNxcYIX8azpxFoTmfoJM7Zjx91Yx4xJlwmS4zGEl+8pyppxFW XeEzb5Xteu/m3U3j0fnsbt0+GQ== X-Google-Smtp-Source: ABdhPJyRnErQLsEhV2dixHxzYm9s/YemudAKqKC5KpMkxbE/v//U1xszVbuChuCQxD6ng/Fi/7efIQ== X-Received: by 2002:a17:90b:250e:: with SMTP id ns14mr586106pjb.84.1631605179398; Tue, 14 Sep 2021 00:39:39 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.244]) by smtp.gmail.com with ESMTPSA id s3sm9377839pfd.188.2021.09.14.00.39.32 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Sep 2021 00:39:39 -0700 (PDT) From: Muchun Song To: willy@infradead.org, akpm@linux-foundation.org, hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, shakeelb@google.com, guro@fb.com, shy828301@gmail.com, alexs@kernel.org, richard.weiyang@gmail.com, david@fromorbit.com, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, zhengqi.arch@bytedance.com, duanxiongchun@bytedance.com, fam.zheng@bytedance.com, smuchun@gmail.com, Muchun Song Subject: [PATCH v3 56/76] udf: allocate inode by using alloc_inode_sb() Date: Tue, 14 Sep 2021 15:29:18 +0800 Message-Id: <20210914072938.6440-57-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20210914072938.6440-1-songmuchun@bytedance.com> References: <20210914072938.6440-1-songmuchun@bytedance.com> MIME-Version: 1.0 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 51F91F0000AE X-Stat-Signature: 1dcqnj1yzfjp8e3uhwmb1s3drme4diof Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=swLJ8MDr; spf=pass (imf11.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.216.49 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com X-HE-Tag: 1631605180-581730 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 inode allocation is supposed to use alloc_inode_sb(), so convert kmem_cache_alloc() to alloc_inode_sb(). Signed-off-by: Muchun Song --- fs/udf/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/udf/super.c b/fs/udf/super.c index b2d7c57d0688..76b706584632 100644 --- a/fs/udf/super.c +++ b/fs/udf/super.c @@ -135,7 +135,7 @@ static struct kmem_cache *udf_inode_cachep; static struct inode *udf_alloc_inode(struct super_block *sb) { struct udf_inode_info *ei; - ei = kmem_cache_alloc(udf_inode_cachep, GFP_KERNEL); + ei = alloc_inode_sb(sb, udf_inode_cachep, GFP_KERNEL); if (!ei) return NULL; From patchwork Tue Sep 14 07:29:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12492203 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_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 0601BC433EF for ; Tue, 14 Sep 2021 07:39:48 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id AEA586112E for ; Tue, 14 Sep 2021 07:39:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org AEA586112E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 54B4094001A; Tue, 14 Sep 2021 03:39:47 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 52254940007; Tue, 14 Sep 2021 03:39:47 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3E9D794001A; Tue, 14 Sep 2021 03:39:47 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0191.hostedemail.com [216.40.44.191]) by kanga.kvack.org (Postfix) with ESMTP id 3056A940007 for ; Tue, 14 Sep 2021 03:39:47 -0400 (EDT) Received: from smtpin15.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id E96C018186D46 for ; Tue, 14 Sep 2021 07:39:46 +0000 (UTC) X-FDA: 78585379572.15.AA48854 Received: from mail-pg1-f175.google.com (mail-pg1-f175.google.com [209.85.215.175]) by imf18.hostedemail.com (Postfix) with ESMTP id A620D4002085 for ; Tue, 14 Sep 2021 07:39:46 +0000 (UTC) Received: by mail-pg1-f175.google.com with SMTP id q68so11926371pga.9 for ; Tue, 14 Sep 2021 00:39:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=CfoG77+GHMGoWvpmb0Om6WO4EZF5vVDZrlNrzkyEw1M=; b=nsB15Zu/N08EYQS1fOMnKPBfgz9FbWFrKXx6IeT8c4Kk0PQOORzcgc7XdjTxreVgo3 vmvz1l+DBYMg94UlWVlOeqmzWXeyiyUXGJhKWElU9MkoRZIc1/+PdeY6I9GMnfsLTtgX iMVBI/jt3sEDRoHh5p4jaIl3hJBN6bMf9f5e1poH1KTAUK3roZBzlCHz1DEDsUrSTPpD V8CE5z9qjc9r45z+HrhMR4C4Wtx0UTGpNBinF9hIE5jJ1Ef8H4MJWJWgE5tibySqyy6D QVQefExtDsPELFRRftpZg/DrsiGoAe5lPHXNuc8Bw4onTWpnBfdDJZnvJDTJ1HmBE7RE ABjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=CfoG77+GHMGoWvpmb0Om6WO4EZF5vVDZrlNrzkyEw1M=; b=62otNJczBoson/+rzQrTzmMabSuMUCEFfdo3av89OTE2qScVx3iPGt6x1VXA78eSJn fTevOsyATAW7+UTJI2dQKVfexsuBqKy6C8SuJSmj1VE5QWlcdKsNJ8RPNWR/QPe0qG/w WUqCEOteYiUKdmM5IWyWGH5cXGwTdk4X6kKewXW/0FUPLTiWwLKdaLxBWrE/qgfOoZUl ArbSDtPdaQ6PoCKxCMR08EvefqH0Hk5fMOuG2dgBGBsGd2M9o5PoOM47W5aO7w6M21vp daCjDCoTpu0Oh4Npwlha+YO3aelSEFpB4CpJp5iXSQVjO+5tUuKNGs8duj4rBI6CfhZz 02tA== X-Gm-Message-State: AOAM531eqxBADOzAQ03b3CrIooZIiC9LDDGzKKAfNIp67xVglvko6tPg QP3EYKPWxjIIdMl7hQx+nHoeLA== X-Google-Smtp-Source: ABdhPJykUi6xBK18c9DcjOjDauzCaD3qlmiJsluy1Xfxyi4MR8kmx7pulU9ughu32b8FMJ1cl9G4jw== X-Received: by 2002:a63:150e:: with SMTP id v14mr14436018pgl.126.1631605185861; Tue, 14 Sep 2021 00:39:45 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.244]) by smtp.gmail.com with ESMTPSA id s3sm9377839pfd.188.2021.09.14.00.39.39 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Sep 2021 00:39:45 -0700 (PDT) From: Muchun Song To: willy@infradead.org, akpm@linux-foundation.org, hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, shakeelb@google.com, guro@fb.com, shy828301@gmail.com, alexs@kernel.org, richard.weiyang@gmail.com, david@fromorbit.com, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, zhengqi.arch@bytedance.com, duanxiongchun@bytedance.com, fam.zheng@bytedance.com, smuchun@gmail.com, Muchun Song Subject: [PATCH v3 57/76] ufs: allocate inode by using alloc_inode_sb() Date: Tue, 14 Sep 2021 15:29:19 +0800 Message-Id: <20210914072938.6440-58-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20210914072938.6440-1-songmuchun@bytedance.com> References: <20210914072938.6440-1-songmuchun@bytedance.com> MIME-Version: 1.0 Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b="nsB15Zu/"; spf=pass (imf18.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.215.175 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com X-Stat-Signature: k6xipne7e4o844zhawej9cjxt637e83q X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: A620D4002085 X-HE-Tag: 1631605186-199994 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 inode allocation is supposed to use alloc_inode_sb(), so convert kmem_cache_alloc() to alloc_inode_sb(). Signed-off-by: Muchun Song --- fs/ufs/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ufs/super.c b/fs/ufs/super.c index 00a01471ea05..23377c1baed9 100644 --- a/fs/ufs/super.c +++ b/fs/ufs/super.c @@ -1443,7 +1443,7 @@ static struct inode *ufs_alloc_inode(struct super_block *sb) { struct ufs_inode_info *ei; - ei = kmem_cache_alloc(ufs_inode_cachep, GFP_NOFS); + ei = alloc_inode_sb(sb, ufs_inode_cachep, GFP_NOFS); if (!ei) return NULL; From patchwork Tue Sep 14 07:29:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12492205 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_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 36DE8C433EF for ; Tue, 14 Sep 2021 07:39:55 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id DBC636121E for ; Tue, 14 Sep 2021 07:39:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org DBC636121E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 80A2994001B; Tue, 14 Sep 2021 03:39:54 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 79305940007; Tue, 14 Sep 2021 03:39:54 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 633C894001B; Tue, 14 Sep 2021 03:39:54 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0191.hostedemail.com [216.40.44.191]) by kanga.kvack.org (Postfix) with ESMTP id 52FAB940007 for ; Tue, 14 Sep 2021 03:39:54 -0400 (EDT) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 1DAC4274C2 for ; Tue, 14 Sep 2021 07:39:54 +0000 (UTC) X-FDA: 78585379908.13.41B0735 Received: from mail-pj1-f52.google.com (mail-pj1-f52.google.com [209.85.216.52]) by imf22.hostedemail.com (Postfix) with ESMTP id C8B721900 for ; Tue, 14 Sep 2021 07:39:53 +0000 (UTC) Received: by mail-pj1-f52.google.com with SMTP id g13-20020a17090a3c8d00b00196286963b9so1456235pjc.3 for ; Tue, 14 Sep 2021 00:39:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=s0gIedj0uRl6kYfJTbilxSjgpDw4b49jX6h+L9evK1A=; b=YcE8Qvsw9Jign0OLffDdLQTSWfd4ueUGxnw3H7nKu0CGfRee7lRQE1hCIMnRUNNGl3 s6T/wrouUpAFKefJnDIlgErM20da5IuO32Z6soWIBPuJH+KrYllfrXv77Hifc6KQsJYX lI5aL2gWB3BEAmHwPzI8L+nfa1ZfuyeIcZh1DGf0t40599ced9gd8Jjem1KoPZCEbdGf rqEuzeCYG8DKB+s6XPGaeonTE7Mq5sWDhAPE4UXQaaCbThMCoCsqnX+E44V9nM/+P5aP z8YPeJUSJrEqb2cpL2Iy7xBK4GKdBhVRBZxUi2LJIlSmLwwjclUWxitsjeZVA/h/EQEH dgwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=s0gIedj0uRl6kYfJTbilxSjgpDw4b49jX6h+L9evK1A=; b=r0cxaq7fmqft5DOpBGqlzazkaaZ4Xz1azidkzkD1WKCgd9Eg9HOQkubE5imQQJqY3T QwTlUVH7+pMKPdAScBVEP7tvqOPu764TI5xVHWmpVI1QDKMdixeYhpd2yXtfNPv5FtjR cTeNMvpkhME1Xqe72F1S88TeyxuSTohkjZgIhGFTvdC2sO5foeyNxZ7TWfVxpOBnHQFd 9eeA16WfayIGwKXO8awS1iUZMsWDTz4P5UdGqgChU+RrM6NR/6eQLsz/i0fGnb2/vQ7A qhndK0AJlx1ZGK108ab5WNko8K0TigRMVJgotDllFqSK5d1UxViX1gIZ/WFTIFEJWANW /RAQ== X-Gm-Message-State: AOAM531/ArfeFk5a/iaM4BgEcvqLGYlzdppc6C4CA2KOSZKbkEzIcWEQ K4BkCpGrFreL932Frnu8z42kYg== X-Google-Smtp-Source: ABdhPJw9Xl/WZILl4Ds/Wqr3ng0djaEheCa6a46UTkodL4KpqRYh6SkR3hIq5nfVq1N2z4iUi4tdhw== X-Received: by 2002:a17:90a:4ce3:: with SMTP id k90mr532351pjh.237.1631605193043; Tue, 14 Sep 2021 00:39:53 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.244]) by smtp.gmail.com with ESMTPSA id s3sm9377839pfd.188.2021.09.14.00.39.46 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Sep 2021 00:39:52 -0700 (PDT) From: Muchun Song To: willy@infradead.org, akpm@linux-foundation.org, hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, shakeelb@google.com, guro@fb.com, shy828301@gmail.com, alexs@kernel.org, richard.weiyang@gmail.com, david@fromorbit.com, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, zhengqi.arch@bytedance.com, duanxiongchun@bytedance.com, fam.zheng@bytedance.com, smuchun@gmail.com, Muchun Song Subject: [PATCH v3 58/76] vboxsf: allocate inode by using alloc_inode_sb() Date: Tue, 14 Sep 2021 15:29:20 +0800 Message-Id: <20210914072938.6440-59-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20210914072938.6440-1-songmuchun@bytedance.com> References: <20210914072938.6440-1-songmuchun@bytedance.com> MIME-Version: 1.0 X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: C8B721900 Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=YcE8Qvsw; dmarc=pass (policy=none) header.from=bytedance.com; spf=pass (imf22.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.216.52 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com X-Stat-Signature: qak7o4skrry9b3itmbo7m8e8n836iuch X-HE-Tag: 1631605193-888391 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 inode allocation is supposed to use alloc_inode_sb(), so convert kmem_cache_alloc() to alloc_inode_sb(). Signed-off-by: Muchun Song --- fs/vboxsf/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/vboxsf/super.c b/fs/vboxsf/super.c index 4f5e59f06284..050ef855158b 100644 --- a/fs/vboxsf/super.c +++ b/fs/vboxsf/super.c @@ -244,7 +244,7 @@ static struct inode *vboxsf_alloc_inode(struct super_block *sb) { struct vboxsf_inode *sf_i; - sf_i = kmem_cache_alloc(vboxsf_inode_cachep, GFP_NOFS); + sf_i = alloc_inode_sb(sb, vboxsf_inode_cachep, GFP_NOFS); if (!sf_i) return NULL; From patchwork Tue Sep 14 07:29:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12492207 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_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 109DBC433FE for ; Tue, 14 Sep 2021 07:40:02 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B779B60F21 for ; Tue, 14 Sep 2021 07:40:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org B779B60F21 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 5E6C994001C; Tue, 14 Sep 2021 03:40:01 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5974A940007; Tue, 14 Sep 2021 03:40:01 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 45ECB94001C; Tue, 14 Sep 2021 03:40:01 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0106.hostedemail.com [216.40.44.106]) by kanga.kvack.org (Postfix) with ESMTP id 37977940007 for ; Tue, 14 Sep 2021 03:40:01 -0400 (EDT) Received: from smtpin35.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id F13FD8249980 for ; Tue, 14 Sep 2021 07:40:00 +0000 (UTC) X-FDA: 78585380160.35.F6736B5 Received: from mail-pf1-f180.google.com (mail-pf1-f180.google.com [209.85.210.180]) by imf22.hostedemail.com (Postfix) with ESMTP id B0F911900 for ; Tue, 14 Sep 2021 07:40:00 +0000 (UTC) Received: by mail-pf1-f180.google.com with SMTP id y17so11337070pfl.13 for ; Tue, 14 Sep 2021 00:40:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=NFK8477UAn3zAKQ0vXm0lu+fwWsZH+uussXoYW7LsE4=; b=L2tXQ4abitca4ZpsuUEhDYaxwHxkohsNX4r8JUZZQMfvw7KBpwdpYy3hMa2VxOYtOY /tWe2XlXOVIPpAcphXR1WZg5UOXFqg3UHPRDwQcVJsodv5NthoXtQCHLnfzhBXgKMa2m QVEG+UgL5UHafDNVUK1v/2X5mkcpp/1us69k8wopwcZAfPE2E8CMtnfTuwa4uHps3Dfl F7l09aI91gOWOCcE1+tkPcfFpVoS+eH+k8cbXfk+zb0kBUhch6ofDcvZMyfDpmnoEH2b tx+8zfpUEScvl/2qvwweom0hZMUnnM8273fTlolF41JYbgc5UtvHFm6Qxxl4EC13OCig 2bSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=NFK8477UAn3zAKQ0vXm0lu+fwWsZH+uussXoYW7LsE4=; b=Nny7s5VXvvNwXAYxbfCrJcpARUe7Cw+N54PQZHnp8LZKpnwOfuBUxibA8qlMg8WgYQ f3YNKuC5KZY6c9nN3I1D/xBue1bT64Hvv6DU9xpNhp0ai0lrNFh+ydnrN/5PN1c3nFeg MjO4U2da0HO5YzFfXp1Hxp4N5oUq2L+wECygpUc8Oaoxrm0b17K68uG1i1nwa2u5a/uU j9QBs9Flz0XxHW9l2F2xbY9aJDLpH4oy5r8PNVBj0a5NrWf0ggnQMVr6grlJTxCl9tkl CB7tqBOuEU1eJ3dqaHcZxkXYSvHHCGhis25MTmKiAyYCG+P0s9ZNAWekHWl5CLdqicqC 9pmA== X-Gm-Message-State: AOAM5330r8iSfzIrPOQ6bNj5HZFrmGyS+AqZQCkSAi8kXasdOXkEcvP8 Qo2xdPQvcrzb9TGOmyirTyV4Iw== X-Google-Smtp-Source: ABdhPJxJWNVuFEOyhzUxVwAwBroFpnzb1jddWkZTC7DYPKbbNMEwIFS2gGCQs+6W/z4hcToI8QOqAw== X-Received: by 2002:a62:b515:0:b0:438:42ab:2742 with SMTP id y21-20020a62b515000000b0043842ab2742mr3383918pfe.77.1631605199954; Tue, 14 Sep 2021 00:39:59 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.244]) by smtp.gmail.com with ESMTPSA id s3sm9377839pfd.188.2021.09.14.00.39.53 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Sep 2021 00:39:59 -0700 (PDT) From: Muchun Song To: willy@infradead.org, akpm@linux-foundation.org, hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, shakeelb@google.com, guro@fb.com, shy828301@gmail.com, alexs@kernel.org, richard.weiyang@gmail.com, david@fromorbit.com, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, zhengqi.arch@bytedance.com, duanxiongchun@bytedance.com, fam.zheng@bytedance.com, smuchun@gmail.com, Muchun Song Subject: [PATCH v3 59/76] xfs: allocate inode by using alloc_inode_sb() Date: Tue, 14 Sep 2021 15:29:21 +0800 Message-Id: <20210914072938.6440-60-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20210914072938.6440-1-songmuchun@bytedance.com> References: <20210914072938.6440-1-songmuchun@bytedance.com> MIME-Version: 1.0 X-Stat-Signature: 47jjtohugwu57gr6mg8cr8h31kwptw44 Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=L2tXQ4ab; dmarc=pass (policy=none) header.from=bytedance.com; spf=pass (imf22.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.210.180 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: B0F911900 X-HE-Tag: 1631605200-145928 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 inode allocation is supposed to use alloc_inode_sb(), so convert kmem_cache_alloc() to alloc_inode_sb(). Signed-off-by: Muchun Song --- fs/xfs/xfs_icache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c index f2210d927481..0a4f32c0044c 100644 --- a/fs/xfs/xfs_icache.c +++ b/fs/xfs/xfs_icache.c @@ -77,7 +77,7 @@ xfs_inode_alloc( * XXX: If this didn't occur in transactions, we could drop GFP_NOFAIL * and return NULL here on ENOMEM. */ - ip = kmem_cache_alloc(xfs_inode_zone, GFP_KERNEL | __GFP_NOFAIL); + ip = alloc_inode_sb(mp->m_super, xfs_inode_zone, GFP_KERNEL | __GFP_NOFAIL); if (inode_init_always(mp->m_super, VFS_I(ip))) { kmem_cache_free(xfs_inode_zone, ip); From patchwork Tue Sep 14 07:29:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12492209 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_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 A87EFC433F5 for ; Tue, 14 Sep 2021 07:40:11 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 6196760F21 for ; Tue, 14 Sep 2021 07:40:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 6196760F21 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 0906D94001D; Tue, 14 Sep 2021 03:40:11 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 03FB4940007; Tue, 14 Sep 2021 03:40:10 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E499E94001D; Tue, 14 Sep 2021 03:40:10 -0400 (EDT) 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 D70B5940007 for ; Tue, 14 Sep 2021 03:40:10 -0400 (EDT) Received: from smtpin35.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 984F32B35F for ; Tue, 14 Sep 2021 07:40:10 +0000 (UTC) X-FDA: 78585380580.35.7FCB91E Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) by imf27.hostedemail.com (Postfix) with ESMTP id 54CBF700009E for ; Tue, 14 Sep 2021 07:40:10 +0000 (UTC) Received: by mail-pl1-f170.google.com with SMTP id bg1so7588725plb.13 for ; Tue, 14 Sep 2021 00:40:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=/aIacaGRl4jhBPpI0aSZA83SmaoB2Q+2BniQczTSm4Y=; b=z9V5WdfVIIrCNM2nU/e7FWwd3XXc5qagKbdfa4nAywZIklfQzr+kCWhq5Ml9/KP4fh 44yNvJZ4EQi//ByTnyJI+UOx4onioXRoFiV+wyCmDpKNyY0ZvWLEbLG5nV163dD1pQ56 GrJ2tBrS7pzzmwdMVGsxzh9d2plp37ASRhZeaWYg+PtkfQco44Xq6o5+cw5yvC6qT3Qh Ii2dFhezFcls6g6Y1qyyGWee//Al+TQ95MJ0Y/Gc7am0T2/tmsc3/w2jtnZlAllC2f4A zAdmWD23Y8/p14LNMGW82Ib+ndNV2pIPtpLA6OD9NWKvo8z9EcEsh8Tqm34DeVpRiU77 aMGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=/aIacaGRl4jhBPpI0aSZA83SmaoB2Q+2BniQczTSm4Y=; b=SqqprHlxh0sRBh1BexJDmWsloGIiyx2FXtRmMxfKkyUFTtUwk2nY6vmrqT/MltKxpi Vwbu/1Z/HEDB/zgJSZs5qqcTzJ733UbhKZmjfsKOkf55Vt8h4cvnRebGPERfPfcomQ5g zamfh4AxFtX+CsMHgPvtey0W2hQ3c064tdko2QvkHU/vJUo1Z35a+7To4i4X45RvZV40 +WARW4QvnS00LtrAcG2xHOghwJfb+7xDDhqaOXPukQFsPwsD6riOgZuced6tuWrfMykY OZIvQXV9ov6OWh0s0KIWS4/vi2DZjD+RDYN46ziFKPxFFcwb19IDLe4d4VVNMXiHa1+K B50w== X-Gm-Message-State: AOAM530nSruA6Bc0gztTka0Fm2+9tAanArDucYSnWegRO16TF5SDyF8J 3GGmd6nVHHq8evBGVuIcug6ueg== X-Google-Smtp-Source: ABdhPJzrMAx9NpkE69qozFAUf/hOGRSECWuNnEuPGrBhS7rF0c3hmMSUBNoa1rH26YZI+VB2dRQ1Ww== X-Received: by 2002:a17:902:dac6:b0:138:85a7:ef80 with SMTP id q6-20020a170902dac600b0013885a7ef80mr13798289plx.45.1631605209487; Tue, 14 Sep 2021 00:40:09 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.244]) by smtp.gmail.com with ESMTPSA id s3sm9377839pfd.188.2021.09.14.00.40.00 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Sep 2021 00:40:09 -0700 (PDT) From: Muchun Song To: willy@infradead.org, akpm@linux-foundation.org, hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, shakeelb@google.com, guro@fb.com, shy828301@gmail.com, alexs@kernel.org, richard.weiyang@gmail.com, david@fromorbit.com, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, zhengqi.arch@bytedance.com, duanxiongchun@bytedance.com, fam.zheng@bytedance.com, smuchun@gmail.com, Muchun Song Subject: [PATCH v3 60/76] zonefs: allocate inode by using alloc_inode_sb() Date: Tue, 14 Sep 2021 15:29:22 +0800 Message-Id: <20210914072938.6440-61-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20210914072938.6440-1-songmuchun@bytedance.com> References: <20210914072938.6440-1-songmuchun@bytedance.com> MIME-Version: 1.0 X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 54CBF700009E X-Stat-Signature: eerqt5hoxckihm5oiwacom4aux95dm6z Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=z9V5WdfV; spf=pass (imf27.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.214.170 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com X-HE-Tag: 1631605210-132827 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 inode allocation is supposed to use alloc_inode_sb(), so convert kmem_cache_alloc() to alloc_inode_sb(). Signed-off-by: Muchun Song --- fs/zonefs/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/zonefs/super.c b/fs/zonefs/super.c index ddc346a9df9b..19bebbc2ccdf 100644 --- a/fs/zonefs/super.c +++ b/fs/zonefs/super.c @@ -1137,7 +1137,7 @@ static struct inode *zonefs_alloc_inode(struct super_block *sb) { struct zonefs_inode_info *zi; - zi = kmem_cache_alloc(zonefs_inode_cachep, GFP_KERNEL); + zi = alloc_inode_sb(sb, zonefs_inode_cachep, GFP_KERNEL); if (!zi) return NULL; From patchwork Tue Sep 14 07:29:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12492211 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_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 15F24C433EF for ; Tue, 14 Sep 2021 07:40:19 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C0B2B60F4A for ; Tue, 14 Sep 2021 07:40:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org C0B2B60F4A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 6349594001E; Tue, 14 Sep 2021 03:40:18 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5E4FB940007; Tue, 14 Sep 2021 03:40:18 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4AD5C94001E; Tue, 14 Sep 2021 03:40:18 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0109.hostedemail.com [216.40.44.109]) by kanga.kvack.org (Postfix) with ESMTP id 3C06D940007 for ; Tue, 14 Sep 2021 03:40:18 -0400 (EDT) Received: from smtpin35.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id F3CA12BA83 for ; Tue, 14 Sep 2021 07:40:17 +0000 (UTC) X-FDA: 78585380916.35.297BE7E Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) by imf07.hostedemail.com (Postfix) with ESMTP id C5FC71000098 for ; Tue, 14 Sep 2021 07:40:17 +0000 (UTC) Received: by mail-pl1-f178.google.com with SMTP id n18so7596247plp.7 for ; Tue, 14 Sep 2021 00:40:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=BQiPvHV1kAW82zxCaMhaRncf1tI904Mp4fT7Z6DcW/g=; b=HTv0QCf28It9lU5pPVCMk5Xm3hHYstEaSOTILsVpTo12lCQwSniOySljOVzbZVR9rr ukAUHRYlJqyxd0bEmiWI8CYpqY4qrlyXBf3ybtfSESmP+DtrGooyzYW8lwUjuF3D/V2E a8Oxbi7yBv86BCkEUBuA5+PozfOGuFx/hUhKn9FDJ/Mrmsy68cqip0am4ExgAdWXIwI4 Ts7MfPOFQHx2KG/R9fAjbqroVLOTokfOOrVHVJ8ln1TA5o0IZ+wQMbVWiu6p50QkRDBp H/KFDsQIhgqyxELj+CHfimxExE2Wlpn6wBjldIVlxq4If3Rw9ueYE76WeQi1ZaLBsf7G ep9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=BQiPvHV1kAW82zxCaMhaRncf1tI904Mp4fT7Z6DcW/g=; b=VSe3BqesiFA2f7f+o5fdHLHhRuSp3alVakb9SSCxyFTnsTcO2GPdUZy8EyA542mgDs Hxx680Bxyfe3p4bLj+XVaO3ZNEh5DEua4MxKsSn8ttBInLAIlQThoIgv/+WjUTJygJq1 4TZ6JsIGijHdm2WM9s7EQ9MTPLoy/QBDw8u0Xdpd+DY/sa/crPkA8BvB07Lz8uYwiiT6 WfFyFyMLXsK4X2APZIMByRurToQnp1bH7gQZ3jKHjpGfMmvAu5ICvPaMeV5Ec45OwdPT D0Ao6sOnn9QfvWF58dNko5TmHrNpyYSoWDtjN3t83+jSkjk97NWpN+I//+DXHONn1/Zk dlow== X-Gm-Message-State: AOAM533XR+GqN67vFzddB4TZ8El5ccmsL/JWvvUZdRtlXAbIMsGcx2H5 2bNrm3fF0RSZhbayWjq+cOVMPw== X-Google-Smtp-Source: ABdhPJzgOQ2EfmZzsSiVVu+EtjPWBaYq/0SkGw4dtdh/XidcLQ/yLTjOZYpVmaEit+KKYkhbLW+5MQ== X-Received: by 2002:a17:90b:4901:: with SMTP id kr1mr596641pjb.80.1631605216971; Tue, 14 Sep 2021 00:40:16 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.244]) by smtp.gmail.com with ESMTPSA id s3sm9377839pfd.188.2021.09.14.00.40.09 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Sep 2021 00:40:16 -0700 (PDT) From: Muchun Song To: willy@infradead.org, akpm@linux-foundation.org, hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, shakeelb@google.com, guro@fb.com, shy828301@gmail.com, alexs@kernel.org, richard.weiyang@gmail.com, david@fromorbit.com, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, zhengqi.arch@bytedance.com, duanxiongchun@bytedance.com, fam.zheng@bytedance.com, smuchun@gmail.com, Muchun Song Subject: [PATCH v3 61/76] ipc: allocate inode by using alloc_inode_sb() Date: Tue, 14 Sep 2021 15:29:23 +0800 Message-Id: <20210914072938.6440-62-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20210914072938.6440-1-songmuchun@bytedance.com> References: <20210914072938.6440-1-songmuchun@bytedance.com> MIME-Version: 1.0 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: C5FC71000098 X-Stat-Signature: 7ywmh3q69jedjpggdd173x3pp3u5i6kp Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=HTv0QCf2; spf=pass (imf07.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.214.178 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com X-HE-Tag: 1631605217-821718 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 inode allocation is supposed to use alloc_inode_sb(), so convert kmem_cache_alloc() to alloc_inode_sb(). Signed-off-by: Muchun Song --- ipc/mqueue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ipc/mqueue.c b/ipc/mqueue.c index 5becca9be867..7c08eb3c258d 100644 --- a/ipc/mqueue.c +++ b/ipc/mqueue.c @@ -486,7 +486,7 @@ static struct inode *mqueue_alloc_inode(struct super_block *sb) { struct mqueue_inode_info *ei; - ei = kmem_cache_alloc(mqueue_inode_cachep, GFP_KERNEL); + ei = alloc_inode_sb(sb, mqueue_inode_cachep, GFP_KERNEL); if (!ei) return NULL; return &ei->vfs_inode; From patchwork Tue Sep 14 07:29:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12492213 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_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 66672C433EF for ; Tue, 14 Sep 2021 07:40:26 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 1AACD60F21 for ; Tue, 14 Sep 2021 07:40:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 1AACD60F21 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id AEF8B94001F; Tue, 14 Sep 2021 03:40:25 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A9FC4940007; Tue, 14 Sep 2021 03:40:25 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9678994001F; Tue, 14 Sep 2021 03:40:25 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0112.hostedemail.com [216.40.44.112]) by kanga.kvack.org (Postfix) with ESMTP id 81481940007 for ; Tue, 14 Sep 2021 03:40:25 -0400 (EDT) Received: from smtpin35.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 3F375181B949D for ; Tue, 14 Sep 2021 07:40:25 +0000 (UTC) X-FDA: 78585381210.35.E917374 Received: from mail-pf1-f179.google.com (mail-pf1-f179.google.com [209.85.210.179]) by imf24.hostedemail.com (Postfix) with ESMTP id B1F86B00009D for ; Tue, 14 Sep 2021 07:40:24 +0000 (UTC) Received: by mail-pf1-f179.google.com with SMTP id y8so5976988pfa.7 for ; Tue, 14 Sep 2021 00:40:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=d7/YayZrshcF7Mwrc2QA6L3YOuEA3tYMHuJ8BscQyJk=; b=z9t/5nzUvwFyULnC4TA8PMncxhfHbGYcOY/JnfGiZPat2l+jPZ76aJb9o+Sh412CZs zU2QysWuiqUVdhHU/4IuVhePtFuR7J8aMaiYFfC2uaZWt8p4ebDXUN7RoRb2cGXSGxtL wwd5vXhsOZ3GtuIFOdYDLierUO4oVjKlJIxua8wx0ZImVGGAAI4uUQSMC1LFZccKiOpL jAeCcr2gT9ChitIj1NoDoqSOAP/47HG7xwFeRdD7oyqGLV4QV/4rWwWfI04JpFm59kyx 1gUr7iPKr9SQ9o3cB4B0URKzG5HTMDVr7mhm0cyuD6V7Ch6oqD+qhpzCl16b0Y7TROUX 4tjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=d7/YayZrshcF7Mwrc2QA6L3YOuEA3tYMHuJ8BscQyJk=; b=UeH1N+DOHRKLCRCpUjXoLGqXwf2300ZAbETd9Hcmry63Or0EB+FqyfojkNXlw1OiQm kN40yZCkBH1pYAqFT+aH/odpyre9WJ+W5z72evHLNkHLrBIh6eNPQDm6PKxQ8QjArWJH TYh/QgOfVDDNrHSITptFDtZEYMrPKiLUf1jCZWV8ccPw4BjTLzo2MMVG4GhQYuNqhr7X +NpDtV8cCZkTrGMbhDLuxbh9poYhpoOjs8c9t7mtwvmVj2fmDMTTp6JYOlXnsemQAHwi CUQSgO4dl+1yufk9jliKuxErRQYKEI0IokOtJ+xchDZBqyQsT0hHv9d5LK0XG/CQn0Kl zkKQ== X-Gm-Message-State: AOAM530yrpwgAsUd6Rb+tGqRITuOBCAsSoR4ajC3/kexqsISUYm9wA8+ jxrhUVicHQVmpk1XuWzlDqSPWg== X-Google-Smtp-Source: ABdhPJx4WMylrbowlkfveFjBUl4wg3+euB+A0opiDR8fYsKryJNGlR8lQaUcijHeFf/jEbbrdD28TA== X-Received: by 2002:a62:6103:0:b0:405:2c7a:9ee9 with SMTP id v3-20020a626103000000b004052c7a9ee9mr3475258pfb.71.1631605223847; Tue, 14 Sep 2021 00:40:23 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.244]) by smtp.gmail.com with ESMTPSA id s3sm9377839pfd.188.2021.09.14.00.40.17 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Sep 2021 00:40:23 -0700 (PDT) From: Muchun Song To: willy@infradead.org, akpm@linux-foundation.org, hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, shakeelb@google.com, guro@fb.com, shy828301@gmail.com, alexs@kernel.org, richard.weiyang@gmail.com, david@fromorbit.com, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, zhengqi.arch@bytedance.com, duanxiongchun@bytedance.com, fam.zheng@bytedance.com, smuchun@gmail.com, Muchun Song Subject: [PATCH v3 62/76] shmem: allocate inode by using alloc_inode_sb() Date: Tue, 14 Sep 2021 15:29:24 +0800 Message-Id: <20210914072938.6440-63-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20210914072938.6440-1-songmuchun@bytedance.com> References: <20210914072938.6440-1-songmuchun@bytedance.com> MIME-Version: 1.0 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: B1F86B00009D X-Stat-Signature: migpsnh7zu39r9zu5emzx5rycwf4pia3 Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b="z9t/5nzU"; spf=pass (imf24.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.210.179 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com X-HE-Tag: 1631605224-636619 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 inode allocation is supposed to use alloc_inode_sb(), so convert kmem_cache_alloc() to alloc_inode_sb(). Signed-off-by: Muchun Song --- mm/shmem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/shmem.c b/mm/shmem.c index a5ae8266891d..541bdf61113e 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -3738,7 +3738,7 @@ static struct kmem_cache *shmem_inode_cachep; static struct inode *shmem_alloc_inode(struct super_block *sb) { struct shmem_inode_info *info; - info = kmem_cache_alloc(shmem_inode_cachep, GFP_KERNEL); + info = alloc_inode_sb(sb, shmem_inode_cachep, GFP_KERNEL); if (!info) return NULL; return &info->vfs_inode; From patchwork Tue Sep 14 07:29:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12492215 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_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 787C8C433FE for ; Tue, 14 Sep 2021 07:40:32 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 2EFC960238 for ; Tue, 14 Sep 2021 07:40:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 2EFC960238 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id C763E900004; Tue, 14 Sep 2021 03:40:31 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C2635900003; Tue, 14 Sep 2021 03:40:31 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AEDEA900004; Tue, 14 Sep 2021 03:40:31 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0089.hostedemail.com [216.40.44.89]) by kanga.kvack.org (Postfix) with ESMTP id A0138900003 for ; Tue, 14 Sep 2021 03:40:31 -0400 (EDT) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 63506181B94BB for ; Tue, 14 Sep 2021 07:40:31 +0000 (UTC) X-FDA: 78585381462.01.3CD85E8 Received: from mail-pf1-f175.google.com (mail-pf1-f175.google.com [209.85.210.175]) by imf11.hostedemail.com (Postfix) with ESMTP id 361F8F0000B4 for ; Tue, 14 Sep 2021 07:40:31 +0000 (UTC) Received: by mail-pf1-f175.google.com with SMTP id w19so6962531pfn.12 for ; Tue, 14 Sep 2021 00:40:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=CzMpd2icHKDgVZh/IHRZAX4AuKL56PFsFqQ9a9tRdLM=; b=CU4bfhcQLvN5AHq3ebwvRClEL0E5KxzWHts0ZIvKkNBaQrTiIrNNOlVntjRB7muYwm Z3uL7AgyvuoShFx68rOd+Pj1uG/EiAeLfh6d4LbnixdAr//2M3cRXNvGvH3OL4tUWFnN m0n46F6LAsYd675kx2lQFhuECvqIW1otJNRsfkPcYDaXCcvNKHyQ88x5Xmu9UjHrW+CN 5hxVUEg7E7+iQjjOrrmPpNtjPY/+Hg3vutmVZOMLFT39MwSP+TwZd24vYzo9+OIXHH1w KsbDFFT7SQVaHX08av/hPnnHGdB2RJJPysf/Pqf/CUAUx/F6q8XP0ft5TlIn3sB/HsDN kmPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=CzMpd2icHKDgVZh/IHRZAX4AuKL56PFsFqQ9a9tRdLM=; b=cu4C6d3q6gE3rfbeElY6FHJFom0+LR3/dvrDOe9bREVebX4ZsbikwisjBIxyhBTLHU rx8ahz0GIuFhd6PPfcgH2qyYR76DFbinrMcpBBSYowlcDXspVdE/GhfKpakWGV/blkGg rZfI5vB+vf2XHDMtiz7xvGRV02oKj2pJUYDqnSQKjQP8pZAsSFc2tG3fLZhGesVpzDnr Le3Sw31Mw45tp9yJSMPt6lxr4Djv+sw4Y3HxRV/g+npiqNTPmw7N1AXBdV1jrWmRAQNj o3DbGcuAytBnUV/z4rABlUAKRDG0uQf7NmbJ+elee+2MX/lsmUPTeGxgicZm/WUwjUiG wZeQ== X-Gm-Message-State: AOAM530rVlchC8/bj1YNJbaqXzq/KOAAJ8Rzx+7wJf4X3LlC/nBfG19C J6NLojp/iRgQDO2SA9yQIRsrfA== X-Google-Smtp-Source: ABdhPJyMNoiU0Jst3lZMbRSWOcK0XGszzmqSKadnFf8sWdj6xUiFiP28gaSKoLEjwgjodGoOC0DppA== X-Received: by 2002:a62:64d3:0:b0:43d:ba3:1e2c with SMTP id y202-20020a6264d3000000b0043d0ba31e2cmr3457416pfb.5.1631605230405; Tue, 14 Sep 2021 00:40:30 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.244]) by smtp.gmail.com with ESMTPSA id s3sm9377839pfd.188.2021.09.14.00.40.24 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Sep 2021 00:40:30 -0700 (PDT) From: Muchun Song To: willy@infradead.org, akpm@linux-foundation.org, hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, shakeelb@google.com, guro@fb.com, shy828301@gmail.com, alexs@kernel.org, richard.weiyang@gmail.com, david@fromorbit.com, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, zhengqi.arch@bytedance.com, duanxiongchun@bytedance.com, fam.zheng@bytedance.com, smuchun@gmail.com, Muchun Song Subject: [PATCH v3 63/76] net: allocate inode by using alloc_inode_sb() Date: Tue, 14 Sep 2021 15:29:25 +0800 Message-Id: <20210914072938.6440-64-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20210914072938.6440-1-songmuchun@bytedance.com> References: <20210914072938.6440-1-songmuchun@bytedance.com> MIME-Version: 1.0 Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=CU4bfhcQ; spf=pass (imf11.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.210.175 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 361F8F0000B4 X-Stat-Signature: c95c7x8ys8buou55re544rhxnjswasbq X-HE-Tag: 1631605231-397153 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 inode allocation is supposed to use alloc_inode_sb(), so convert kmem_cache_alloc() to alloc_inode_sb(). Signed-off-by: Muchun Song --- net/socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/socket.c b/net/socket.c index 7f64a6eccf63..cee567ccd99c 100644 --- a/net/socket.c +++ b/net/socket.c @@ -300,7 +300,7 @@ static struct inode *sock_alloc_inode(struct super_block *sb) { struct socket_alloc *ei; - ei = kmem_cache_alloc(sock_inode_cachep, GFP_KERNEL); + ei = alloc_inode_sb(sb, sock_inode_cachep, GFP_KERNEL); if (!ei) return NULL; init_waitqueue_head(&ei->socket.wq.wait); From patchwork Tue Sep 14 07:29:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12492217 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_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 93D07C433EF for ; Tue, 14 Sep 2021 07:40:39 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3D8F360F21 for ; Tue, 14 Sep 2021 07:40:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 3D8F360F21 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id D87E8900005; Tue, 14 Sep 2021 03:40:38 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D37A8900003; Tue, 14 Sep 2021 03:40:38 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BFF68900005; Tue, 14 Sep 2021 03:40:38 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0097.hostedemail.com [216.40.44.97]) by kanga.kvack.org (Postfix) with ESMTP id B0992900003 for ; Tue, 14 Sep 2021 03:40:38 -0400 (EDT) Received: from smtpin32.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 74D071802658B for ; Tue, 14 Sep 2021 07:40:38 +0000 (UTC) X-FDA: 78585381756.32.2898CE2 Received: from mail-pj1-f51.google.com (mail-pj1-f51.google.com [209.85.216.51]) by imf07.hostedemail.com (Postfix) with ESMTP id 3874210000A8 for ; Tue, 14 Sep 2021 07:40:38 +0000 (UTC) Received: by mail-pj1-f51.google.com with SMTP id k23-20020a17090a591700b001976d2db364so2070696pji.2 for ; Tue, 14 Sep 2021 00:40:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=fApQjSawapzHDI7Jp4q7DITe6weMtnGEUAy+vh573JU=; b=O/YTGwiYTLhGu3zNylBhmY2k93u0Y2lSkjAIbiPoY/8oIBOcqiBADUTbRlE5YvFJwl Vlbbl20Xg8XU4SoRDQTXXyoR9HoR/1YQiaUlljHj2RLzCiWbhlzfixlETVxdmSv9NBrY Yo+BOXrhCu3/FJDcB/OiPGGNbrtM6fpJZcu+ojHAhgMf86G3l3rVkxTEluvWIaUm7Qf/ aVn1pueVsj8m9v+lck0AGgSt375rpr4reWCRAzMizfeR3eUH+V+1o2H0krk2tVQ50sfP Fl4jk/6dizbKw9AQqRNXVQkGAA1kBRGmXj4ns4KVkB6xx3oyth8aS7GWF1KIvNp+rZO5 /QTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=fApQjSawapzHDI7Jp4q7DITe6weMtnGEUAy+vh573JU=; b=DMEOiOiTCT2EzZOeghT54f82i2/+lqhkZnYiI2Krmv8q8ekh5o5OO3NhkNg5C7qh5l iHVuFvvNIgB0l8ajUwvAQuLtuwNU31q4rWDBqpa18GBcj4Kcx4kviAaSdbcTGGnuZ83K EDqvZ3887eprhs64T/8vRMZjcK5DB/vn48wT3AbhMhHBJnttO+qvtrqsAqUoBvCdYeXL 4bX2XeVvV/B1esP6ps2OqUjlOStkSzZrGr5otyDlTJRKbmrSJTknGYk1RI3E0nrLQHty 5udQfdvriTvCS+1P+gNwfrsVrWHKC4+LJ9OXvTdvP2uMW2alOy/OKRC4+Tk+ExWbEHFE 6kew== X-Gm-Message-State: AOAM5307/2YiDhPkwN2vSvO4K+Jk1Qtphm62XqiWBQkfzWdaWMJdHUxC KktFm0SxgL1QGTrCsoN/b5rrvQ== X-Google-Smtp-Source: ABdhPJzrBqnGxY3/79/0LfCVIeBfsglBsnuRJJkJ4usqld2XpSAua+m0amwjSViNbLpMZ/tWvievxw== X-Received: by 2002:a17:902:7b84:b0:13b:90a7:e270 with SMTP id w4-20020a1709027b8400b0013b90a7e270mr9343944pll.21.1631605237377; Tue, 14 Sep 2021 00:40:37 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.244]) by smtp.gmail.com with ESMTPSA id s3sm9377839pfd.188.2021.09.14.00.40.30 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Sep 2021 00:40:37 -0700 (PDT) From: Muchun Song To: willy@infradead.org, akpm@linux-foundation.org, hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, shakeelb@google.com, guro@fb.com, shy828301@gmail.com, alexs@kernel.org, richard.weiyang@gmail.com, david@fromorbit.com, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, zhengqi.arch@bytedance.com, duanxiongchun@bytedance.com, fam.zheng@bytedance.com, smuchun@gmail.com, Muchun Song Subject: [PATCH v3 64/76] rpc: allocate inode by using alloc_inode_sb() Date: Tue, 14 Sep 2021 15:29:26 +0800 Message-Id: <20210914072938.6440-65-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20210914072938.6440-1-songmuchun@bytedance.com> References: <20210914072938.6440-1-songmuchun@bytedance.com> MIME-Version: 1.0 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 3874210000A8 X-Stat-Signature: e7j153az89uoub5pq9ffo1srhtr571to Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b="O/YTGwiY"; spf=pass (imf07.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.216.51 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com X-HE-Tag: 1631605238-618648 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 inode allocation is supposed to use alloc_inode_sb(), so convert kmem_cache_alloc() to alloc_inode_sb(). Signed-off-by: Muchun Song --- net/sunrpc/rpc_pipe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c index ee5336d73fdd..7ed4accc480d 100644 --- a/net/sunrpc/rpc_pipe.c +++ b/net/sunrpc/rpc_pipe.c @@ -197,7 +197,7 @@ static struct inode * rpc_alloc_inode(struct super_block *sb) { struct rpc_inode *rpci; - rpci = kmem_cache_alloc(rpc_inode_cachep, GFP_KERNEL); + rpci = alloc_inode_sb(sb, rpc_inode_cachep, GFP_KERNEL); if (!rpci) return NULL; return &rpci->vfs_inode; From patchwork Tue Sep 14 07:29:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12492219 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_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 6E3BAC433F5 for ; Tue, 14 Sep 2021 07:40:46 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 1EE5160238 for ; Tue, 14 Sep 2021 07:40:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 1EE5160238 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id BB211900006; Tue, 14 Sep 2021 03:40:45 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B62AC900003; Tue, 14 Sep 2021 03:40:45 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A2A73900006; Tue, 14 Sep 2021 03:40:45 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0216.hostedemail.com [216.40.44.216]) by kanga.kvack.org (Postfix) with ESMTP id 93274900003 for ; Tue, 14 Sep 2021 03:40:45 -0400 (EDT) Received: from smtpin20.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 5D4128249980 for ; Tue, 14 Sep 2021 07:40:45 +0000 (UTC) X-FDA: 78585382050.20.84F860C Received: from mail-pj1-f52.google.com (mail-pj1-f52.google.com [209.85.216.52]) by imf12.hostedemail.com (Postfix) with ESMTP id 2324F10000AA for ; Tue, 14 Sep 2021 07:40:45 +0000 (UTC) Received: by mail-pj1-f52.google.com with SMTP id w19-20020a17090aaf9300b00191e6d10a19so2072458pjq.1 for ; Tue, 14 Sep 2021 00:40:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=LCwWaL4B2Y5pE/9Q4T3Fxn54/Jx/rWqz+WBfjzit2GM=; b=mhdStjDOqRSJkQrrdwVXkGXjVKmevOem1ZTDInLWzcmNqeGwJm2VQX19TPsL1zL43f 2AjCb4MH6OoEYJQX14SqSruOEC7quL4zifuPxlcC5/O20YbnwUhTQsLGZKbhTiYZmYqn s5EK2BNREI6iSxwugCEZBG7auTi6fzFAcaFCtqMJL++xHIFJRVmHlFR+mBQLyzgHZZ52 euUtJ4O+jTQu+O3POFpUbqno0ZNkGTI/9nyQtHB/6hwqgAdQBKeYld65ISbzW3G6T6dj Tks3ZyPskug8Q6GTwD1zAbGdXX66xv5Btdi82RVsBeWh1An8m40/rOUxgbluWjdBDhdz JEXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=LCwWaL4B2Y5pE/9Q4T3Fxn54/Jx/rWqz+WBfjzit2GM=; b=PTBsp0/rCfgrBCFBqEEu7PnnRmliPUPE1qN21o+ThOyEceBPz0j7FUSSl28cGiMLxz qz7Crw7PghflSrfO3sA7iZJjuVpPEjKu2RVPX5fGYR2pRe4L/38s07tNgeLeIaL5MUvw NR1rxcLHhmStL5Jw8sgu+INmmLDc/AwmuxHX0oMGJGpBsqufJ7PQXkVzj2+WdRMrT3IA l8n3KfvM2ysapkVmcz5+CLmorrU9Elkss2WABYFzNBB73E3f2o5xh1B8j2IXJ8Fhe39u XYFkBZig7+drnTODZzeh/yVuRE08Paik0WseoKEZWR4JR4n7kefrRd6WRr8MI7G9qFkE P/Eg== X-Gm-Message-State: AOAM5302FxaGJS+Mq0vKK7FJUP4nRWyn0UyK2omAkZbm2JW/ngCZp2VV t66PEVL2gtnkVOFIyNMrezImfw== X-Google-Smtp-Source: ABdhPJwZfRb+vBHxjmhzQv2etUWugNveqRS2L/ODQLoA6V4l5IFWyDxrLgFwb8ZuAlSJAvpkyeeMQw== X-Received: by 2002:a17:903:1251:b0:13a:1f5e:20da with SMTP id u17-20020a170903125100b0013a1f5e20damr13984599plh.75.1631605244305; Tue, 14 Sep 2021 00:40:44 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.244]) by smtp.gmail.com with ESMTPSA id s3sm9377839pfd.188.2021.09.14.00.40.37 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Sep 2021 00:40:44 -0700 (PDT) From: Muchun Song To: willy@infradead.org, akpm@linux-foundation.org, hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, shakeelb@google.com, guro@fb.com, shy828301@gmail.com, alexs@kernel.org, richard.weiyang@gmail.com, david@fromorbit.com, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, zhengqi.arch@bytedance.com, duanxiongchun@bytedance.com, fam.zheng@bytedance.com, smuchun@gmail.com, Muchun Song Subject: [PATCH v3 65/76] f2fs: allocate inode by using alloc_inode_sb() Date: Tue, 14 Sep 2021 15:29:27 +0800 Message-Id: <20210914072938.6440-66-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20210914072938.6440-1-songmuchun@bytedance.com> References: <20210914072938.6440-1-songmuchun@bytedance.com> MIME-Version: 1.0 X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 2324F10000AA X-Stat-Signature: 1ieytiq8e7jz4ir4gppeddmn3m88hzzs Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=mhdStjDO; spf=pass (imf12.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.216.52 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com X-HE-Tag: 1631605245-834957 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 inode allocation is supposed to use alloc_inode_sb(), so convert kmem_cache_alloc() to alloc_inode_sb(). Signed-off-by: Muchun Song --- fs/f2fs/super.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 78ebc306ee2b..20e335f50219 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -1306,8 +1306,12 @@ static struct inode *f2fs_alloc_inode(struct super_block *sb) { struct f2fs_inode_info *fi; - fi = f2fs_kmem_cache_alloc(f2fs_inode_cachep, - GFP_F2FS_ZERO, false, F2FS_SB(sb)); + if (time_to_inject(F2FS_SB(sb), FAULT_SLAB_ALLOC)) { + f2fs_show_injection_info(F2FS_SB(sb), FAULT_SLAB_ALLOC); + return NULL; + } + + fi = alloc_inode_sb(sb, f2fs_inode_cachep, GFP_F2FS_ZERO); if (!fi) return NULL; From patchwork Tue Sep 14 07:29:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12492221 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_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 67835C433EF for ; Tue, 14 Sep 2021 07:40:53 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 1C38E60238 for ; Tue, 14 Sep 2021 07:40:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 1C38E60238 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id B15D5900007; Tue, 14 Sep 2021 03:40:52 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AC5B4900003; Tue, 14 Sep 2021 03:40:52 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 98D8A900007; Tue, 14 Sep 2021 03:40:52 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0214.hostedemail.com [216.40.44.214]) by kanga.kvack.org (Postfix) with ESMTP id 87C48900003 for ; Tue, 14 Sep 2021 03:40:52 -0400 (EDT) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 4956118016C95 for ; Tue, 14 Sep 2021 07:40:52 +0000 (UTC) X-FDA: 78585382344.16.DAC7416 Received: from mail-pj1-f44.google.com (mail-pj1-f44.google.com [209.85.216.44]) by imf05.hostedemail.com (Postfix) with ESMTP id 14694505EABF for ; Tue, 14 Sep 2021 07:40:51 +0000 (UTC) Received: by mail-pj1-f44.google.com with SMTP id v19so5571657pjh.2 for ; Tue, 14 Sep 2021 00:40:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=W7N2ct9tvwpvEjrUOuEEAnTDqNZXNpAiEvvqkroYr+g=; b=DOpx1CJ2zyMUBIYVvYbn9KZsvOmM0xtzgQa0szzWtKfa8BR+wT5M5b0seZIArEajpt QkncVIkRyezGX2cI8ChFns8XugtYPL9OhrPRrbrKvjaenWsnq4HdZZnLmaPk33OB4ocv ZvUT4J8ooe3C6CIq1tGg0CNlVCKJbmawhnYWWqN0c4xFs35JJHgfNcIM2wr9DNKrv23a 0QogI1E74nVwuagJgn92+lN7fU3C7K8xHqbruztaGiNcP1+3mzo30G98F/iHqb/sZLnT mS7LbsOAijHCVXVpN1JGe914qg1BpPhy0SitZ/ju1sPEeJIDssm/9CeXCaD0xzbCMPT/ M0XA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=W7N2ct9tvwpvEjrUOuEEAnTDqNZXNpAiEvvqkroYr+g=; b=4E0X+krdXTJR/x6raE/ztl8NbHrnk9I/tE/dcLAlEIULal95QtO5EpiqYhVmqGBD18 W8582PbZdJULRrToDVcA1eRsvk53wUwL4nmct28YUEDcyiPcHcb7uUO2G1xSg1YcyemH kGMvTXXrxS47yrBWPDKp7tKYc0aD2ufzh9lKOTc+Houd577xRlfmPSIaPmMV8Dv3pOwt cyEv1Wzzq7Nhn3ZWdRhpvw//CLkkVZcB23CdnRqU2NwBmAQKWpMU4wub7XmKWN1bH08v 6VChjEkbaZ1Hbl2PBUG2c03zKzl4p5OvK8S1duvDsoo2hC367uETwOQNVl4cvf2UNDWQ Rh2Q== X-Gm-Message-State: AOAM532wgSnx19kn+2clW8CSQBPWn6TU6krVA+1o9r2VLTgzNjeN4yK9 ZbJaHzaSviU//cYrymawkit7L77E0P/BXA== X-Google-Smtp-Source: ABdhPJyUqRiw/WTDm2ITKMLJOz5RXupAXbuRZ/rJw6cElT1qm3/+XzOPvLxkwdjcsoVkI/g7nI3Exw== X-Received: by 2002:a17:90b:3849:: with SMTP id nl9mr541586pjb.155.1631605251249; Tue, 14 Sep 2021 00:40:51 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.244]) by smtp.gmail.com with ESMTPSA id s3sm9377839pfd.188.2021.09.14.00.40.44 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Sep 2021 00:40:50 -0700 (PDT) From: Muchun Song To: willy@infradead.org, akpm@linux-foundation.org, hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, shakeelb@google.com, guro@fb.com, shy828301@gmail.com, alexs@kernel.org, richard.weiyang@gmail.com, david@fromorbit.com, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, zhengqi.arch@bytedance.com, duanxiongchun@bytedance.com, fam.zheng@bytedance.com, smuchun@gmail.com, Muchun Song Subject: [PATCH v3 66/76] nfs42: use a specific kmem_cache to allocate nfs4_xattr_entry Date: Tue, 14 Sep 2021 15:29:28 +0800 Message-Id: <20210914072938.6440-67-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20210914072938.6440-1-songmuchun@bytedance.com> References: <20210914072938.6440-1-songmuchun@bytedance.com> MIME-Version: 1.0 Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=DOpx1CJ2; spf=pass (imf05.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.216.44 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 14694505EABF X-Stat-Signature: tkjt7yas6kk6cksqyki3gwotbwdbef68 X-HE-Tag: 1631605251-581427 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: If we want to add the allocated objects to its list_lru, we should use kmem_cache_alloc_lru() to allocate objects. So intruduce nfs4_xattr_entry_cachep which is used to allocate nfs4_xattr_entry. Signed-off-by: Muchun Song --- fs/nfs/nfs42xattr.c | 95 ++++++++++++++++++++++++++--------------------------- 1 file changed, 47 insertions(+), 48 deletions(-) diff --git a/fs/nfs/nfs42xattr.c b/fs/nfs/nfs42xattr.c index 1c4d2a05b401..5b7af9080db0 100644 --- a/fs/nfs/nfs42xattr.c +++ b/fs/nfs/nfs42xattr.c @@ -81,7 +81,7 @@ struct nfs4_xattr_entry { struct hlist_node hnode; struct list_head lru; struct list_head dispose; - char *xattr_name; + const char *xattr_name; void *xattr_value; size_t xattr_size; struct nfs4_xattr_bucket *bucket; @@ -98,6 +98,7 @@ static struct list_lru nfs4_xattr_entry_lru; static struct list_lru nfs4_xattr_large_entry_lru; static struct kmem_cache *nfs4_xattr_cache_cachep; +static struct kmem_cache *nfs4_xattr_entry_cachep; /* * Hashing helper functions. @@ -177,49 +178,27 @@ nfs4_xattr_alloc_entry(const char *name, const void *value, { struct nfs4_xattr_entry *entry; void *valp; - char *namep; - size_t alloclen, slen; - char *buf; - uint32_t flags; + const char *namep; + uint32_t flags = len > PAGE_SIZE ? NFS4_XATTR_ENTRY_EXTVAL : 0; + gfp_t gfp = GFP_KERNEL_ACCOUNT | GFP_NOFS; + struct list_lru *lru; BUILD_BUG_ON(sizeof(struct nfs4_xattr_entry) + XATTR_NAME_MAX + 1 > PAGE_SIZE); - alloclen = sizeof(struct nfs4_xattr_entry); - if (name != NULL) { - slen = strlen(name) + 1; - alloclen += slen; - } else - slen = 0; - - if (alloclen + len <= PAGE_SIZE) { - alloclen += len; - flags = 0; - } else { - flags = NFS4_XATTR_ENTRY_EXTVAL; - } - - buf = kmalloc(alloclen, GFP_KERNEL_ACCOUNT | GFP_NOFS); - if (buf == NULL) + lru = flags & NFS4_XATTR_ENTRY_EXTVAL ? &nfs4_xattr_large_entry_lru : + &nfs4_xattr_entry_lru; + entry = kmem_cache_alloc_lru(nfs4_xattr_entry_cachep, lru, gfp); + if (!entry) return NULL; - entry = (struct nfs4_xattr_entry *)buf; - - if (name != NULL) { - namep = buf + sizeof(struct nfs4_xattr_entry); - memcpy(namep, name, slen); - } else { - namep = NULL; - } - - - if (flags & NFS4_XATTR_ENTRY_EXTVAL) { - valp = kvmalloc(len, GFP_KERNEL_ACCOUNT | GFP_NOFS); - if (valp == NULL) { - kfree(buf); - return NULL; - } - } else if (len != 0) { - valp = buf + sizeof(struct nfs4_xattr_entry) + slen; + namep = kstrdup_const(name, gfp); + if (!namep && name) + goto free_buf; + + if (len != 0) { + valp = kvmalloc(len, gfp); + if (!valp) + goto free_name; } else valp = NULL; @@ -232,23 +211,23 @@ nfs4_xattr_alloc_entry(const char *name, const void *value, entry->flags = flags; entry->xattr_value = valp; - kref_init(&entry->ref); entry->xattr_name = namep; entry->xattr_size = len; - entry->bucket = NULL; - INIT_LIST_HEAD(&entry->lru); - INIT_LIST_HEAD(&entry->dispose); - INIT_HLIST_NODE(&entry->hnode); return entry; +free_name: + kfree_const(namep); +free_buf: + kmem_cache_free(nfs4_xattr_entry_cachep, entry); + return NULL; } static void nfs4_xattr_free_entry(struct nfs4_xattr_entry *entry) { - if (entry->flags & NFS4_XATTR_ENTRY_EXTVAL) - kvfree(entry->xattr_value); - kfree(entry); + kvfree(entry->xattr_value); + kfree_const(entry->xattr_name); + kmem_cache_free(nfs4_xattr_entry_cachep, entry); } static void @@ -289,7 +268,7 @@ nfs4_xattr_alloc_cache(void) { struct nfs4_xattr_cache *cache; - cache = kmem_cache_alloc(nfs4_xattr_cache_cachep, + cache = kmem_cache_alloc_lru(nfs4_xattr_cache_cachep, &nfs4_xattr_cache_lru, GFP_KERNEL_ACCOUNT | GFP_NOFS); if (cache == NULL) return NULL; @@ -992,6 +971,17 @@ static void nfs4_xattr_cache_init_once(void *p) INIT_LIST_HEAD(&cache->dispose); } +static void nfs4_xattr_entry_init_once(void *p) +{ + struct nfs4_xattr_entry *entry = p; + + kref_init(&entry->ref); + entry->bucket = NULL; + INIT_LIST_HEAD(&entry->lru); + INIT_LIST_HEAD(&entry->dispose); + INIT_HLIST_NODE(&entry->hnode); +} + int __init nfs4_xattr_cache_init(void) { int ret = 0; @@ -1003,6 +993,13 @@ int __init nfs4_xattr_cache_init(void) if (nfs4_xattr_cache_cachep == NULL) return -ENOMEM; + nfs4_xattr_entry_cachep = kmem_cache_create("nfs4_xattr_entry", + sizeof(struct nfs4_xattr_entry), 0, + (SLAB_RECLAIM_ACCOUNT | SLAB_MEM_SPREAD | SLAB_ACCOUNT), + nfs4_xattr_entry_init_once); + if (!nfs4_xattr_entry_cachep) + goto out5; + ret = list_lru_init_memcg(&nfs4_xattr_large_entry_lru, &nfs4_xattr_large_entry_shrinker); if (ret) @@ -1040,6 +1037,8 @@ int __init nfs4_xattr_cache_init(void) out3: list_lru_destroy(&nfs4_xattr_large_entry_lru); out4: + kmem_cache_destroy(nfs4_xattr_entry_cachep); +out5: kmem_cache_destroy(nfs4_xattr_cache_cachep); return ret; From patchwork Tue Sep 14 07:29:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12492223 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_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 0C321C433F5 for ; Tue, 14 Sep 2021 07:41:00 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B3DA460238 for ; Tue, 14 Sep 2021 07:40:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org B3DA460238 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 598CC900008; Tue, 14 Sep 2021 03:40:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5482F900003; Tue, 14 Sep 2021 03:40:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 40FF3900008; Tue, 14 Sep 2021 03:40:59 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0206.hostedemail.com [216.40.44.206]) by kanga.kvack.org (Postfix) with ESMTP id 3172E900003 for ; Tue, 14 Sep 2021 03:40:59 -0400 (EDT) Received: from smtpin38.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id E7B95180AD5C9 for ; Tue, 14 Sep 2021 07:40:58 +0000 (UTC) X-FDA: 78585382596.38.9ED9178 Received: from mail-pj1-f43.google.com (mail-pj1-f43.google.com [209.85.216.43]) by imf09.hostedemail.com (Postfix) with ESMTP id A744F3000105 for ; Tue, 14 Sep 2021 07:40:58 +0000 (UTC) Received: by mail-pj1-f43.google.com with SMTP id f3-20020a17090a638300b00199097ddf1aso1502160pjj.0 for ; Tue, 14 Sep 2021 00:40:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=y++panFifneasGq960GJtHjLst8uLUglPFxOcyVBRks=; b=JhAlTvU3RWk3oRDa2aTY8JKMFt9Ez7Qvhwau43LIZwVt3n/yJ2Ir8tLfT7NZ0H6X12 BDxLL+Oux2/7MjK3Lk+uIMdVrHQuYow40eQBrr/gTXkfEwB7Uc1quD/ffiKvxxblMBvm xEsvUkz22/wDzy0vSKKxw6k8g7pGDQtRTRrQNErOmdxF+ohBQk1K0XBFi5DnQYBH2r/W IWr5m2jyR7dnpVY7TDJbByTDRTtN51tcAQmDTCpmEb3lkUzPTJT8DNyN5RjuxCE9V1RT qXCa7mzgwY58hyW6b0OW7M80G8cYfjWnRViBLfe9PQZFD5CmWIplOlDoNwplM8r58hcM 25UA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=y++panFifneasGq960GJtHjLst8uLUglPFxOcyVBRks=; b=P/pAv84jB3N2aODdlQjxrkCXbIKkverAcyyyb+sd5Th49GL/Aup0xUyxNvqHSFTCGL ijGBNCSBzwph+CaHJU2xT4s8RkFOaAJzDZYtIkepefK43mI2KabJiw/NiOLeJafp/rGN gLUIBT3kpWTKshsfpJrJ5dm57shREfy9JzthhPJdXpnGUnff3e6fdSqmPiAc6+ohXuu2 NwXLSs7SDd8bm6kdwoWcTIn23laimFRmzLs4mrrlKQpP9+MKXv3XMBLAfOHpsMrYFZwu ta9G0QAdrCEOIHNOPSY2VqTDBM2TfbWORX8uk0LjpBsy0FJeDkDVvJnrYhr7zF6YHzd3 gdVw== X-Gm-Message-State: AOAM531A407PX/vIewXJhnQy3C4tXjjphqcFtd45jhJo9AIxrk+t5+sL fcPRaBZiBwC1HPKTNPBTVcV7NA== X-Google-Smtp-Source: ABdhPJyAUjo4UZB4NIB2ZL+LCFQmoGF92sZYCgPBvTgn0UV2XRJw/w5a6fkyBczWBG3bB61VQWmbxw== X-Received: by 2002:a17:90a:9a2:: with SMTP id 31mr588698pjo.58.1631605257891; Tue, 14 Sep 2021 00:40:57 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.244]) by smtp.gmail.com with ESMTPSA id s3sm9377839pfd.188.2021.09.14.00.40.51 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Sep 2021 00:40:57 -0700 (PDT) From: Muchun Song To: willy@infradead.org, akpm@linux-foundation.org, hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, shakeelb@google.com, guro@fb.com, shy828301@gmail.com, alexs@kernel.org, richard.weiyang@gmail.com, david@fromorbit.com, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, zhengqi.arch@bytedance.com, duanxiongchun@bytedance.com, fam.zheng@bytedance.com, smuchun@gmail.com, Muchun Song Subject: [PATCH v3 67/76] mm: dcache: use kmem_cache_alloc_lru() to allocate dentry Date: Tue, 14 Sep 2021 15:29:29 +0800 Message-Id: <20210914072938.6440-68-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20210914072938.6440-1-songmuchun@bytedance.com> References: <20210914072938.6440-1-songmuchun@bytedance.com> MIME-Version: 1.0 X-Stat-Signature: ubu4hpy1uhbt493jnpdzideuu8f8mz16 Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=JhAlTvU3; dmarc=pass (policy=none) header.from=bytedance.com; spf=pass (imf09.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.216.43 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: A744F3000105 X-HE-Tag: 1631605258-135894 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: Like inode cache, the dentry will also be added to its memcg list_lru. So replace kmem_cache_alloc() with kmem_cache_alloc_lru() to allocate dentry. Signed-off-by: Muchun Song --- fs/dcache.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/dcache.c b/fs/dcache.c index cf871a81f4fd..36d4806d7284 100644 --- a/fs/dcache.c +++ b/fs/dcache.c @@ -1741,7 +1741,8 @@ static struct dentry *__d_alloc(struct super_block *sb, const struct qstr *name) char *dname; int err; - dentry = kmem_cache_alloc(dentry_cache, GFP_KERNEL); + dentry = kmem_cache_alloc_lru(dentry_cache, &sb->s_dentry_lru, + GFP_KERNEL); if (!dentry) return NULL; From patchwork Tue Sep 14 07:29:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12492225 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_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 A0E95C433F5 for ; Tue, 14 Sep 2021 07:41:06 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 554DB60F4A for ; Tue, 14 Sep 2021 07:41:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 554DB60F4A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id F0E67900009; Tue, 14 Sep 2021 03:41:05 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EBDCC900003; Tue, 14 Sep 2021 03:41:05 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D85F5900009; Tue, 14 Sep 2021 03:41:05 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0227.hostedemail.com [216.40.44.227]) by kanga.kvack.org (Postfix) with ESMTP id C8B00900003 for ; Tue, 14 Sep 2021 03:41:05 -0400 (EDT) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 8BC5E299DB for ; Tue, 14 Sep 2021 07:41:05 +0000 (UTC) X-FDA: 78585382890.13.5BC961B Received: from mail-pj1-f53.google.com (mail-pj1-f53.google.com [209.85.216.53]) by imf13.hostedemail.com (Postfix) with ESMTP id 5655B102E516 for ; Tue, 14 Sep 2021 07:41:05 +0000 (UTC) Received: by mail-pj1-f53.google.com with SMTP id f3-20020a17090a638300b00199097ddf1aso1502400pjj.0 for ; Tue, 14 Sep 2021 00:41:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=O9BJLsBD6jksCciTZGdmyHq2qkXc8II2TIDnrT2cyiU=; b=cxJV9i43g6uZ64FMZlPy6vGws06VDwvTYOU9J60k2oXFzhujZG9VoAPuhPBT9r/YiN Ab4AAog0W/jtZekEXv66wyjDw/oUvI6mkO/SwrMoxubzvfuSs5P3/mKXw5Ff1Qv1lf5e wGbXHU8HJ++y2FEg8o0rWeAje5ppyGGqA+8+Qj7gMUt8/QY/Twi8JOWRYK231oLK0Dbr 6UC70hV6iVuq0zR8hkLYicw2UTucdi71woBs/u4D5EMK5j2JkEiT2CIcRJNdGWq1OJgm wdfAiWYT1P8R0LwJqfenct+YSLo6jk7+r2UgPIqEnNhykvt01imNPXAoq1BZ5CYBeLac 2otg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=O9BJLsBD6jksCciTZGdmyHq2qkXc8II2TIDnrT2cyiU=; b=f3sC9FZH3z0+wb6rrUuTCOAiDCy4jLpiT9QcFwTAucq/R2UDEeoyDJooBwH8Dsilbg ymDzql294sC2lJIF/haLT8e1PgEpgaOeWX9sxAuhc5lhRJsbcFLdvoOIHc6C2DZO8YDX avhBKYQotnNEreXmRatcQcAUyahmvIGt2d1bbhair7nzrAwyhZlPvf0Uc+1LupZS6PHE oEdDGMrh2fPurFXcRYRtQHPkcM82FQ3Lf4T/I28E8Z6GLtyitJ0Os92gEmizohBY7suP YLvb3b2X7hA8T7PeevHKGQc7C1/MHAW+ImsY7fYRx6XtCbN6ko3IiXXI4ySpV+SQJ8jk iR+w== X-Gm-Message-State: AOAM53382KpUmGkvD3GAANukZ12ELtQrUu1EBvASBf1Oz0M3mafRPTLb icqqa/CAR0D0IlnjUXAU1tPVXA== X-Google-Smtp-Source: ABdhPJwYxpqxp3oj2dLcwakc4I2z7loWq7/YRxBwPe8CJLXtMsP9qjDSPfIdzINHdcZRHHPu0VRRwA== X-Received: by 2002:a17:90b:3890:: with SMTP id mu16mr605394pjb.78.1631605264454; Tue, 14 Sep 2021 00:41:04 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.244]) by smtp.gmail.com with ESMTPSA id s3sm9377839pfd.188.2021.09.14.00.40.58 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Sep 2021 00:41:04 -0700 (PDT) From: Muchun Song To: willy@infradead.org, akpm@linux-foundation.org, hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, shakeelb@google.com, guro@fb.com, shy828301@gmail.com, alexs@kernel.org, richard.weiyang@gmail.com, david@fromorbit.com, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, zhengqi.arch@bytedance.com, duanxiongchun@bytedance.com, fam.zheng@bytedance.com, smuchun@gmail.com, Muchun Song Subject: [PATCH v3 68/76] xarray: use kmem_cache_alloc_lru to allocate xa_node Date: Tue, 14 Sep 2021 15:29:30 +0800 Message-Id: <20210914072938.6440-69-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20210914072938.6440-1-songmuchun@bytedance.com> References: <20210914072938.6440-1-songmuchun@bytedance.com> MIME-Version: 1.0 X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 5655B102E516 Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=cxJV9i43; dmarc=pass (policy=none) header.from=bytedance.com; spf=pass (imf13.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.216.53 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com X-Stat-Signature: qpgc1nogcjdomiqgscpqq71my4y1rwt5 X-HE-Tag: 1631605265-441116 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 workingset will add the xa_node to the shadow_nodes list. So the allocation of xa_node should be done by kmem_cache_alloc_lru(). The workingset can use xas_set_lru() to pass the list_lru. Signed-off-by: Muchun Song --- include/linux/xarray.h | 9 ++++++++- lib/xarray.c | 10 +++++----- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/include/linux/xarray.h b/include/linux/xarray.h index a91e3d90df8a..31f3e5ef3c7b 100644 --- a/include/linux/xarray.h +++ b/include/linux/xarray.h @@ -1317,6 +1317,7 @@ struct xa_state { struct xa_node *xa_node; struct xa_node *xa_alloc; xa_update_node_t xa_update; + struct list_lru *xa_lru; }; /* @@ -1336,7 +1337,8 @@ struct xa_state { .xa_pad = 0, \ .xa_node = XAS_RESTART, \ .xa_alloc = NULL, \ - .xa_update = NULL \ + .xa_update = NULL, \ + .xa_lru = NULL, \ } /** @@ -1613,6 +1615,11 @@ static inline void xas_set_update(struct xa_state *xas, xa_update_node_t update) xas->xa_update = update; } +static inline void xas_set_lru(struct xa_state *xas, struct list_lru *lru) +{ + xas->xa_lru = lru; +} + /** * xas_next_entry() - Advance iterator to next present entry. * @xas: XArray operation state. diff --git a/lib/xarray.c b/lib/xarray.c index f5d8f54907b4..e9b818abc823 100644 --- a/lib/xarray.c +++ b/lib/xarray.c @@ -302,7 +302,7 @@ bool xas_nomem(struct xa_state *xas, gfp_t gfp) } if (xas->xa->xa_flags & XA_FLAGS_ACCOUNT) gfp |= __GFP_ACCOUNT; - xas->xa_alloc = kmem_cache_alloc(radix_tree_node_cachep, gfp); + xas->xa_alloc = kmem_cache_alloc_lru(radix_tree_node_cachep, xas->xa_lru, gfp); if (!xas->xa_alloc) return false; xas->xa_alloc->parent = NULL; @@ -334,10 +334,10 @@ static bool __xas_nomem(struct xa_state *xas, gfp_t gfp) gfp |= __GFP_ACCOUNT; if (gfpflags_allow_blocking(gfp)) { xas_unlock_type(xas, lock_type); - xas->xa_alloc = kmem_cache_alloc(radix_tree_node_cachep, gfp); + xas->xa_alloc = kmem_cache_alloc_lru(radix_tree_node_cachep, xas->xa_lru, gfp); xas_lock_type(xas, lock_type); } else { - xas->xa_alloc = kmem_cache_alloc(radix_tree_node_cachep, gfp); + xas->xa_alloc = kmem_cache_alloc_lru(radix_tree_node_cachep, xas->xa_lru, gfp); } if (!xas->xa_alloc) return false; @@ -371,7 +371,7 @@ static void *xas_alloc(struct xa_state *xas, unsigned int shift) if (xas->xa->xa_flags & XA_FLAGS_ACCOUNT) gfp |= __GFP_ACCOUNT; - node = kmem_cache_alloc(radix_tree_node_cachep, gfp); + node = kmem_cache_alloc_lru(radix_tree_node_cachep, xas->xa_lru, gfp); if (!node) { xas_set_err(xas, -ENOMEM); return NULL; @@ -1014,7 +1014,7 @@ void xas_split_alloc(struct xa_state *xas, void *entry, unsigned int order, void *sibling = NULL; struct xa_node *node; - node = kmem_cache_alloc(radix_tree_node_cachep, gfp); + node = kmem_cache_alloc_lru(radix_tree_node_cachep, xas->xa_lru, gfp); if (!node) goto nomem; node->array = xas->xa; From patchwork Tue Sep 14 07:29:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12492227 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_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 9B8D9C433F5 for ; Tue, 14 Sep 2021 07:41:13 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 4F12660F21 for ; Tue, 14 Sep 2021 07:41:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 4F12660F21 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id EE64790000A; Tue, 14 Sep 2021 03:41:12 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E965A900003; Tue, 14 Sep 2021 03:41:12 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D5E6990000A; Tue, 14 Sep 2021 03:41:12 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0133.hostedemail.com [216.40.44.133]) by kanga.kvack.org (Postfix) with ESMTP id C6D03900003 for ; Tue, 14 Sep 2021 03:41:12 -0400 (EDT) Received: from smtpin02.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 8A0938249980 for ; Tue, 14 Sep 2021 07:41:12 +0000 (UTC) X-FDA: 78585383184.02.C30D232 Received: from mail-pf1-f180.google.com (mail-pf1-f180.google.com [209.85.210.180]) by imf16.hostedemail.com (Postfix) with ESMTP id 52841F000099 for ; Tue, 14 Sep 2021 07:41:12 +0000 (UTC) Received: by mail-pf1-f180.google.com with SMTP id y8so5978983pfa.7 for ; Tue, 14 Sep 2021 00:41:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4T6fbnji2w+O5LBzPcVogdbENpOl+aUZAj36pVasjlI=; b=iBv7u24cPtEPUSq433+Xa+dG3Lc2xTpAdIaCPxf4NFQpUIoMOOuO6yeJJrZ0t07NNY WQyPjqujIL8pKRWq3AFaOmwgjL6/jcxC+HJKlE/LGHMOz026mWZ/gXP9qP1dX3IPVdTL 1VTsRC2FR+M2gRiYgJKaQ6F69qpGKWjXouYo72fR3U4H4SIVU/ErAvOyXafFheiBsqZJ uuq3xVcdEUoe6tWl43opKGQIlaB2/7sMyU/6HbcikcWolgMF9Poa8jJXSDq4rFqtoMC2 0deJk112ody2ZouGBhxpf9G/UTlvUX1BQ/BiscDt0L03FRwTE73OthtYVNsKatIwHAkk MjxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4T6fbnji2w+O5LBzPcVogdbENpOl+aUZAj36pVasjlI=; b=6PgydWSEte1pJYEBJY3ZemMriFwdlU03+CpGQGfGeVqbrFNGQSmg+euyR0TehAlwLd fwPRyaSMknaxBh0HcyvFN601Yw+aYx36obD6Qe5gLLwYe1N/NbdF+LB4bJ5T1xbUNDWR wVLpXhBWA7dJJms4/CEkMLEp0UK48FEWQctv1yWImsNK09n3w+swQ4Ae4Mvjv0NYU+8Q nRH6nu+8Q6CjOoAZlJW1ML0Om9Qw9t5KM3aTS18nMxyH+edTCHMUg1Zt+w4obVCSIzQm YJ9gXT4TFX8UXtsvhD/QdRyP0Iqvf5NyOC85XzIUQGKdBjoBt5Z5ZUJL0WBcKYmVCTxF 2/rg== X-Gm-Message-State: AOAM531dJhllzT1giagpxjOsWA3CRICwK6xqiZZGlehI19KeeYenjsLg 6fUFecKEFR2qvsaS4Zx+F77mZw== X-Google-Smtp-Source: ABdhPJyTeptvaUP+2ev79oZqEGP7c6/d9yXSdY08Q82N9/DM1qNzvHM+i0fpNv7p17+zTU3QE2O/2A== X-Received: by 2002:a63:e516:: with SMTP id r22mr14522315pgh.197.1631605271555; Tue, 14 Sep 2021 00:41:11 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.244]) by smtp.gmail.com with ESMTPSA id s3sm9377839pfd.188.2021.09.14.00.41.04 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Sep 2021 00:41:11 -0700 (PDT) From: Muchun Song To: willy@infradead.org, akpm@linux-foundation.org, hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, shakeelb@google.com, guro@fb.com, shy828301@gmail.com, alexs@kernel.org, richard.weiyang@gmail.com, david@fromorbit.com, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, zhengqi.arch@bytedance.com, duanxiongchun@bytedance.com, fam.zheng@bytedance.com, smuchun@gmail.com, Muchun Song Subject: [PATCH v3 69/76] mm: workingset: use xas_set_lru() to pass shadow_nodes Date: Tue, 14 Sep 2021 15:29:31 +0800 Message-Id: <20210914072938.6440-70-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20210914072938.6440-1-songmuchun@bytedance.com> References: <20210914072938.6440-1-songmuchun@bytedance.com> MIME-Version: 1.0 X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 52841F000099 X-Stat-Signature: m71z71dbgik91cxmm7ntjy759jyfs167 Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=iBv7u24c; spf=pass (imf16.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.210.180 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com X-HE-Tag: 1631605272-673432 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 workingset will add the xa_node to shadow_nodes, so we should use xas_set_lru() to pass the list_lru which we want to insert xa_node into to set up the xa_node reclaim context correctly. Signed-off-by: Muchun Song --- include/linux/swap.h | 5 ++++- mm/workingset.c | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/include/linux/swap.h b/include/linux/swap.h index cdf0957a88a4..629262582eb9 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h @@ -334,9 +334,12 @@ void workingset_activation(struct folio *folio); /* Only track the nodes of mappings with shadow entries */ void workingset_update_node(struct xa_node *node); +extern struct list_lru shadow_nodes; #define mapping_set_update(xas, mapping) do { \ - if (!dax_mapping(mapping) && !shmem_mapping(mapping)) \ + if (!dax_mapping(mapping) && !shmem_mapping(mapping)) { \ xas_set_update(xas, workingset_update_node); \ + xas_set_lru(xas, &shadow_nodes); \ + } \ } while (0) /* linux/mm/page_alloc.c */ diff --git a/mm/workingset.c b/mm/workingset.c index e9cc99ebdec7..5a38c08ca1c4 100644 --- a/mm/workingset.c +++ b/mm/workingset.c @@ -428,7 +428,7 @@ void workingset_activation(struct folio *folio) * point where they would still be useful. */ -static struct list_lru shadow_nodes; +struct list_lru shadow_nodes; void workingset_update_node(struct xa_node *node) { From patchwork Tue Sep 14 07:29:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12492229 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_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 C8989C433F5 for ; Tue, 14 Sep 2021 07:41:20 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 6AF7060238 for ; Tue, 14 Sep 2021 07:41:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 6AF7060238 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 1039990000B; Tue, 14 Sep 2021 03:41:20 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0B41B900003; Tue, 14 Sep 2021 03:41:20 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EBD9190000B; Tue, 14 Sep 2021 03:41:19 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0185.hostedemail.com [216.40.44.185]) by kanga.kvack.org (Postfix) with ESMTP id DDD5F900003 for ; Tue, 14 Sep 2021 03:41:19 -0400 (EDT) Received: from smtpin35.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 9CBC72B36E for ; Tue, 14 Sep 2021 07:41:19 +0000 (UTC) X-FDA: 78585383478.35.71417D4 Received: from mail-pj1-f49.google.com (mail-pj1-f49.google.com [209.85.216.49]) by imf24.hostedemail.com (Postfix) with ESMTP id 5FDC8B0000A0 for ; Tue, 14 Sep 2021 07:41:19 +0000 (UTC) Received: by mail-pj1-f49.google.com with SMTP id n13-20020a17090a4e0d00b0017946980d8dso1446350pjh.5 for ; Tue, 14 Sep 2021 00:41:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=OxvfsGkKeBEY2itVvQZ6+QMFfMS4SNIyE7u/7vw52Iw=; b=MmJn02iHhdABrRmbmf8BSrQ+CdzyPJhawXtW7d4P1ZH5LGYmm511on5hCVAbNivQrq 7Ah82nMAtVWA14gMJhkkKms/9ET0uolPvTyu5/KxF2IYvzgLUf9nnN7hPhbMLsPIo4xQ dHB73TJQ8g9idDHpQSTf29yr2VpMfumIwW8SUOplv8bjy3tLex8OcqsFCowg7wpepoTQ 8ZsTatW4f4V541LuK1IGldIO6HTHnDuPI6Sa4B8kFtBoMLEMaRZWyiasAHy+dGy5gU+/ UYb1F1te4TIFalhk9s/dyhQgtjP4amRaFGOPlmmJkdHcenhe1vCJQjNbOL9WxKDOyJwy BF7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=OxvfsGkKeBEY2itVvQZ6+QMFfMS4SNIyE7u/7vw52Iw=; b=iTg2S5H2ufgweOcTqX21MhFLeLZ8wlF/QHaNWOHVf2KOzIOso0UTO7CCKT2Y+3fu5w wW/uYD4LdFBaRvK780rVXtzKyzOE5cg2XepxFYIie+pxiZ+wIJVd38zujfcD9f4/4qNk zUJg66SIefnuEEnqBnHach1JRWVVgjlfIHu0AkKRJ8K/LtdA6OWxBIJfKsSEcaqyV8zq JXiInIags0u/zRebed8CUQ+6B03IgJaPuLgF25au+RV3AZmcA6YQGAgpghpfrPAOTd0K rxCVOiPdZGQqglLVRX88iBrTOup3uNryvn3vC3ySlp3TnY6UUlvndaUQjKiDJmWe95QQ nUHQ== X-Gm-Message-State: AOAM530qcC/r8znrVukJfDYVAs1dSfqMKbGpI9qeAdMCkSpZBVJUBhpf 5MnsJmb6iM3TH/pQ204BEMLNEg== X-Google-Smtp-Source: ABdhPJwNmqVn718jVTEAY+i2ZrXpt4iydXzHIiOuyKDSgGMzgjWVqpcENduFVuPpSXunxnd62/6VzQ== X-Received: by 2002:a17:90a:4ce3:: with SMTP id k90mr538007pjh.237.1631605278515; Tue, 14 Sep 2021 00:41:18 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.244]) by smtp.gmail.com with ESMTPSA id s3sm9377839pfd.188.2021.09.14.00.41.11 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Sep 2021 00:41:18 -0700 (PDT) From: Muchun Song To: willy@infradead.org, akpm@linux-foundation.org, hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, shakeelb@google.com, guro@fb.com, shy828301@gmail.com, alexs@kernel.org, richard.weiyang@gmail.com, david@fromorbit.com, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, zhengqi.arch@bytedance.com, duanxiongchun@bytedance.com, fam.zheng@bytedance.com, smuchun@gmail.com, Muchun Song Subject: [PATCH v3 70/76] mm: list_lru: allocate list_lru_one only when needed Date: Tue, 14 Sep 2021 15:29:32 +0800 Message-Id: <20210914072938.6440-71-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20210914072938.6440-1-songmuchun@bytedance.com> References: <20210914072938.6440-1-songmuchun@bytedance.com> MIME-Version: 1.0 X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 5FDC8B0000A0 Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=MmJn02iH; dmarc=pass (policy=none) header.from=bytedance.com; spf=pass (imf24.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.216.49 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com X-Stat-Signature: 8a3itp7y3mw6n1o8ux4ofuorydc4fkoj X-HE-Tag: 1631605279-217622 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: In our server, we found a suspected memory leak problem. The kmalloc-32 consumes more than 6GB of memory. Other kmem_caches consume less than 2GB memory. After our in-depth analysis, the memory consumption of kmalloc-32 slab cache is the cause of list_lru_one allocation. crash> p memcg_nr_cache_ids memcg_nr_cache_ids = $2 = 24574 memcg_nr_cache_ids is very large and memory consumption of each list_lru can be calculated with the following formula. num_numa_node * memcg_nr_cache_ids * 32 (kmalloc-32) There are 4 numa nodes in our system, so each list_lru consumes ~3MB. crash> list super_blocks | wc -l 952 Every mount will register 2 list lrus, one is for inode, another is for dentry. There are 952 super_blocks. So the total memory is 952 * 2 * 3 MB (~5.6GB). But the number of memory cgroup is less than 500. So I guess more than 12286 containers have been deployed on this machine (I do not know why there are so many containers, it may be a user's bug or the user really want to do that). And memcg_nr_cache_ids has not been reduced to a suitable value. This can waste a lot of memory. Now the infrastructure for dynamic list_lru_one allocation is ready, so remove statically allocated memory code to save memory. Signed-off-by: Muchun Song --- include/linux/list_lru.h | 8 +-- mm/list_lru.c | 125 +++++++++++++++++++++++++++-------------------- mm/memcontrol.c | 7 ++- 3 files changed, 81 insertions(+), 59 deletions(-) diff --git a/include/linux/list_lru.h b/include/linux/list_lru.h index 50a3144016b4..62f407831b8c 100644 --- a/include/linux/list_lru.h +++ b/include/linux/list_lru.h @@ -32,14 +32,15 @@ struct list_lru_one { }; struct list_lru_per_memcg { + struct rcu_head rcu; /* array of per cgroup per node lists, indexed by node id */ - struct list_lru_one nodes[0]; + struct list_lru_one nodes[]; }; struct list_lru_memcg { struct rcu_head rcu; /* array of per cgroup lists, indexed by memcg_cache_id */ - struct list_lru_per_memcg *lrus[]; + struct list_lru_per_memcg __rcu *lrus[]; }; struct list_lru_node { @@ -76,7 +77,8 @@ int __list_lru_init(struct list_lru *lru, bool memcg_aware, __list_lru_init((lru), true, NULL, shrinker) int memcg_update_all_list_lrus(int num_memcgs); -void memcg_drain_all_list_lrus(int src_idx, struct mem_cgroup *dst_memcg); +void memcg_drain_all_list_lrus(struct mem_cgroup *src_memcg, + struct mem_cgroup *dst_memcg); /** * list_lru_add: add an element to the lru list's tail diff --git a/mm/list_lru.c b/mm/list_lru.c index eea29eb4cf48..48651c29a9d1 100644 --- a/mm/list_lru.c +++ b/mm/list_lru.c @@ -60,8 +60,12 @@ list_lru_from_memcg_idx(struct list_lru *lru, int nid, int idx) */ memcg_lrus = rcu_dereference_check(lru->memcg_lrus, lockdep_is_held(&nlru->lock)); - if (memcg_lrus && idx >= 0) - return &memcg_lrus->lrus[idx]->nodes[nid]; + if (memcg_lrus && idx >= 0) { + struct list_lru_per_memcg *mlru; + + mlru = rcu_dereference_check(memcg_lrus->lrus[idx], true); + return mlru ? &mlru->nodes[nid] : NULL; + } return &nlru->lru; } @@ -184,11 +188,12 @@ unsigned long list_lru_count_one(struct list_lru *lru, int nid, struct mem_cgroup *memcg) { struct list_lru_one *l; - long count; + long count = 0; rcu_read_lock(); l = list_lru_from_memcg_idx(lru, nid, memcg_cache_id(memcg)); - count = READ_ONCE(l->nr_items); + if (l) + count = READ_ONCE(l->nr_items); rcu_read_unlock(); if (unlikely(count < 0)) @@ -217,8 +222,11 @@ __list_lru_walk_one(struct list_lru *lru, int nid, int memcg_idx, struct list_head *item, *n; unsigned long isolated = 0; - l = list_lru_from_memcg_idx(lru, nid, memcg_idx); restart: + l = list_lru_from_memcg_idx(lru, nid, memcg_idx); + if (!l) + goto out; + list_for_each_safe(item, n, &l->list) { enum lru_status ret; @@ -262,6 +270,7 @@ __list_lru_walk_one(struct list_lru *lru, int nid, int memcg_idx, BUG(); } } +out: return isolated; } @@ -354,20 +363,26 @@ static struct list_lru_per_memcg *memcg_list_lru_alloc(gfp_t gfp) return lru; } -static int memcg_init_list_lru_range(struct list_lru_memcg *memcg_lrus, - int begin, int end) +static void memcg_list_lru_free(struct list_lru *lru, int src_idx) { - int i; + struct list_lru_memcg *memcg_lrus; + struct list_lru_per_memcg *mlru; - for (i = begin; i < end; i++) { - memcg_lrus->lrus[i] = memcg_list_lru_alloc(GFP_KERNEL); - if (!memcg_lrus->lrus[i]) - goto fail; - } - return 0; -fail: - memcg_destroy_list_lru_range(memcg_lrus, begin, i); - return -ENOMEM; + spin_lock_irq(&lru->lock); + memcg_lrus = rcu_dereference_protected(lru->memcg_lrus, true); + mlru = rcu_dereference_protected(memcg_lrus->lrus[src_idx], true); + if (mlru) + rcu_assign_pointer(memcg_lrus->lrus[src_idx], NULL); + spin_unlock_irq(&lru->lock); + + /* + * The __list_lru_walk_one() can walk the list of this node. + * We need kvfree_rcu() here. And the walking of the list + * is under lru->node[nid]->lock, which can serve as a RCU + * read-side critical section. + */ + if (mlru) + kvfree_rcu(mlru, rcu); } static int memcg_init_list_lru(struct list_lru *lru, bool memcg_aware) @@ -381,15 +396,11 @@ static int memcg_init_list_lru(struct list_lru *lru, bool memcg_aware) spin_lock_init(&lru->lock); - memcg_lrus = kvmalloc(sizeof(*memcg_lrus) + + memcg_lrus = kvzalloc(sizeof(*memcg_lrus) + size * sizeof(memcg_lrus->lrus[0]), GFP_KERNEL); if (!memcg_lrus) return -ENOMEM; - if (memcg_init_list_lru_range(memcg_lrus, 0, size)) { - kvfree(memcg_lrus); - return -ENOMEM; - } RCU_INIT_POINTER(lru->memcg_lrus, memcg_lrus); return 0; @@ -423,13 +434,9 @@ static int memcg_update_list_lru(struct list_lru *lru, int old_size, int new_siz if (!new) return -ENOMEM; - if (memcg_init_list_lru_range(new, old_size, new_size)) { - kvfree(new); - return -ENOMEM; - } - spin_lock_irq(&lru->lock); memcpy(&new->lrus, &old->lrus, old_size * sizeof(new->lrus[0])); + memset(&new->lrus[old_size], 0, (new_size - old_size) * sizeof(new->lrus[0])); rcu_assign_pointer(lru->memcg_lrus, new); spin_unlock_irq(&lru->lock); @@ -437,20 +444,6 @@ static int memcg_update_list_lru(struct list_lru *lru, int old_size, int new_siz return 0; } -static void memcg_cancel_update_list_lru(struct list_lru *lru, - int old_size, int new_size) -{ - struct list_lru_memcg *memcg_lrus; - - memcg_lrus = rcu_dereference_protected(lru->memcg_lrus, - lockdep_is_held(&list_lrus_mutex)); - /* - * Do not bother shrinking the array back to the old size, because we - * cannot handle allocation failures here. - */ - memcg_destroy_list_lru_range(memcg_lrus, old_size, new_size); -} - int memcg_update_all_list_lrus(int new_size) { int ret = 0; @@ -461,15 +454,10 @@ int memcg_update_all_list_lrus(int new_size) list_for_each_entry(lru, &memcg_list_lrus, list) { ret = memcg_update_list_lru(lru, old_size, new_size); if (ret) - goto fail; + break; } -out: mutex_unlock(&list_lrus_mutex); return ret; -fail: - list_for_each_entry_continue_reverse(lru, &memcg_list_lrus, list) - memcg_cancel_update_list_lru(lru, old_size, new_size); - goto out; } static void memcg_drain_list_lru_node(struct list_lru *lru, int nid, @@ -486,6 +474,8 @@ static void memcg_drain_list_lru_node(struct list_lru *lru, int nid, spin_lock_irq(&nlru->lock); src = list_lru_from_memcg_idx(lru, nid, src_idx); + if (!src) + goto out; dst = list_lru_from_memcg_idx(lru, nid, dst_idx); list_splice_init(&src->list, &dst->list); @@ -495,7 +485,7 @@ static void memcg_drain_list_lru_node(struct list_lru *lru, int nid, set_shrinker_bit(dst_memcg, nid, lru_shrinker_id(lru)); src->nr_items = 0; } - +out: spin_unlock_irq(&nlru->lock); } @@ -506,11 +496,37 @@ static void memcg_drain_list_lru(struct list_lru *lru, for_each_node(i) memcg_drain_list_lru_node(lru, i, src_idx, dst_memcg); + + memcg_list_lru_free(lru, src_idx); } -void memcg_drain_all_list_lrus(int src_idx, struct mem_cgroup *dst_memcg) +void memcg_drain_all_list_lrus(struct mem_cgroup *src_memcg, + struct mem_cgroup *dst_memcg) { + struct cgroup_subsys_state *css; struct list_lru *lru; + int src_idx = src_memcg->kmemcg_id; + + /* + * Change kmemcg_id of this cgroup and all its descendants to the + * parent's id, and then move all entries from this cgroup's list_lrus + * to ones of the parent. + * + * After we have finished, all list_lrus corresponding to this cgroup + * are guaranteed to remain empty. So we can safely free this cgroup's + * list lrus which is freed in memcg_list_lru_free(). + * Changing ->kmemcg_id to the parent can prevent list_lru_memcg_alloc() + * from allocating list lrus for this cgroup after calling + * memcg_list_lru_free(). + */ + rcu_read_lock(); + css_for_each_descendant_pre(css, &src_memcg->css) { + struct mem_cgroup *memcg; + + memcg = mem_cgroup_from_css(css); + memcg->kmemcg_id = dst_memcg->kmemcg_id; + } + rcu_read_unlock(); mutex_lock(&list_lrus_mutex); list_for_each_entry(lru, &memcg_list_lrus, list) @@ -529,7 +545,7 @@ static bool memcg_list_lru_skip_alloc(struct list_lru *lru, rcu_read_lock(); memcg_lrus = rcu_dereference(lru->memcg_lrus); - if (memcg_lrus->lrus[idx]) { + if (rcu_access_pointer(memcg_lrus->lrus[idx])) { rcu_read_unlock(); return true; } @@ -544,7 +560,7 @@ int list_lru_memcg_alloc(struct list_lru *lru, struct mem_cgroup *memcg, gfp_t g struct list_lru_memcg *memcg_lrus; int i; - struct list_lru_memcg { + struct list_lru_memcg_table { struct list_lru_per_memcg *mlru; struct mem_cgroup *memcg; } *table; @@ -588,11 +604,12 @@ int list_lru_memcg_alloc(struct list_lru *lru, struct mem_cgroup *memcg, gfp_t g memcg_lrus = rcu_dereference_protected(lru->memcg_lrus, true); while (i--) { int index = memcg_cache_id(table[i].memcg); + struct list_lru_per_memcg *mlru = table[i].mlru; - if (memcg_lrus->lrus[index]) - kfree(table[i].mlru); + if (index < 0 || rcu_dereference_protected(memcg_lrus->lrus[index], true)) + kfree(mlru); else - memcg_lrus->lrus[index] = table[i].mlru; + rcu_assign_pointer(memcg_lrus->lrus[index], mlru); } spin_unlock_irqrestore(&lru->lock, flags); diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 0e8c8d8465e5..2045cd8b1d7f 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -3635,10 +3635,13 @@ static void memcg_offline_kmem(struct mem_cgroup *memcg) memcg_reparent_objcgs(memcg, parent); + /* + * memcg_drain_all_list_lrus() can change memcg->kmemcg_id. + * Cache it to @kmemcg_id. + */ kmemcg_id = memcg->kmemcg_id; - /* memcg_reparent_objcgs() must be called before this. */ - memcg_drain_all_list_lrus(kmemcg_id, parent); + memcg_drain_all_list_lrus(memcg, parent); memcg_free_cache_id(kmemcg_id); } From patchwork Tue Sep 14 07:29:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12492231 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_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 72E40C433F5 for ; Tue, 14 Sep 2021 07:41:28 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 1C69A60238 for ; Tue, 14 Sep 2021 07:41:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 1C69A60238 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id BB1D6900003; Tue, 14 Sep 2021 03:41:27 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B6179940007; Tue, 14 Sep 2021 03:41:27 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A5E0D900003; Tue, 14 Sep 2021 03:41:27 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0159.hostedemail.com [216.40.44.159]) by kanga.kvack.org (Postfix) with ESMTP id 9676C900003 for ; Tue, 14 Sep 2021 03:41:27 -0400 (EDT) Received: from smtpin06.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 53F2D1816BB6D for ; Tue, 14 Sep 2021 07:41:27 +0000 (UTC) X-FDA: 78585383814.06.D58A336 Received: from mail-pj1-f45.google.com (mail-pj1-f45.google.com [209.85.216.45]) by imf29.hostedemail.com (Postfix) with ESMTP id C900090001BC for ; Tue, 14 Sep 2021 07:41:26 +0000 (UTC) Received: by mail-pj1-f45.google.com with SMTP id nn5-20020a17090b38c500b0019af1c4b31fso1283716pjb.3 for ; Tue, 14 Sep 2021 00:41:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=bsjYfDNMEc/jELMvGHtKH2gf13kKEK2Ue14TQA3Gi28=; b=OrcumWMrE2b/nfxa+Zj0GT88EGILDhLgk4KgBS0ly+inFAxhtUgjeLsg7pT69wYqZH wFV+svd7CjJghPycVKXor0/CzlVMpoZiR/nACPVNg1YQi55tIjsHrBdrFN87fp1KkE0y Ob8TDgk9Liwk6v9/oGafCXgkhUVrHPo4xjOuLzznMtX7ZT/cupnuhoLdcPq8tNkJs/lu gsHvmMCOvl6suOH5NhnzIMK4sRo73Z7yDOBsPs5iz86nLMFrrSEhzS1tBt5mGxmW5quY WpLnz6MQDewqeASmohKE2wSzc4WQSVje8QRVvxtsCaW2k0uaOrO05coInYwR0u5KHl+B XboQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=bsjYfDNMEc/jELMvGHtKH2gf13kKEK2Ue14TQA3Gi28=; b=nZAycnwEmHR6pX62FdpsM8KIleLUGBOtt9sqWrkx5gaTVuMNek8ahqvh2onzfD68ZR KsdZpRCxQRlio1HDutoarrJl2cgWo/t2g3/bVFdOyKDH95DFRG2nRaxhc784CljtViSc hNNf85GrpJ8iiYPJh6NzQy+y6xSc6jmauS6soxbX2dWON7r12pLnF+FHwalXcx2rItoj IWeXlVbWEdO2j8udgo0jzimKBpwZOge10EnFN+Rnt4c3dWms3P4k7RZ2sKORdyHNuaV2 Inp2Z1TmmyPC2bq5NG7mxvCFKv1CyrxkzsLeEtz96u6A/juhnf2VlJ+MA04OjetGz25W 3Z+w== X-Gm-Message-State: AOAM531c+La5IvQzZaonuVn3B8lD/2eNGjbBvCDkaW3aLhD14dqDxzZZ zAFOUO580qMtjWNYoJSxC1ojuA== X-Google-Smtp-Source: ABdhPJyuMSpSZr9qGteJJluv8QWQshuC0AqQLwhRVohTduvgabtXntr2JJefLZNIQDJJ1sZNrcZ/uw== X-Received: by 2002:a17:902:7c94:b0:13b:8d10:cc4f with SMTP id y20-20020a1709027c9400b0013b8d10cc4fmr9894718pll.54.1631605285968; Tue, 14 Sep 2021 00:41:25 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.244]) by smtp.gmail.com with ESMTPSA id s3sm9377839pfd.188.2021.09.14.00.41.18 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Sep 2021 00:41:25 -0700 (PDT) From: Muchun Song To: willy@infradead.org, akpm@linux-foundation.org, hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, shakeelb@google.com, guro@fb.com, shy828301@gmail.com, alexs@kernel.org, richard.weiyang@gmail.com, david@fromorbit.com, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, zhengqi.arch@bytedance.com, duanxiongchun@bytedance.com, fam.zheng@bytedance.com, smuchun@gmail.com, Muchun Song Subject: [PATCH v3 71/76] mm: list_lru: rename memcg_drain_all_list_lrus to memcg_reparent_list_lrus Date: Tue, 14 Sep 2021 15:29:33 +0800 Message-Id: <20210914072938.6440-72-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20210914072938.6440-1-songmuchun@bytedance.com> References: <20210914072938.6440-1-songmuchun@bytedance.com> MIME-Version: 1.0 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: C900090001BC X-Stat-Signature: eqxut7qyssqcdw9xatohp5p6uy7uy678 Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=OrcumWMr; spf=pass (imf29.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.216.45 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com X-HE-Tag: 1631605286-215213 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 purpose of the memcg_drain_all_list_lrus() is list_lrus reparenting. It is very similar to memcg_reparent_objcgs(). Rename it to memcg_reparent_list_lrus() so that the name can more consistent with memcg_reparent_objcgs(). Signed-off-by: Muchun Song --- include/linux/list_lru.h | 3 +-- mm/list_lru.c | 25 ++++++++++++------------- mm/memcontrol.c | 4 ++-- 3 files changed, 15 insertions(+), 17 deletions(-) diff --git a/include/linux/list_lru.h b/include/linux/list_lru.h index 62f407831b8c..5e9c632c9eb7 100644 --- a/include/linux/list_lru.h +++ b/include/linux/list_lru.h @@ -77,8 +77,7 @@ int __list_lru_init(struct list_lru *lru, bool memcg_aware, __list_lru_init((lru), true, NULL, shrinker) int memcg_update_all_list_lrus(int num_memcgs); -void memcg_drain_all_list_lrus(struct mem_cgroup *src_memcg, - struct mem_cgroup *dst_memcg); +void memcg_reparent_list_lrus(struct mem_cgroup *memcg, struct mem_cgroup *parent); /** * list_lru_add: add an element to the lru list's tail diff --git a/mm/list_lru.c b/mm/list_lru.c index 48651c29a9d1..1e42d9847b08 100644 --- a/mm/list_lru.c +++ b/mm/list_lru.c @@ -460,8 +460,8 @@ int memcg_update_all_list_lrus(int new_size) return ret; } -static void memcg_drain_list_lru_node(struct list_lru *lru, int nid, - int src_idx, struct mem_cgroup *dst_memcg) +static void memcg_reparent_list_lru_node(struct list_lru *lru, int nid, + int src_idx, struct mem_cgroup *dst_memcg) { struct list_lru_node *nlru = &lru->node[nid]; int dst_idx = dst_memcg->kmemcg_id; @@ -489,23 +489,22 @@ static void memcg_drain_list_lru_node(struct list_lru *lru, int nid, spin_unlock_irq(&nlru->lock); } -static void memcg_drain_list_lru(struct list_lru *lru, - int src_idx, struct mem_cgroup *dst_memcg) +static void memcg_reparent_list_lru(struct list_lru *lru, + int src_idx, struct mem_cgroup *dst_memcg) { int i; for_each_node(i) - memcg_drain_list_lru_node(lru, i, src_idx, dst_memcg); + memcg_reparent_list_lru_node(lru, i, src_idx, dst_memcg); memcg_list_lru_free(lru, src_idx); } -void memcg_drain_all_list_lrus(struct mem_cgroup *src_memcg, - struct mem_cgroup *dst_memcg) +void memcg_reparent_list_lrus(struct mem_cgroup *memcg, struct mem_cgroup *parent) { struct cgroup_subsys_state *css; struct list_lru *lru; - int src_idx = src_memcg->kmemcg_id; + int src_idx = memcg->kmemcg_id; /* * Change kmemcg_id of this cgroup and all its descendants to the @@ -520,17 +519,17 @@ void memcg_drain_all_list_lrus(struct mem_cgroup *src_memcg, * memcg_list_lru_free(). */ rcu_read_lock(); - css_for_each_descendant_pre(css, &src_memcg->css) { - struct mem_cgroup *memcg; + css_for_each_descendant_pre(css, &memcg->css) { + struct mem_cgroup *child; - memcg = mem_cgroup_from_css(css); - memcg->kmemcg_id = dst_memcg->kmemcg_id; + child = mem_cgroup_from_css(css); + child->kmemcg_id = parent->kmemcg_id; } rcu_read_unlock(); mutex_lock(&list_lrus_mutex); list_for_each_entry(lru, &memcg_list_lrus, list) - memcg_drain_list_lru(lru, src_idx, dst_memcg); + memcg_reparent_list_lru(lru, src_idx, parent); mutex_unlock(&list_lrus_mutex); } diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 2045cd8b1d7f..4cf98de2ad09 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -3636,12 +3636,12 @@ static void memcg_offline_kmem(struct mem_cgroup *memcg) memcg_reparent_objcgs(memcg, parent); /* - * memcg_drain_all_list_lrus() can change memcg->kmemcg_id. + * memcg_reparent_list_lrus() can change memcg->kmemcg_id. * Cache it to @kmemcg_id. */ kmemcg_id = memcg->kmemcg_id; - memcg_drain_all_list_lrus(memcg, parent); + memcg_reparent_list_lrus(memcg, parent); memcg_free_cache_id(kmemcg_id); } From patchwork Tue Sep 14 07:29:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12492233 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_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 34226C433F5 for ; Tue, 14 Sep 2021 07:41:35 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C1F1C60F58 for ; Tue, 14 Sep 2021 07:41:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org C1F1C60F58 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 681CE940020; Tue, 14 Sep 2021 03:41:34 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6317E940007; Tue, 14 Sep 2021 03:41:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4D2B0940020; Tue, 14 Sep 2021 03:41:34 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0221.hostedemail.com [216.40.44.221]) by kanga.kvack.org (Postfix) with ESMTP id 3B292940007 for ; Tue, 14 Sep 2021 03:41:34 -0400 (EDT) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id EC35C180D0197 for ; Tue, 14 Sep 2021 07:41:33 +0000 (UTC) X-FDA: 78585384066.24.8CE42BD Received: from mail-pj1-f44.google.com (mail-pj1-f44.google.com [209.85.216.44]) by imf22.hostedemail.com (Postfix) with ESMTP id A576D1900 for ; Tue, 14 Sep 2021 07:41:33 +0000 (UTC) Received: by mail-pj1-f44.google.com with SMTP id w19-20020a17090aaf9300b00191e6d10a19so2073869pjq.1 for ; Tue, 14 Sep 2021 00:41:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Qd3JCTi5wbFZt3xTDhqi0ubmAfWxjHRi18zkP7I6S4w=; b=Q0rTdTePiA1aISyMI1lJTmxXrCCiTPU2/otzi2UP0+/EBol5iMHhmBmGk3S8IdWvYL FcDoN8E6KijVWJNy+FDpRnpKwzaOpxaIJqkvBzuuH1ivbWlDcvqKUbK2vgqx47eRumuZ zjmAbyxudD7BoH6ckUsV6HwvM2HffeujJbySU90r7zRvwTmx07gT4LYDnjXINn+Yl1hS HCowg6xq9AOLpw/IYuQegWv29YzfYfUkgLgSxbBhy+HR2NQy4A51ZTWWcfpfdIYHPZs2 rx/HAo8FZolVzqFgOJnrWYqM7AUPCfa2HmFAbbv+bLkKOHboxU5zsQtBFi39mXghOpud RKCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Qd3JCTi5wbFZt3xTDhqi0ubmAfWxjHRi18zkP7I6S4w=; b=QvCFAxzknQiHLE+p+9zwn/9FxhQ++tflB9F9ksgTChs7FE1qnIoTydqWnL+QXgx1ok 5gMmFH3ckAL8Mt1Q8W8fuC2UfRhhJgCOiEf3rWviaHpGfHz4pC1lL+hTqR3s6Iyzf9rn AVqCKe9e3ht1FfdRMzVgDhZ/S9OTkboXFskAf6du1nOJ0/agR9JM5zgFehJQ0yNcZmML /UPzaykkt5ItLEnwjyUujmHN7PDVuG+VNK/ePLiSRFRudVsNypklgZLyCGg7X6pm1YbI kD8XXPm9Q6W8x/+OOn0yONq6qXPbW28NG09p90qM9sFxQ29XvjXDr9EiuVCdsotJbAtn jiVA== X-Gm-Message-State: AOAM532tNMvLU/xrDH6R9wNGt76gHP25AUwW3mX/zlbY4Lav9vVowY2e UlVLZ6gX0Gwa119bzvDk+3xR0w== X-Google-Smtp-Source: ABdhPJxLG/giOtojdFkHj3noOFcRNcXlP8dNSDM7IrE1aImOxvxQ3JkC4gA7HRIjphrCRW3CPYkS9Q== X-Received: by 2002:a17:90a:1de:: with SMTP id 30mr589068pjd.106.1631605292735; Tue, 14 Sep 2021 00:41:32 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.244]) by smtp.gmail.com with ESMTPSA id s3sm9377839pfd.188.2021.09.14.00.41.26 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Sep 2021 00:41:32 -0700 (PDT) From: Muchun Song To: willy@infradead.org, akpm@linux-foundation.org, hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, shakeelb@google.com, guro@fb.com, shy828301@gmail.com, alexs@kernel.org, richard.weiyang@gmail.com, david@fromorbit.com, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, zhengqi.arch@bytedance.com, duanxiongchun@bytedance.com, fam.zheng@bytedance.com, smuchun@gmail.com, Muchun Song Subject: [PATCH v3 72/76] mm: list_lru: replace linear array with xarray Date: Tue, 14 Sep 2021 15:29:34 +0800 Message-Id: <20210914072938.6440-73-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20210914072938.6440-1-songmuchun@bytedance.com> References: <20210914072938.6440-1-songmuchun@bytedance.com> MIME-Version: 1.0 Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=Q0rTdTeP; spf=pass (imf22.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.216.44 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com X-Stat-Signature: 188xdocg11s8rebd1ganokxtzzthy15i X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: A576D1900 X-HE-Tag: 1631605293-719674 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: If we run 10k containers in the system, the size of the list_lru_memcg->lrus can be ~96KB per list_lru. When we decrease the number containers, the size of the array will not be shrinked. It is not scalable. The xarray is a good choice for this case. We can save a lot of memory when there are tens of thousands continers in the system. If we use xarray, we also can remove the logic code of resizing array, which can simplify the code. Signed-off-by: Muchun Song --- include/linux/list_lru.h | 13 +-- include/linux/memcontrol.h | 23 ------ mm/list_lru.c | 196 ++++++++++++++------------------------------- mm/memcontrol.c | 77 ++---------------- 4 files changed, 68 insertions(+), 241 deletions(-) diff --git a/include/linux/list_lru.h b/include/linux/list_lru.h index 5e9c632c9eb7..c423be3cf2d3 100644 --- a/include/linux/list_lru.h +++ b/include/linux/list_lru.h @@ -11,6 +11,7 @@ #include #include #include +#include struct mem_cgroup; @@ -37,12 +38,6 @@ struct list_lru_per_memcg { struct list_lru_one nodes[]; }; -struct list_lru_memcg { - struct rcu_head rcu; - /* array of per cgroup lists, indexed by memcg_cache_id */ - struct list_lru_per_memcg __rcu *lrus[]; -}; - struct list_lru_node { /* protects all lists on the node, including per cgroup */ spinlock_t lock; @@ -57,10 +52,7 @@ struct list_lru { struct list_head list; int shrinker_id; bool memcg_aware; - /* protects ->memcg_lrus->lrus[i] */ - spinlock_t lock; - /* for cgroup aware lrus points to per cgroup lists, otherwise NULL */ - struct list_lru_memcg __rcu *memcg_lrus; + struct xarray xa; #endif }; @@ -76,7 +68,6 @@ int __list_lru_init(struct list_lru *lru, bool memcg_aware, #define list_lru_init_memcg(lru, shrinker) \ __list_lru_init((lru), true, NULL, shrinker) -int memcg_update_all_list_lrus(int num_memcgs); void memcg_reparent_list_lrus(struct mem_cgroup *memcg, struct mem_cgroup *parent); /** diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index 06ee32822fd4..83add6c484b1 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h @@ -1689,18 +1689,6 @@ void obj_cgroup_uncharge(struct obj_cgroup *objcg, size_t size); extern struct static_key_false memcg_kmem_enabled_key; -extern int memcg_nr_cache_ids; -void memcg_get_cache_ids(void); -void memcg_put_cache_ids(void); - -/* - * Helper macro to loop through all memcg-specific caches. Callers must still - * check if the cache is valid (it is either valid or NULL). - * the slab_mutex must be held when looping through those caches - */ -#define for_each_memcg_cache_index(_idx) \ - for ((_idx) = 0; (_idx) < memcg_nr_cache_ids; (_idx)++) - static inline bool memcg_kmem_enabled(void) { return static_branch_likely(&memcg_kmem_enabled_key); @@ -1757,9 +1745,6 @@ static inline void __memcg_kmem_uncharge_page(struct page *page, int order) { } -#define for_each_memcg_cache_index(_idx) \ - for (; NULL; ) - static inline bool memcg_kmem_enabled(void) { return false; @@ -1770,14 +1755,6 @@ static inline int memcg_cache_id(struct mem_cgroup *memcg) return -1; } -static inline void memcg_get_cache_ids(void) -{ -} - -static inline void memcg_put_cache_ids(void) -{ -} - static inline struct mem_cgroup *mem_cgroup_from_obj(void *p) { return NULL; diff --git a/mm/list_lru.c b/mm/list_lru.c index 1e42d9847b08..1202519aeb31 100644 --- a/mm/list_lru.c +++ b/mm/list_lru.c @@ -51,22 +51,12 @@ static int lru_shrinker_id(struct list_lru *lru) static inline struct list_lru_one * list_lru_from_memcg_idx(struct list_lru *lru, int nid, int idx) { - struct list_lru_memcg *memcg_lrus; - struct list_lru_node *nlru = &lru->node[nid]; - - /* - * Either lock or RCU protects the array of per cgroup lists - * from relocation (see memcg_update_list_lru). - */ - memcg_lrus = rcu_dereference_check(lru->memcg_lrus, - lockdep_is_held(&nlru->lock)); - if (memcg_lrus && idx >= 0) { - struct list_lru_per_memcg *mlru; + if (list_lru_memcg_aware(lru) && idx >= 0) { + struct list_lru_per_memcg *mlru = xa_load(&lru->xa, idx); - mlru = rcu_dereference_check(memcg_lrus->lrus[idx], true); return mlru ? &mlru->nodes[nid] : NULL; } - return &nlru->lru; + return &lru->node[nid].lru; } static inline struct list_lru_one * @@ -77,7 +67,7 @@ list_lru_from_kmem(struct list_lru *lru, int nid, void *ptr, struct list_lru_one *l = &nlru->lru; struct mem_cgroup *memcg = NULL; - if (!lru->memcg_lrus) + if (!list_lru_memcg_aware(lru)) goto out; memcg = mem_cgroup_from_obj(ptr); @@ -310,16 +300,20 @@ unsigned long list_lru_walk_node(struct list_lru *lru, int nid, unsigned long *nr_to_walk) { long isolated = 0; - int memcg_idx; isolated += list_lru_walk_one(lru, nid, NULL, isolate, cb_arg, nr_to_walk); + +#ifdef CONFIG_MEMCG_KMEM if (*nr_to_walk > 0 && list_lru_memcg_aware(lru)) { - for_each_memcg_cache_index(memcg_idx) { + struct list_lru_per_memcg *mlru; + unsigned long index; + + xa_for_each(&lru->xa, index, mlru) { struct list_lru_node *nlru = &lru->node[nid]; spin_lock(&nlru->lock); - isolated += __list_lru_walk_one(lru, nid, memcg_idx, + isolated += __list_lru_walk_one(lru, nid, index, isolate, cb_arg, nr_to_walk); spin_unlock(&nlru->lock); @@ -328,6 +322,8 @@ unsigned long list_lru_walk_node(struct list_lru *lru, int nid, break; } } +#endif + return isolated; } EXPORT_SYMBOL_GPL(list_lru_walk_node); @@ -339,15 +335,6 @@ static void init_one_lru(struct list_lru_one *l) } #ifdef CONFIG_MEMCG_KMEM -static void memcg_destroy_list_lru_range(struct list_lru_memcg *memcg_lrus, - int begin, int end) -{ - int i; - - for (i = begin; i < end; i++) - kfree(memcg_lrus->lrus[i]); -} - static struct list_lru_per_memcg *memcg_list_lru_alloc(gfp_t gfp) { int nid; @@ -365,15 +352,7 @@ static struct list_lru_per_memcg *memcg_list_lru_alloc(gfp_t gfp) static void memcg_list_lru_free(struct list_lru *lru, int src_idx) { - struct list_lru_memcg *memcg_lrus; - struct list_lru_per_memcg *mlru; - - spin_lock_irq(&lru->lock); - memcg_lrus = rcu_dereference_protected(lru->memcg_lrus, true); - mlru = rcu_dereference_protected(memcg_lrus->lrus[src_idx], true); - if (mlru) - rcu_assign_pointer(memcg_lrus->lrus[src_idx], NULL); - spin_unlock_irq(&lru->lock); + struct list_lru_per_memcg *mlru = xa_erase_irq(&lru->xa, src_idx); /* * The __list_lru_walk_one() can walk the list of this node. @@ -385,79 +364,27 @@ static void memcg_list_lru_free(struct list_lru *lru, int src_idx) kvfree_rcu(mlru, rcu); } -static int memcg_init_list_lru(struct list_lru *lru, bool memcg_aware) +static void memcg_init_list_lru(struct list_lru *lru, bool memcg_aware) { - struct list_lru_memcg *memcg_lrus; - int size = memcg_nr_cache_ids; - + if (memcg_aware) + xa_init_flags(&lru->xa, XA_FLAGS_LOCK_IRQ); lru->memcg_aware = memcg_aware; - if (!memcg_aware) - return 0; - - spin_lock_init(&lru->lock); - - memcg_lrus = kvzalloc(sizeof(*memcg_lrus) + - size * sizeof(memcg_lrus->lrus[0]), GFP_KERNEL); - if (!memcg_lrus) - return -ENOMEM; - - RCU_INIT_POINTER(lru->memcg_lrus, memcg_lrus); - - return 0; } static void memcg_destroy_list_lru(struct list_lru *lru) { - struct list_lru_memcg *memcg_lrus; + XA_STATE(xas, &lru->xa, 0); + struct list_lru_per_memcg *mlru; if (!list_lru_memcg_aware(lru)) return; - /* - * This is called when shrinker has already been unregistered, - * and nobody can use it. So, there is no need to use kvfree_rcu(). - */ - memcg_lrus = rcu_dereference_protected(lru->memcg_lrus, true); - memcg_destroy_list_lru_range(memcg_lrus, 0, memcg_nr_cache_ids); - kvfree(memcg_lrus); -} - -static int memcg_update_list_lru(struct list_lru *lru, int old_size, int new_size) -{ - struct list_lru_memcg *old, *new; - - BUG_ON(old_size > new_size); - - old = rcu_dereference_protected(lru->memcg_lrus, - lockdep_is_held(&list_lrus_mutex)); - new = kvmalloc(sizeof(*new) + new_size * sizeof(new->lrus[0]), GFP_KERNEL); - if (!new) - return -ENOMEM; - - spin_lock_irq(&lru->lock); - memcpy(&new->lrus, &old->lrus, old_size * sizeof(new->lrus[0])); - memset(&new->lrus[old_size], 0, (new_size - old_size) * sizeof(new->lrus[0])); - rcu_assign_pointer(lru->memcg_lrus, new); - spin_unlock_irq(&lru->lock); - - kvfree_rcu(old, rcu); - return 0; -} - -int memcg_update_all_list_lrus(int new_size) -{ - int ret = 0; - struct list_lru *lru; - int old_size = memcg_nr_cache_ids; - - mutex_lock(&list_lrus_mutex); - list_for_each_entry(lru, &memcg_list_lrus, list) { - ret = memcg_update_list_lru(lru, old_size, new_size); - if (ret) - break; + xas_lock_irq(&xas); + xas_for_each(&xas, mlru, ULONG_MAX) { + kfree(mlru); + xas_store(&xas, NULL); } - mutex_unlock(&list_lrus_mutex); - return ret; + xas_unlock_irq(&xas); } static void memcg_reparent_list_lru_node(struct list_lru *lru, int nid, @@ -536,27 +463,17 @@ void memcg_reparent_list_lrus(struct mem_cgroup *memcg, struct mem_cgroup *paren static bool memcg_list_lru_skip_alloc(struct list_lru *lru, struct mem_cgroup *memcg) { - struct list_lru_memcg *memcg_lrus; int idx = memcg_cache_id(memcg); - if (unlikely(idx < 0)) - return true; - - rcu_read_lock(); - memcg_lrus = rcu_dereference(lru->memcg_lrus); - if (rcu_access_pointer(memcg_lrus->lrus[idx])) { - rcu_read_unlock(); + if (unlikely(idx < 0) || xa_load(&lru->xa, idx)) return true; - } - rcu_read_unlock(); - return false; } int list_lru_memcg_alloc(struct list_lru *lru, struct mem_cgroup *memcg, gfp_t gfp) { + XA_STATE(xas, &lru->xa, 0); unsigned long flags; - struct list_lru_memcg *memcg_lrus; int i; struct list_lru_memcg_table { @@ -599,27 +516,49 @@ int list_lru_memcg_alloc(struct list_lru *lru, struct mem_cgroup *memcg, gfp_t g } } - spin_lock_irqsave(&lru->lock, flags); - memcg_lrus = rcu_dereference_protected(lru->memcg_lrus, true); + xas_lock_irqsave(&xas, flags); while (i--) { int index = memcg_cache_id(table[i].memcg); struct list_lru_per_memcg *mlru = table[i].mlru; - if (index < 0 || rcu_dereference_protected(memcg_lrus->lrus[index], true)) + xas_set(&xas, index); +retry: + if (unlikely(index < 0 || xas_error(&xas) || xas_load(&xas))) { kfree(mlru); - else - rcu_assign_pointer(memcg_lrus->lrus[index], mlru); + } else { + xas_store(&xas, mlru); + if (xas_error(&xas) == -ENOMEM) { + xas_unlock_irqrestore(&xas, flags); + if (xas_nomem(&xas, gfp)) + xas_set_err(&xas, 0); + xas_lock_irqsave(&xas, flags); + /* + * The xas lock has been released, this memcg + * can be reparented before us. So reload + * memcg id. More details see the comments + * in memcg_reparent_list_lrus(). + */ + index = memcg_cache_id(table[i].memcg); + if (index < 0) + xas_set_err(&xas, 0); + else if (!xas_error(&xas) && index != xas.xa_index) + xas_set(&xas, index); + goto retry; + } + } } - spin_unlock_irqrestore(&lru->lock, flags); + /* xas_nomem() is used to free memory instead of memory allocation. */ + if (xas.xa_alloc) + xas_nomem(&xas, gfp); + xas_unlock_irqrestore(&xas, flags); kfree(table); - return 0; + return xas_error(&xas); } #else -static int memcg_init_list_lru(struct list_lru *lru, bool memcg_aware) +static inline void memcg_init_list_lru(struct list_lru *lru, bool memcg_aware) { - return 0; } static void memcg_destroy_list_lru(struct list_lru *lru) @@ -631,7 +570,6 @@ int __list_lru_init(struct list_lru *lru, bool memcg_aware, struct lock_class_key *key, struct shrinker *shrinker) { int i; - int err = -ENOMEM; #ifdef CONFIG_MEMCG_KMEM if (shrinker) @@ -639,11 +577,10 @@ int __list_lru_init(struct list_lru *lru, bool memcg_aware, else lru->shrinker_id = -1; #endif - memcg_get_cache_ids(); lru->node = kcalloc(nr_node_ids, sizeof(*lru->node), GFP_KERNEL); if (!lru->node) - goto out; + return -ENOMEM; for_each_node(i) { spin_lock_init(&lru->node[i].lock); @@ -652,18 +589,10 @@ int __list_lru_init(struct list_lru *lru, bool memcg_aware, init_one_lru(&lru->node[i].lru); } - err = memcg_init_list_lru(lru, memcg_aware); - if (err) { - kfree(lru->node); - /* Do this so a list_lru_destroy() doesn't crash: */ - lru->node = NULL; - goto out; - } - + memcg_init_list_lru(lru, memcg_aware); list_lru_register(lru); -out: - memcg_put_cache_ids(); - return err; + + return 0; } EXPORT_SYMBOL_GPL(__list_lru_init); @@ -673,8 +602,6 @@ void list_lru_destroy(struct list_lru *lru) if (!lru->node) return; - memcg_get_cache_ids(); - list_lru_unregister(lru); memcg_destroy_list_lru(lru); @@ -684,6 +611,5 @@ void list_lru_destroy(struct list_lru *lru) #ifdef CONFIG_MEMCG_KMEM lru->shrinker_id = -1; #endif - memcg_put_cache_ids(); } EXPORT_SYMBOL_GPL(list_lru_destroy); diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 4cf98de2ad09..8e0cde19b648 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -359,42 +359,17 @@ static void memcg_reparent_objcgs(struct mem_cgroup *memcg, * This will be used as a shrinker list's index. * The main reason for not using cgroup id for this: * this works better in sparse environments, where we have a lot of memcgs, - * but only a few kmem-limited. Or also, if we have, for instance, 200 - * memcgs, and none but the 200th is kmem-limited, we'd have to have a - * 200 entry array for that. - * - * The current size of the caches array is stored in memcg_nr_cache_ids. It - * will double each time we have to increase it. + * but only a few kmem-limited. */ static DEFINE_IDA(memcg_cache_ida); -int memcg_nr_cache_ids; - -/* Protects memcg_nr_cache_ids */ -static DECLARE_RWSEM(memcg_cache_ids_sem); - -void memcg_get_cache_ids(void) -{ - down_read(&memcg_cache_ids_sem); -} - -void memcg_put_cache_ids(void) -{ - up_read(&memcg_cache_ids_sem); -} /* - * MIN_SIZE is different than 1, because we would like to avoid going through - * the alloc/free process all the time. In a small machine, 4 kmem-limited - * cgroups is a reasonable guess. In the future, it could be a parameter or - * tunable, but that is strictly not necessary. - * * MAX_SIZE should be as large as the number of cgrp_ids. Ideally, we could get * this constant directly from cgroup, but it is understandable that this is * better kept as an internal representation in cgroup.c. In any case, the * cgrp_id space is not getting any smaller, and we don't have to necessarily * increase ours as well if it increases. */ -#define MEMCG_CACHES_MIN_SIZE 4 #define MEMCG_CACHES_MAX_SIZE MEM_CGROUP_ID_MAX /* @@ -2879,49 +2854,6 @@ __always_inline struct obj_cgroup *get_obj_cgroup_from_current(void) return objcg; } -static int memcg_alloc_cache_id(void) -{ - int id, size; - int err; - - id = ida_simple_get(&memcg_cache_ida, - 0, MEMCG_CACHES_MAX_SIZE, GFP_KERNEL); - if (id < 0) - return id; - - if (id < memcg_nr_cache_ids) - return id; - - /* - * There's no space for the new id in memcg_caches arrays, - * so we have to grow them. - */ - down_write(&memcg_cache_ids_sem); - - size = 2 * (id + 1); - if (size < MEMCG_CACHES_MIN_SIZE) - size = MEMCG_CACHES_MIN_SIZE; - else if (size > MEMCG_CACHES_MAX_SIZE) - size = MEMCG_CACHES_MAX_SIZE; - - err = memcg_update_all_list_lrus(size); - if (!err) - memcg_nr_cache_ids = size; - - up_write(&memcg_cache_ids_sem); - - if (err) { - ida_simple_remove(&memcg_cache_ida, id); - return err; - } - return id; -} - -static void memcg_free_cache_id(int id) -{ - ida_simple_remove(&memcg_cache_ida, id); -} - /* * obj_cgroup_uncharge_pages: uncharge a number of kernel pages from a objcg * @objcg: object cgroup to uncharge @@ -3599,13 +3531,14 @@ static int memcg_online_kmem(struct mem_cgroup *memcg) if (unlikely(mem_cgroup_is_root(memcg))) return 0; - memcg_id = memcg_alloc_cache_id(); + memcg_id = ida_alloc_max(&memcg_cache_ida, MEMCG_CACHES_MAX_SIZE - 1, + GFP_KERNEL); if (memcg_id < 0) return memcg_id; objcg = obj_cgroup_alloc(); if (!objcg) { - memcg_free_cache_id(memcg_id); + ida_free(&memcg_cache_ida, memcg_id); return -ENOMEM; } objcg->memcg = memcg; @@ -3643,7 +3576,7 @@ static void memcg_offline_kmem(struct mem_cgroup *memcg) memcg_reparent_list_lrus(memcg, parent); - memcg_free_cache_id(kmemcg_id); + ida_free(&memcg_cache_ida, kmemcg_id); } #else static int memcg_online_kmem(struct mem_cgroup *memcg) From patchwork Tue Sep 14 07:29:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12492235 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_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 B0D73C433EF for ; Tue, 14 Sep 2021 07:41:42 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 603B660238 for ; Tue, 14 Sep 2021 07:41:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 603B660238 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 08DB9940021; Tue, 14 Sep 2021 03:41:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 03DF4940007; Tue, 14 Sep 2021 03:41:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E6EE0940021; Tue, 14 Sep 2021 03:41:41 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0050.hostedemail.com [216.40.44.50]) by kanga.kvack.org (Postfix) with ESMTP id D6FDC940007 for ; Tue, 14 Sep 2021 03:41:41 -0400 (EDT) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 8ADCD2D223 for ; Tue, 14 Sep 2021 07:41:41 +0000 (UTC) X-FDA: 78585384402.18.9D33F65 Received: from mail-pf1-f175.google.com (mail-pf1-f175.google.com [209.85.210.175]) by imf24.hostedemail.com (Postfix) with ESMTP id 4B0CFB00009E for ; Tue, 14 Sep 2021 07:41:41 +0000 (UTC) Received: by mail-pf1-f175.google.com with SMTP id j16so11372402pfc.2 for ; Tue, 14 Sep 2021 00:41:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=GTuclICje8xvheuCWw6eY5mtrJC1enFIQ8G/X086C4w=; b=1+5SZrthq4E9CNTL9shy+XTzy4GfS0MhkZdeG8bD6fclynhHhj6SeOoRgLf3pFR4my BGdV0PSiF09qkvytKWXvDnXU/KOBFqL/mqyOd1sL+vo2Gj5NZHMeujnW4p/ySo1tTlxW 5MEgUiDUCrH+j8TmwGGLYiTNfhLcLs0t0Id5/t6xyCn302Mn4qKJClIS5r943Vjxj4R3 3ESMJEOYtM7rTAMfYaypQTmjrXvgsC2iUteRT+ora65DDVkEHvRsGjpmwEPEOxw8Zrdi fZ9RQ48GuD6pdi3pqwQ3fw6la2Ty26HoG1CaMfVQn3mCzfqq1EJZGL+pXOhOIh4oqFaO 8qtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=GTuclICje8xvheuCWw6eY5mtrJC1enFIQ8G/X086C4w=; b=jDsyEFWe6Nmqenu5OjQcLTiswirVliZxeIDrGHAt01k16eHohtRLld5MbFis35NSoK J6XnsWgFkaeuCe8IJsLyR2eu094tSSt2EJku7eBWUpOp5hswI2PNTPanADRyhaNxTKYy q2C0ANyzAPUuc+rVsMuFywz9KdfP58/iDfTxiES6zhUG54ELznhw2+ax1T7NC/wW9mhR Dob1cvhp3a5CcWFbvuV4pCDehghzZ01wPlqH0vpx+NiMwD9r8wpFvaXsfE8xCW78pSr+ WsvNLsAOpBcGr42Ye44pUwneHTA9CkhwjJGhUJfvknklqjY9S6A21rhy5eCI8C76A5/0 WdMw== X-Gm-Message-State: AOAM530AHG+/F6QaFQLXPUFrXwThSfgrd68KBvkj23G/Eam7yQ6hFtyi JwYANf8Dk+gW3kygHoYX4WkKng== X-Google-Smtp-Source: ABdhPJyCCwvzSMLS40nMeu2zuIgha4feIFEx/Jfsb/Qd1SEBLvcROtNSaH2rs4+NXS6rDZ6silJirQ== X-Received: by 2002:a63:1f24:: with SMTP id f36mr14690074pgf.6.1631605300457; Tue, 14 Sep 2021 00:41:40 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.244]) by smtp.gmail.com with ESMTPSA id s3sm9377839pfd.188.2021.09.14.00.41.33 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Sep 2021 00:41:39 -0700 (PDT) From: Muchun Song To: willy@infradead.org, akpm@linux-foundation.org, hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, shakeelb@google.com, guro@fb.com, shy828301@gmail.com, alexs@kernel.org, richard.weiyang@gmail.com, david@fromorbit.com, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, zhengqi.arch@bytedance.com, duanxiongchun@bytedance.com, fam.zheng@bytedance.com, smuchun@gmail.com, Muchun Song Subject: [PATCH v3 73/76] mm: memcontrol: reuse memory cgroup ID for kmem ID Date: Tue, 14 Sep 2021 15:29:35 +0800 Message-Id: <20210914072938.6440-74-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20210914072938.6440-1-songmuchun@bytedance.com> References: <20210914072938.6440-1-songmuchun@bytedance.com> MIME-Version: 1.0 X-Stat-Signature: wtckzgn5ihkepxf1uorkfzr7i75e1xhc Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=1+5SZrth; dmarc=pass (policy=none) header.from=bytedance.com; spf=pass (imf24.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.210.175 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 4B0CFB00009E X-HE-Tag: 1631605301-520693 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: There are two idrs being used by memory cgroup, one is for kmem ID, another is for memory cgroup ID. The maximum ID of both is 64Ki. Both of them can limit the total number of memory cgroups. Actually, we can reuse memory cgroup ID for kmem ID to simplify the code. Signed-off-by: Muchun Song --- include/linux/memcontrol.h | 1 + mm/memcontrol.c | 47 ++++++++-------------------------------------- 2 files changed, 9 insertions(+), 39 deletions(-) diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index 83add6c484b1..33f6ec4783f8 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h @@ -56,6 +56,7 @@ struct mem_cgroup_reclaim_cookie { #ifdef CONFIG_MEMCG #define MEM_CGROUP_ID_SHIFT 16 +#define MEM_CGROUP_ID_MIN 1 #define MEM_CGROUP_ID_MAX USHRT_MAX struct mem_cgroup_id { diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 8e0cde19b648..e3a2e4d65cc5 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -356,23 +356,6 @@ static void memcg_reparent_objcgs(struct mem_cgroup *memcg, } /* - * This will be used as a shrinker list's index. - * The main reason for not using cgroup id for this: - * this works better in sparse environments, where we have a lot of memcgs, - * but only a few kmem-limited. - */ -static DEFINE_IDA(memcg_cache_ida); - -/* - * MAX_SIZE should be as large as the number of cgrp_ids. Ideally, we could get - * this constant directly from cgroup, but it is understandable that this is - * better kept as an internal representation in cgroup.c. In any case, the - * cgrp_id space is not getting any smaller, and we don't have to necessarily - * increase ours as well if it increases. - */ -#define MEMCG_CACHES_MAX_SIZE MEM_CGROUP_ID_MAX - -/* * A lot of the calls to the cache allocation functions are expected to be * inlined by the compiler. Since the calls to memcg_slab_pre_alloc_hook() are * conditional to this static branch, we'll have to allow modules that does @@ -3520,10 +3503,12 @@ static u64 mem_cgroup_read_u64(struct cgroup_subsys_state *css, } #ifdef CONFIG_MEMCG_KMEM +#define MEM_CGROUP_KMEM_ID_MIN -1 +#define MEM_CGROUP_ID_DIFF (MEM_CGROUP_ID_MIN - MEM_CGROUP_KMEM_ID_MIN) + static int memcg_online_kmem(struct mem_cgroup *memcg) { struct obj_cgroup *objcg; - int memcg_id; if (cgroup_memory_nokmem) return 0; @@ -3531,22 +3516,16 @@ static int memcg_online_kmem(struct mem_cgroup *memcg) if (unlikely(mem_cgroup_is_root(memcg))) return 0; - memcg_id = ida_alloc_max(&memcg_cache_ida, MEMCG_CACHES_MAX_SIZE - 1, - GFP_KERNEL); - if (memcg_id < 0) - return memcg_id; - objcg = obj_cgroup_alloc(); - if (!objcg) { - ida_free(&memcg_cache_ida, memcg_id); + if (!objcg) return -ENOMEM; - } + objcg->memcg = memcg; rcu_assign_pointer(memcg->objcg, objcg); static_branch_enable(&memcg_kmem_enabled_key); - memcg->kmemcg_id = memcg_id; + memcg->kmemcg_id = memcg->id.id - MEM_CGROUP_ID_DIFF; return 0; } @@ -3554,7 +3533,6 @@ static int memcg_online_kmem(struct mem_cgroup *memcg) static void memcg_offline_kmem(struct mem_cgroup *memcg) { struct mem_cgroup *parent; - int kmemcg_id; if (cgroup_memory_nokmem) return; @@ -3567,16 +3545,7 @@ static void memcg_offline_kmem(struct mem_cgroup *memcg) parent = root_mem_cgroup; memcg_reparent_objcgs(memcg, parent); - - /* - * memcg_reparent_list_lrus() can change memcg->kmemcg_id. - * Cache it to @kmemcg_id. - */ - kmemcg_id = memcg->kmemcg_id; - memcg_reparent_list_lrus(memcg, parent); - - ida_free(&memcg_cache_ida, kmemcg_id); } #else static int memcg_online_kmem(struct mem_cgroup *memcg) @@ -5042,7 +5011,7 @@ static struct mem_cgroup *mem_cgroup_alloc(void) return ERR_PTR(error); memcg->id.id = idr_alloc(&mem_cgroup_idr, NULL, - 1, MEM_CGROUP_ID_MAX, + MEM_CGROUP_ID_MIN, MEM_CGROUP_ID_MAX, GFP_KERNEL); if (memcg->id.id < 0) { error = memcg->id.id; @@ -5070,7 +5039,7 @@ static struct mem_cgroup *mem_cgroup_alloc(void) spin_lock_init(&memcg->event_list_lock); memcg->socket_pressure = jiffies; #ifdef CONFIG_MEMCG_KMEM - memcg->kmemcg_id = -1; + memcg->kmemcg_id = MEM_CGROUP_KMEM_ID_MIN; INIT_LIST_HEAD(&memcg->objcg_list); #endif #ifdef CONFIG_CGROUP_WRITEBACK From patchwork Tue Sep 14 07:29:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12492237 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_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 9F3D6C433EF for ; Tue, 14 Sep 2021 07:41:49 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 54C6960F70 for ; Tue, 14 Sep 2021 07:41:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 54C6960F70 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id F0D27940022; Tue, 14 Sep 2021 03:41:48 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EBCF3940007; Tue, 14 Sep 2021 03:41:48 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D84D0940022; Tue, 14 Sep 2021 03:41:48 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0214.hostedemail.com [216.40.44.214]) by kanga.kvack.org (Postfix) with ESMTP id C89F4940007 for ; Tue, 14 Sep 2021 03:41:48 -0400 (EDT) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 92C478249980 for ; Tue, 14 Sep 2021 07:41:48 +0000 (UTC) X-FDA: 78585384696.11.7289CA2 Received: from mail-pj1-f45.google.com (mail-pj1-f45.google.com [209.85.216.45]) by imf14.hostedemail.com (Postfix) with ESMTP id 59D506001980 for ; Tue, 14 Sep 2021 07:41:48 +0000 (UTC) Received: by mail-pj1-f45.google.com with SMTP id t20so8240202pju.5 for ; Tue, 14 Sep 2021 00:41:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=NN0gBfeiXzYvb6Jp1Xsxd7yBUqMa7ADBolLYHobpZVA=; b=PK4VMjGvbH67oZYwUFRv0aAB52OL26OeD5aAWPYin+UtbhnEsqDqPB/EaOguwtEC31 +H+QEkDREFkUgugOadzHu6DvQ1BzJ/vqhb/+RWLh/+RYyQ8LgKEnWgtfmYOvBJ51exeO MZgiFfKhKQnddBedK9WWyA0jmVYyXMDWB0GdLs3Q1eafPpFgDlESnFvNCg/Sy3ThEvhK 10G0Ha8bAyXS8XFbO1IiOFq2kDgJu71/0l9Y5QP4jAlQFBblZy3Ldk/w59Uu9dAQ/fA+ 2TZgnJVhPh3fHVxylqst68t0JaN8QaVp+O9+z95FKOUk8Ajnp+TT5hDTuCf9KRba1/cO xUjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=NN0gBfeiXzYvb6Jp1Xsxd7yBUqMa7ADBolLYHobpZVA=; b=Y5FYe4UQh1w65DRra8fC8cY2ftaldS7WS1x7HnDpgr5zeqFQJdC3a1um9KfmdCJWIN z0E8zhKVIPbVss0K4oeUMZedqpeSisnG9RKNp8qdzQCMdPnNRBD9nQ0rWH7/W6+Lt0To 8GliO1UqLtfA0T3NG1FmSfqrOATdG8xzjt60EmHO64S4r5zI4dJnSwsdWCCWqmQNE6F2 qWg8EOdz5hRApLSqj76ja4o5dcmJSOf0pLKIeTlw0P6cLSNkGPYgEtpuMZOG/yxTNkPR Yke2FG86rsCtylo/eresqcr6w+ZYGCCfQXwDI1N07LYkZoqcGyKUyjTqjNDmU9s8Wds9 TLjQ== X-Gm-Message-State: AOAM532Ffp5fNDY3C9E6mj+egal1CnZjWYjoB0LQ6I767FAjhWqbBtf6 QiOQLYi6RdzoBABVIbH4pygGFw== X-Google-Smtp-Source: ABdhPJxeJOzJq9uyWwvOof6i8p5oYTy6e+2JuWR77baYHWZ6FfxGZ4+UTXzFXoerYhN4HhSwEh2Hqg== X-Received: by 2002:a17:90a:ab07:: with SMTP id m7mr567445pjq.27.1631605307523; Tue, 14 Sep 2021 00:41:47 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.244]) by smtp.gmail.com with ESMTPSA id s3sm9377839pfd.188.2021.09.14.00.41.40 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Sep 2021 00:41:47 -0700 (PDT) From: Muchun Song To: willy@infradead.org, akpm@linux-foundation.org, hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, shakeelb@google.com, guro@fb.com, shy828301@gmail.com, alexs@kernel.org, richard.weiyang@gmail.com, david@fromorbit.com, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, zhengqi.arch@bytedance.com, duanxiongchun@bytedance.com, fam.zheng@bytedance.com, smuchun@gmail.com, Muchun Song Subject: [PATCH v3 74/76] mm: memcontrol: fix cannot alloc the maximum memcg ID Date: Tue, 14 Sep 2021 15:29:36 +0800 Message-Id: <20210914072938.6440-75-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20210914072938.6440-1-songmuchun@bytedance.com> References: <20210914072938.6440-1-songmuchun@bytedance.com> MIME-Version: 1.0 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 59D506001980 X-Stat-Signature: hoemi338ynnsnzgdyk97i88jx8j9c1hp Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=PK4VMjGv; spf=pass (imf14.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.216.45 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com X-HE-Tag: 1631605308-34243 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 idr_alloc() does not include @max ID. So in the current implementation, the maximum memcg ID is 65534 instead of 65535. It seems a bug. So fix this. Signed-off-by: Muchun Song --- mm/memcontrol.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index e3a2e4d65cc5..28f0aa0a2ce5 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -5011,7 +5011,7 @@ static struct mem_cgroup *mem_cgroup_alloc(void) return ERR_PTR(error); memcg->id.id = idr_alloc(&mem_cgroup_idr, NULL, - MEM_CGROUP_ID_MIN, MEM_CGROUP_ID_MAX, + MEM_CGROUP_ID_MIN, MEM_CGROUP_ID_MAX + 1, GFP_KERNEL); if (memcg->id.id < 0) { error = memcg->id.id; From patchwork Tue Sep 14 07:29:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12492239 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_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 084EFC433F5 for ; Tue, 14 Sep 2021 07:41:57 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id AD1EE60F70 for ; Tue, 14 Sep 2021 07:41:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org AD1EE60F70 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 521D1940023; Tue, 14 Sep 2021 03:41:56 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4D1A7940007; Tue, 14 Sep 2021 03:41:56 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 399B2940023; Tue, 14 Sep 2021 03:41:56 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0103.hostedemail.com [216.40.44.103]) by kanga.kvack.org (Postfix) with ESMTP id 2AB38940007 for ; Tue, 14 Sep 2021 03:41:56 -0400 (EDT) Received: from smtpin12.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id E28BA2B36E for ; Tue, 14 Sep 2021 07:41:55 +0000 (UTC) X-FDA: 78585384990.12.B8C6152 Received: from mail-pj1-f53.google.com (mail-pj1-f53.google.com [209.85.216.53]) by imf13.hostedemail.com (Postfix) with ESMTP id AB049102E516 for ; Tue, 14 Sep 2021 07:41:55 +0000 (UTC) Received: by mail-pj1-f53.google.com with SMTP id g13-20020a17090a3c8d00b00196286963b9so1460089pjc.3 for ; Tue, 14 Sep 2021 00:41:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=uSAYuhOyann2TYu2BTLW7Gh2GVVnTWM86+XGXivlMaI=; b=RjdpnwuZYCntSc2k5Rp9Zx731FWalvTUA4/EVgheivP6nkFjljjrIAA+dnk+yGBWcV 7BAOAkK3M032Ow0n4G1tYHQ6EpH5PxkTcfLDV6d/Jd6kD2VzfvtAmYTJCpdu/yyqTsdL 7YKM/5D7ol1TY3tqUaj967frvkZYXxgdGQ/m3tayT79s8ZIw6Qxr4TkeqmUTij+ICSRC ouoo34le5ARMxk2v6MeKQdJu61ALZb3IwujZ0AQOxJgjHkKq8nVx5Qah3Gi8bPeaYlB9 /I0RdqovHxgW/13VCn+0pG8ByT7yBRcecKun3z+OVZJQUl33KATYfAcW71RnjFjXCwb2 sCMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=uSAYuhOyann2TYu2BTLW7Gh2GVVnTWM86+XGXivlMaI=; b=rrPX/tTX6I9MNcfXAtRPm1JUYfzxBiIQa1Ehb99mhJpXwsIbWYHLzNP/A1mGlqQmmU peOqJmqqwk7XtAIMZMSsaSz/VGswXh24Rjn70w3syJS+wyLOWPWMs9VSwXP61IxrDS8G hvcNk0rA4EzAj7mxl1s3nnlyB6IO3JLc6RDigMUfPO4nnONCfZLGL2EYF6tzNryy+W1X QrEOnMpbVT8mot15Sgvnbxfq3mgvtC2qqb8dNiiK/20rX0niRdG9ofrjpPHMMrXMLvMe IqNkhZuSOOUoOFsU1hxuIiB3G7CL7nEO5QOSByxO4RkkOjhh7VKh+mrmBhXwTJNyZpv4 OGTw== X-Gm-Message-State: AOAM5322s6DF8lGy4Ed+X62kECyYGdxbmTh5RNG2JpsfNNRyewr0nkNM aipqOJLfXFqOPZ2CZgn7vTnH/A== X-Google-Smtp-Source: ABdhPJzZ/+akkmlZcbuRVLuFo7kw7adZkfup1RQUhnKbZBRJAiX9R8j05PAQA34sU2tGS+Roa9MW9w== X-Received: by 2002:a17:90a:1c81:: with SMTP id t1mr577065pjt.170.1631605314870; Tue, 14 Sep 2021 00:41:54 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.244]) by smtp.gmail.com with ESMTPSA id s3sm9377839pfd.188.2021.09.14.00.41.47 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Sep 2021 00:41:54 -0700 (PDT) From: Muchun Song To: willy@infradead.org, akpm@linux-foundation.org, hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, shakeelb@google.com, guro@fb.com, shy828301@gmail.com, alexs@kernel.org, richard.weiyang@gmail.com, david@fromorbit.com, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, zhengqi.arch@bytedance.com, duanxiongchun@bytedance.com, fam.zheng@bytedance.com, smuchun@gmail.com, Muchun Song Subject: [PATCH v3 75/76] mm: list_lru: rename list_lru_per_memcg to list_lru_memcg Date: Tue, 14 Sep 2021 15:29:37 +0800 Message-Id: <20210914072938.6440-76-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20210914072938.6440-1-songmuchun@bytedance.com> References: <20210914072938.6440-1-songmuchun@bytedance.com> MIME-Version: 1.0 X-Stat-Signature: sxpkesmeg7ywnwaosagp8cwgr6yyptoe Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=RjdpnwuZ; dmarc=pass (policy=none) header.from=bytedance.com; spf=pass (imf13.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.216.53 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: AB049102E516 X-HE-Tag: 1631605315-414023 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: Before now, the name of list_lru_memcg was occupied. Since previous patch, the name is free. So rename list_lru_per_memcg to list_lru_memcg, it is more brief. Signed-off-by: Muchun Song --- include/linux/list_lru.h | 2 +- mm/list_lru.c | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/include/linux/list_lru.h b/include/linux/list_lru.h index c423be3cf2d3..d654c8e3d262 100644 --- a/include/linux/list_lru.h +++ b/include/linux/list_lru.h @@ -32,7 +32,7 @@ struct list_lru_one { long nr_items; }; -struct list_lru_per_memcg { +struct list_lru_memcg { struct rcu_head rcu; /* array of per cgroup per node lists, indexed by node id */ struct list_lru_one nodes[]; diff --git a/mm/list_lru.c b/mm/list_lru.c index 1202519aeb31..371097ee2485 100644 --- a/mm/list_lru.c +++ b/mm/list_lru.c @@ -52,7 +52,7 @@ static inline struct list_lru_one * list_lru_from_memcg_idx(struct list_lru *lru, int nid, int idx) { if (list_lru_memcg_aware(lru) && idx >= 0) { - struct list_lru_per_memcg *mlru = xa_load(&lru->xa, idx); + struct list_lru_memcg *mlru = xa_load(&lru->xa, idx); return mlru ? &mlru->nodes[nid] : NULL; } @@ -306,7 +306,7 @@ unsigned long list_lru_walk_node(struct list_lru *lru, int nid, #ifdef CONFIG_MEMCG_KMEM if (*nr_to_walk > 0 && list_lru_memcg_aware(lru)) { - struct list_lru_per_memcg *mlru; + struct list_lru_memcg *mlru; unsigned long index; xa_for_each(&lru->xa, index, mlru) { @@ -335,10 +335,10 @@ static void init_one_lru(struct list_lru_one *l) } #ifdef CONFIG_MEMCG_KMEM -static struct list_lru_per_memcg *memcg_list_lru_alloc(gfp_t gfp) +static struct list_lru_memcg *memcg_list_lru_alloc(gfp_t gfp) { int nid; - struct list_lru_per_memcg *lru; + struct list_lru_memcg *lru; lru = kmalloc(struct_size(lru, nodes, nr_node_ids), gfp); if (!lru) @@ -352,7 +352,7 @@ static struct list_lru_per_memcg *memcg_list_lru_alloc(gfp_t gfp) static void memcg_list_lru_free(struct list_lru *lru, int src_idx) { - struct list_lru_per_memcg *mlru = xa_erase_irq(&lru->xa, src_idx); + struct list_lru_memcg *mlru = xa_erase_irq(&lru->xa, src_idx); /* * The __list_lru_walk_one() can walk the list of this node. @@ -374,7 +374,7 @@ static void memcg_init_list_lru(struct list_lru *lru, bool memcg_aware) static void memcg_destroy_list_lru(struct list_lru *lru) { XA_STATE(xas, &lru->xa, 0); - struct list_lru_per_memcg *mlru; + struct list_lru_memcg *mlru; if (!list_lru_memcg_aware(lru)) return; @@ -477,7 +477,7 @@ int list_lru_memcg_alloc(struct list_lru *lru, struct mem_cgroup *memcg, gfp_t g int i; struct list_lru_memcg_table { - struct list_lru_per_memcg *mlru; + struct list_lru_memcg *mlru; struct mem_cgroup *memcg; } *table; @@ -488,7 +488,7 @@ int list_lru_memcg_alloc(struct list_lru *lru, struct mem_cgroup *memcg, gfp_t g return 0; /* - * The allocated list_lru_per_memcg array is not accounted directly. + * The allocated list_lru_memcg array is not accounted directly. * Moreover, it should not come from DMA buffer and is not readily * reclaimable. So those GFP bits should be masked off. */ @@ -500,7 +500,7 @@ int list_lru_memcg_alloc(struct list_lru *lru, struct mem_cgroup *memcg, gfp_t g /* * Because the list_lru can be reparented to the parent cgroup's * list_lru, we should make sure that this cgroup and all its - * ancestors have allocated list_lru_per_memcg. + * ancestors have allocated list_lru_memcg. */ for (i = 0; memcg; memcg = parent_mem_cgroup(memcg), i++) { if (memcg_list_lru_skip_alloc(lru, memcg)) @@ -519,7 +519,7 @@ int list_lru_memcg_alloc(struct list_lru *lru, struct mem_cgroup *memcg, gfp_t g xas_lock_irqsave(&xas, flags); while (i--) { int index = memcg_cache_id(table[i].memcg); - struct list_lru_per_memcg *mlru = table[i].mlru; + struct list_lru_memcg *mlru = table[i].mlru; xas_set(&xas, index); retry: From patchwork Tue Sep 14 07:29:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12492241 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_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 1C3F5C433EF for ; Tue, 14 Sep 2021 07:42:04 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B1C4460F70 for ; Tue, 14 Sep 2021 07:42:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org B1C4460F70 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 56F25940024; Tue, 14 Sep 2021 03:42:03 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 51F35940007; Tue, 14 Sep 2021 03:42:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3E869940024; Tue, 14 Sep 2021 03:42:03 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0178.hostedemail.com [216.40.44.178]) by kanga.kvack.org (Postfix) with ESMTP id 2ED50940007 for ; Tue, 14 Sep 2021 03:42:03 -0400 (EDT) Received: from smtpin02.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id E431F2B36E for ; Tue, 14 Sep 2021 07:42:02 +0000 (UTC) X-FDA: 78585385284.02.3080129 Received: from mail-pj1-f54.google.com (mail-pj1-f54.google.com [209.85.216.54]) by imf18.hostedemail.com (Postfix) with ESMTP id A51654002087 for ; Tue, 14 Sep 2021 07:42:02 +0000 (UTC) Received: by mail-pj1-f54.google.com with SMTP id u13-20020a17090abb0db0290177e1d9b3f7so1477154pjr.1 for ; Tue, 14 Sep 2021 00:42:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=/CUB88/FqeRt+OVWlft0iBfJ40Vb/KWjqElOuPdMD70=; b=rTJJ/eMiE+Avxnn6TesM3SKY0q/LBFL95nxNlqPiFb0QWIihuVfQq6xQqgeFTwvmAl tIRfhq3xNb0KzfufoUgbX2K2vXKNf1+jNptKTW/XhwEM3xUv00+pbwZrWtFFGrEM+Eyg W7KvfKxYMy3wdJNxJPfj3/jeh0fTBH86WeGHNC4dm29fahTON9a0fX+QEYFopyaEXu9A EnQ6ZuzbwiYn92qbSNvH/pi5NYQoHHtIqNL6MkzmqQ59JmP7cCY7ewb2xzNilHG/+Qyw g9BthK+IwaDnI9b/N2LDXadLAObW/BHqeyJ3FO677/RjuIg53p1jIEed4dPS1A6M6EiT AB3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=/CUB88/FqeRt+OVWlft0iBfJ40Vb/KWjqElOuPdMD70=; b=CLs9GE8JpAW5rxX1Ivojp86a0FrmrrD+cxH89g53AlYuTfv1nLuz1OL2K9evd0+Mke lVY0prgxvBU8DVnCbkzoK59Yjxh7SIJIyF3U3rnj8EpfCtHcdZjSfXPnNAVQUYm4KSEE XwsIQnRyTA9hHO0ozu5CWJa4ET27D+RdrsFy+hI+pnZWp3WS2H9QV+YYnESrI8Hgfpmr L7/rEBpSFGLTy5KLrFyEyXummEEt6xWS9xJrWdw0ScCo6lJlncv2d3iCV06l3ThJTICe kgPoKKRc2dLVLl77JAaBkURfMlveZuYb0P23oX1GpTT1CDeBZJ9MDe+ZlCXh56BqDD2P 18JQ== X-Gm-Message-State: AOAM5309dyPlv//szTxFsefumOR0mY4OryWlsVUuZTRzgmZbtLFCH+xP nDaPxIRG0xpJSVrqmiqu1qf8Kg== X-Google-Smtp-Source: ABdhPJxXQb/1pg6WwA5902/GVe6aKv1ypsajk4jUVpRYCnVpAyd3ouY5mba5097zNjHbW4FJ2ybJgA== X-Received: by 2002:a17:90a:4ce3:: with SMTP id k90mr540686pjh.237.1631605321784; Tue, 14 Sep 2021 00:42:01 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.244]) by smtp.gmail.com with ESMTPSA id s3sm9377839pfd.188.2021.09.14.00.41.55 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Sep 2021 00:42:01 -0700 (PDT) From: Muchun Song To: willy@infradead.org, akpm@linux-foundation.org, hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, shakeelb@google.com, guro@fb.com, shy828301@gmail.com, alexs@kernel.org, richard.weiyang@gmail.com, david@fromorbit.com, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, zhengqi.arch@bytedance.com, duanxiongchun@bytedance.com, fam.zheng@bytedance.com, smuchun@gmail.com, Muchun Song Subject: [PATCH v3 76/76] mm: memcontrol: rename memcg_cache_id to memcg_kmem_id Date: Tue, 14 Sep 2021 15:29:38 +0800 Message-Id: <20210914072938.6440-77-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20210914072938.6440-1-songmuchun@bytedance.com> References: <20210914072938.6440-1-songmuchun@bytedance.com> MIME-Version: 1.0 Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b="rTJJ/eMi"; spf=pass (imf18.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.216.54 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com X-Stat-Signature: assf5yffdhqoaembtkxgnjipkigqncsi X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: A51654002087 X-HE-Tag: 1631605322-863777 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 memcg_cache_id is introduced by commit 2633d7a02823 ("slab/slub: consider a memcg parameter in kmem_create_cache"). It is used to index in the kmem_cache->memcg_params->memcg_caches array. Since kmem_cache->memcg_params.memcg_caches has been removed by commit 9855609bde03 ("mm: memcg/slab: use a single set of kmem_caches for all accounted allocations"). So the name does not need to reflect cache related. Just rename it to memcg_kmem_id. And it can reflect kmem related. Signed-off-by: Muchun Song --- include/linux/memcontrol.h | 4 ++-- mm/list_lru.c | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index 33f6ec4783f8..6541ec768a60 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h @@ -1713,7 +1713,7 @@ static inline void memcg_kmem_uncharge_page(struct page *page, int order) * A helper for accessing memcg's kmem_id, used for getting * corresponding LRU lists. */ -static inline int memcg_cache_id(struct mem_cgroup *memcg) +static inline int memcg_kmem_id(struct mem_cgroup *memcg) { return memcg ? memcg->kmemcg_id : -1; } @@ -1751,7 +1751,7 @@ static inline bool memcg_kmem_enabled(void) return false; } -static inline int memcg_cache_id(struct mem_cgroup *memcg) +static inline int memcg_kmem_id(struct mem_cgroup *memcg) { return -1; } diff --git a/mm/list_lru.c b/mm/list_lru.c index 371097ee2485..8fb38dee0e99 100644 --- a/mm/list_lru.c +++ b/mm/list_lru.c @@ -74,7 +74,7 @@ list_lru_from_kmem(struct list_lru *lru, int nid, void *ptr, if (!memcg) goto out; - l = list_lru_from_memcg_idx(lru, nid, memcg_cache_id(memcg)); + l = list_lru_from_memcg_idx(lru, nid, memcg_kmem_id(memcg)); out: if (memcg_ptr) *memcg_ptr = memcg; @@ -181,7 +181,7 @@ unsigned long list_lru_count_one(struct list_lru *lru, long count = 0; rcu_read_lock(); - l = list_lru_from_memcg_idx(lru, nid, memcg_cache_id(memcg)); + l = list_lru_from_memcg_idx(lru, nid, memcg_kmem_id(memcg)); if (l) count = READ_ONCE(l->nr_items); rcu_read_unlock(); @@ -273,7 +273,7 @@ list_lru_walk_one(struct list_lru *lru, int nid, struct mem_cgroup *memcg, unsigned long ret; spin_lock(&nlru->lock); - ret = __list_lru_walk_one(lru, nid, memcg_cache_id(memcg), isolate, + ret = __list_lru_walk_one(lru, nid, memcg_kmem_id(memcg), isolate, cb_arg, nr_to_walk); spin_unlock(&nlru->lock); return ret; @@ -289,7 +289,7 @@ list_lru_walk_one_irq(struct list_lru *lru, int nid, struct mem_cgroup *memcg, unsigned long ret; spin_lock_irq(&nlru->lock); - ret = __list_lru_walk_one(lru, nid, memcg_cache_id(memcg), isolate, + ret = __list_lru_walk_one(lru, nid, memcg_kmem_id(memcg), isolate, cb_arg, nr_to_walk); spin_unlock_irq(&nlru->lock); return ret; @@ -463,7 +463,7 @@ void memcg_reparent_list_lrus(struct mem_cgroup *memcg, struct mem_cgroup *paren static bool memcg_list_lru_skip_alloc(struct list_lru *lru, struct mem_cgroup *memcg) { - int idx = memcg_cache_id(memcg); + int idx = memcg_kmem_id(memcg); if (unlikely(idx < 0) || xa_load(&lru->xa, idx)) return true; @@ -518,7 +518,7 @@ int list_lru_memcg_alloc(struct list_lru *lru, struct mem_cgroup *memcg, gfp_t g xas_lock_irqsave(&xas, flags); while (i--) { - int index = memcg_cache_id(table[i].memcg); + int index = memcg_kmem_id(table[i].memcg); struct list_lru_memcg *mlru = table[i].mlru; xas_set(&xas, index); @@ -538,7 +538,7 @@ int list_lru_memcg_alloc(struct list_lru *lru, struct mem_cgroup *memcg, gfp_t g * memcg id. More details see the comments * in memcg_reparent_list_lrus(). */ - index = memcg_cache_id(table[i].memcg); + index = memcg_kmem_id(table[i].memcg); if (index < 0) xas_set_err(&xas, 0); else if (!xas_error(&xas) && index != xas.xa_index)