From patchwork Mon May 1 16:54:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suren Baghdasaryan X-Patchwork-Id: 13227639 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 04001C77B7C for ; Mon, 1 May 2023 16:55:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 94C77900006; Mon, 1 May 2023 12:55:19 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 92501900002; Mon, 1 May 2023 12:55:19 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7EBBF900006; Mon, 1 May 2023 12:55:19 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 6E546900002 for ; Mon, 1 May 2023 12:55:19 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 48AEB80805 for ; Mon, 1 May 2023 16:55:18 +0000 (UTC) X-FDA: 80742286716.05.7F330D9 Received: from mail-yw1-f202.google.com (mail-yw1-f202.google.com [209.85.128.202]) by imf14.hostedemail.com (Postfix) with ESMTP id 6F189100023 for ; Mon, 1 May 2023 16:55:15 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=google.com header.s=20221208 header.b=kNURb9oR; spf=pass (imf14.hostedemail.com: domain of 38u5PZAYKCDknpmZiWbjjbgZ.Xjhgdips-hhfqVXf.jmb@flex--surenb.bounces.google.com designates 209.85.128.202 as permitted sender) smtp.mailfrom=38u5PZAYKCDknpmZiWbjjbgZ.Xjhgdips-hhfqVXf.jmb@flex--surenb.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1682960115; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=bGdFaZ9yLSvpkzL04e/VHNU0a1vWusSmGZaxEHf2wm8=; b=jzXvzPQBJgLHpx+PF6jOxngGxclUbGmFdkHwoSDJfAQU8M8t12o+V22LDvAM8aeGxMYgwJ 8ibzC0AQ/GCYLsYMI5sDK0rQd57Gzle7WaCtrZPSE9L5RlrRnXCt0XdMu4Y1jTBgm79LL1 7qmhvGkko91LkxMo05vW135c4kE0wSY= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=google.com header.s=20221208 header.b=kNURb9oR; spf=pass (imf14.hostedemail.com: domain of 38u5PZAYKCDknpmZiWbjjbgZ.Xjhgdips-hhfqVXf.jmb@flex--surenb.bounces.google.com designates 209.85.128.202 as permitted sender) smtp.mailfrom=38u5PZAYKCDknpmZiWbjjbgZ.Xjhgdips-hhfqVXf.jmb@flex--surenb.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1682960115; a=rsa-sha256; cv=none; b=DdpiaroqRox5MgH3awoD+hRkgup+xEExlPn621ZDjaKy4Cdt3iqkpHT1b48G3gtPGWAz0+ heULVi145i99o8ZNcitxjfGVSPZrxmMFv8sa7zGzYuugw4wMeyRAeDykk4mE6yW00k8Iop O732Z+ZsHoqYfUEFnk7RdH9xoiPVI8g= Received: by mail-yw1-f202.google.com with SMTP id 00721157ae682-559e55b8766so38359207b3.1 for ; Mon, 01 May 2023 09:55:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1682960114; x=1685552114; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=bGdFaZ9yLSvpkzL04e/VHNU0a1vWusSmGZaxEHf2wm8=; b=kNURb9oRoWKMv7g0yo2L8rW1EcO17+d5GcAx/UcGQY6Nq04eWDbD4SbdCNOLXgOYzq iIefzjvXI4Snk9VN4a44AHM12D0iuNdtL0q3JhvnQXzZtf429k8SdHQyNq1DhIH3u3D/ vgRvJtIdIGprvSKRamhSV8bn0NWTicrhYnvBvcVO6D5qUdO+wBWr5u0wD0Nu7LbQQb+M IIs2pzxiZlPELIg9+H7fv7z/PKPu/SB3zB+CWnrv1/57UJqzRl/3C3lgPuiSCXQkCpOG 4JQ2sAFEorBhte2EmAzube4SlGlrch2L/NYmCg7/2eMQe55a1P+zlu78IrB4haHDMTMn h3Fg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682960114; x=1685552114; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=bGdFaZ9yLSvpkzL04e/VHNU0a1vWusSmGZaxEHf2wm8=; b=PqNJDLBpet//XbezV2RNgKen7MVdxNlWp43pNTopt1bragAU08kOaK9TIYwitAPDb1 Ms2MkvOcY6v2IWDUihVyls3k8soLA320NPKBg/LTobfZL6YYe5Q2RnYIsX+NWs9hmbWX 1v/4pxNig8OGofAAQLMHoafu5CYoJ5f4fZd5IlpZ0nxPV4T7RR03ObAmqTDc1tM8+vjB ZNVSC+tSMZPAys+iq8ZUmdFy7/g7w78A2ExGiDwPOnH4nkcbSG9J97vAbp3XJSkosq89 8nSUWruPsvz6RlWOU5PzWzCx/AA7u3l+p3jTy/wG1EBYG1xfq5G3lXgOW2ZsIpMpd/AF 8dUg== X-Gm-Message-State: AC+VfDwg086/GxL2lyH3nUcLdQZcpsGcNroWSRtLSnrn8QyEEwyc+UUO ywPAzPllGrwNQhJtGSlN7vWYon23OJ4= X-Google-Smtp-Source: ACHHUZ54ReoLXFk1oTaYjmLVtkkNt2jRchxoRiCx8rxY23YjrphJueyeWWbM6qC2nW3CU7hKMZM9JkpwZiA= X-Received: from surenb-desktop.mtv.corp.google.com ([2620:15c:211:201:6d24:3efd:facc:7ac4]) (user=surenb job=sendgmr) by 2002:a05:690c:723:b0:54f:68a1:b406 with SMTP id bt3-20020a05690c072300b0054f68a1b406mr8285886ywb.2.1682960114403; Mon, 01 May 2023 09:55:14 -0700 (PDT) Date: Mon, 1 May 2023 09:54:13 -0700 In-Reply-To: <20230501165450.15352-1-surenb@google.com> Mime-Version: 1.0 References: <20230501165450.15352-1-surenb@google.com> X-Mailer: git-send-email 2.40.1.495.gc816e09b53d-goog Message-ID: <20230501165450.15352-4-surenb@google.com> Subject: [PATCH 03/40] fs: Convert alloc_inode_sb() to a macro From: Suren Baghdasaryan To: akpm@linux-foundation.org Cc: kent.overstreet@linux.dev, mhocko@suse.com, vbabka@suse.cz, hannes@cmpxchg.org, roman.gushchin@linux.dev, mgorman@suse.de, dave@stgolabs.net, willy@infradead.org, liam.howlett@oracle.com, corbet@lwn.net, void@manifault.com, peterz@infradead.org, juri.lelli@redhat.com, ldufour@linux.ibm.com, catalin.marinas@arm.com, will@kernel.org, arnd@arndb.de, tglx@linutronix.de, mingo@redhat.com, dave.hansen@linux.intel.com, x86@kernel.org, peterx@redhat.com, david@redhat.com, axboe@kernel.dk, mcgrof@kernel.org, masahiroy@kernel.org, nathan@kernel.org, dennis@kernel.org, tj@kernel.org, muchun.song@linux.dev, rppt@kernel.org, paulmck@kernel.org, pasha.tatashin@soleen.com, yosryahmed@google.com, yuzhao@google.com, dhowells@redhat.com, hughd@google.com, andreyknvl@gmail.com, keescook@chromium.org, ndesaulniers@google.com, gregkh@linuxfoundation.org, ebiggers@google.com, ytcoode@gmail.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, bristot@redhat.com, vschneid@redhat.com, cl@linux.com, penberg@kernel.org, iamjoonsoo.kim@lge.com, 42.hyeyoo@gmail.com, glider@google.com, elver@google.com, dvyukov@google.com, shakeelb@google.com, songmuchun@bytedance.com, jbaron@akamai.com, rientjes@google.com, minchan@google.com, kaleshsingh@google.com, surenb@google.com, kernel-team@android.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, iommu@lists.linux.dev, linux-arch@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-modules@vger.kernel.org, kasan-dev@googlegroups.com, cgroups@vger.kernel.org, Alexander Viro X-Stat-Signature: gyafegnp998s1ap7io1rees4nod1f1o9 X-Rspam-User: X-Rspamd-Queue-Id: 6F189100023 X-Rspamd-Server: rspam06 X-HE-Tag: 1682960115-700551 X-HE-Meta: U2FsdGVkX1/8+DlvN3OXli0w2oqiBH2DElh6Vc/XusPy0vCNTsuQr4wzd/VLi2rbZnYDwZ1tFOdxXkJS3bhkrf4Odh2Wt6SzC1N4FQUip8xVEfy5c+gU7Oluqi7LUQh/MNB9zG4osNjQ84rq8Wo8ohRi4z9qHtvONTPI1vdPXDlqpHVIVjc9/INXHLcRs6RsX1fn4bZyV1lP2SfEn1tLvUnpyxTg7UUcfXLKFwitxX+OJjMn4sC2IafhAHjLmFfwVf/2eA1wvRtbnHBgwBd7J8wdADvtoGX+FUvhMUZiZ/OXHy6pmstRzZ1CLhUAi8HAKR4H2vZg+x0CQsIqEEBu1bIDsxdyCd0Dz8FjccWV0c+JOGDxa9Oe4YgURLmO6CpBEmwY/4HWiMaq/zw7VYOA/skTDDFAZ/c637KNRO2SwL3RifqeMfPKm+O/M6orEf0q0cZj8aYkUqo1Ym4QbNpURuK1ssVkg4xVEzWAalNsG6QkOd96fl0jgBK/XNkD7SVm62xbiZr4c0tRU0wpyyVwe3Ep8oKVK1wd3NckVfXH7ZpS42Ri0Uy+umP7kuZv6UsNun5pRBHYzXaoYPSMfc7yjXDbTw3ph5MCyJ4OYUBkRqmK+1N0eO/Mz/Vp1HHf7jq3Zx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2AZC8FPCnhxtGAHH3LRTWklHBncBda6V4LzOIuGiwwOK1sxVGmRVuua1k/7sax 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: From: Kent Overstreet We're introducing alloc tagging, which tracks memory allocations by callsite. Converting alloc_inode_sb() to a macro means allocations will be tracked by its caller, which is a bit more useful. Signed-off-by: Kent Overstreet Signed-off-by: Suren Baghdasaryan Cc: Alexander Viro --- include/linux/fs.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/include/linux/fs.h b/include/linux/fs.h index 21a981680856..4905ce14db0b 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -2699,11 +2699,7 @@ int setattr_should_drop_sgid(struct mnt_idmap *idmap, * 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); -} +#define alloc_inode_sb(_sb, _cache, _gfp) 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)