From patchwork Mon Feb 12 21:38:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suren Baghdasaryan X-Patchwork-Id: 13554041 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 CDD1FC4829F for ; Mon, 12 Feb 2024 21:39:43 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3A6826B0075; Mon, 12 Feb 2024 16:39:42 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 359036B007B; Mon, 12 Feb 2024 16:39:42 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 187116B007D; Mon, 12 Feb 2024 16:39:42 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 0513F6B0075 for ; Mon, 12 Feb 2024 16:39:42 -0500 (EST) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id D113A1A0ABA for ; Mon, 12 Feb 2024 21:39:41 +0000 (UTC) X-FDA: 81784468962.19.C2997E9 Received: from mail-yb1-f201.google.com (mail-yb1-f201.google.com [209.85.219.201]) by imf07.hostedemail.com (Postfix) with ESMTP id 13F7840006 for ; Mon, 12 Feb 2024 21:39:39 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=P9bQTIQ3; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf07.hostedemail.com: domain of 3GpDKZQYKCJkLNK7G49HH9E7.5HFEBGNQ-FFDO35D.HK9@flex--surenb.bounces.google.com designates 209.85.219.201 as permitted sender) smtp.mailfrom=3GpDKZQYKCJkLNK7G49HH9E7.5HFEBGNQ-FFDO35D.HK9@flex--surenb.bounces.google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1707773980; 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=DoSimaxvysC1tsWvSL78khESKiClPBlBlt51p8Cfztk=; b=BXLSwq6bi1ARXDI1EVdCb1rOxh2fQWDRbWjiOYisZJl111ol07fYDUpHaiZ/5ta025Ao0u OA9m1yMuclTfuuZgD+fYzgTKtzBoYnZbvg3UTq9SK7mzvMMYQHXObowCTQLdcfOIwKr34W Bf4rYd0PaTKiriVkNQkZRYYbOCzMybU= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=P9bQTIQ3; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf07.hostedemail.com: domain of 3GpDKZQYKCJkLNK7G49HH9E7.5HFEBGNQ-FFDO35D.HK9@flex--surenb.bounces.google.com designates 209.85.219.201 as permitted sender) smtp.mailfrom=3GpDKZQYKCJkLNK7G49HH9E7.5HFEBGNQ-FFDO35D.HK9@flex--surenb.bounces.google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1707773980; a=rsa-sha256; cv=none; b=PSFB7wXtl6+2U9wM2D8zU+1ZXEwhTudz+VH5Bb7NQ3/07JCBgNmUkfI2EMtkwbKGmI/Tee gJ2QDeegTG6vTSHjEmXEUCPqkxjKDENRzYgXY5rRJp7zRodihABMe3yL3Vz88q73MUPsCL /+XpQhZnCwRKQA/dz4OrKXqnTLD+++w= Received: by mail-yb1-f201.google.com with SMTP id 3f1490d57ef6-dcc15b03287so603923276.3 for ; Mon, 12 Feb 2024 13:39:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1707773979; x=1708378779; darn=kvack.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=DoSimaxvysC1tsWvSL78khESKiClPBlBlt51p8Cfztk=; b=P9bQTIQ3FDvSpBDgLN57vW9qsCVAxgxz0XZt3swb2xXADqMnAWVugmn7f72fZz8OTQ hmhmsht4bu8GRpBUj1mEJb4KlVG/v8aBwiU56j8Oh5YqFgaZ8m5XKNcl02JF+4IEkfyf dp8ohpGOnMrkEpCx1FzE3i/PDEzNcc0hZ+SavbzCRYD40DfUfUf44v7EpFiR9de0YdaU m6ppnyCxxWPK8+qG7acbu4741JbIFVrC68FkhHjEGdQHxoB8aL20JritTyG6sZdjXGyv QkoTK0nUerFRKnE+zP2IugJo4xUWOntSPnxRui4ospQU4moPVysIfc4hsfZfWgEn5p8c HfZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707773979; x=1708378779; 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=DoSimaxvysC1tsWvSL78khESKiClPBlBlt51p8Cfztk=; b=CCPk0J4oDyfht9xcrsk1rK5SRHdnu5vFKvLADf+dIlYz+JpROdc/IcU/goAo+VYVUw ZqxKgYPp/yjXUSoFZ2uYhTK9q7rKZBgyUlxsTz5+tGhseImQOnehpJdAXKSWMmgFF/ii jH6S3W7NmLCWejDaxqpoVLTyAWSB0uV+OS3yUJ3a+fo8/w0ueH9S5wINO2mUq2wAI7T8 UsbhZQ+Twgfpzf2MkAqW+ZrxottWI8TApvdaaorNg+9PXIAWYJdcgV7BKPrQHSrrA53J 8cADT/UWcAJlo5AZ/T3J65xHib4+fTpBDZNzO2nE2eioJzkbKJqXTyp9knbfg/THzmlC ht/A== X-Gm-Message-State: AOJu0YzjcM5Fv+xwMmZdEdo1aMh/G0Hma30BnBewqgIvivCOkIw4/Bhq mMCzvXP9NrGerxVxv0mFnrASr65NTVOpLRUGGcWSlO2VEFjhZ7hmnZ6mzK2YJspRWXc+p87/tDe zSg== X-Google-Smtp-Source: AGHT+IHrMi+yJjCe9l2fRgqlZ6eFfFd+JGnX1MN85wktYNynWGXKMQ9Jg1QyNSwk5gH8+cU1DTAXQiWqo+k= X-Received: from surenb-desktop.mtv.corp.google.com ([2620:15c:211:201:b848:2b3f:be49:9cbc]) (user=surenb job=sendgmr) by 2002:a05:6902:1005:b0:dcb:c2c0:b319 with SMTP id w5-20020a056902100500b00dcbc2c0b319mr80854ybt.9.1707773978951; Mon, 12 Feb 2024 13:39:38 -0800 (PST) Date: Mon, 12 Feb 2024 13:38:49 -0800 In-Reply-To: <20240212213922.783301-1-surenb@google.com> Mime-Version: 1.0 References: <20240212213922.783301-1-surenb@google.com> X-Mailer: git-send-email 2.43.0.687.g38aa6559b0-goog Message-ID: <20240212213922.783301-4-surenb@google.com> Subject: [PATCH v3 03/35] 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, 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, vvvvvv@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-Rspamd-Queue-Id: 13F7840006 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: 5y7uhe4jim3ctdm365rops83sicj144c X-HE-Tag: 1707773979-755969 X-HE-Meta: U2FsdGVkX1+sitLwXOGqNxXt/VVQyu9B35I3wgDHuiJFjO4wYJSt38CBR3KkNO1wuiqqsxb9vVhZlarW0YLnux1FQ/EEJeNL+IqdYpbAH70RZt6O7ypMVX7V6v4KhJPp8ojAAkLhkdiWW7zRFXukYBeZ+mRxD7vMe7Cwq0dnP2XSVydtQm0UEx8SwL7KBleSPaLjdz6dE54Xobpmg5dNAQgzRMPslAoe5/puTpdpG7lxR95v+qCgElvvkBzGVwd5/r1dCtJf2BqisQete/rkWb8Npasd6f/72WWV/Mv6P+jSazdeWXkaoOASXTuAxwz0kPXE4sQOLC/X7i1pYGJWwekPORrtTgGvbzX/wprVFi46nh+24YiUHjVSHNfUZ12s98E2gNCz+Af4MhYWj2drHFl6jOjz92lbu51Sg04z6T3ihiFSS578PSJieZ60if+uJUx1JXZQ/ves3vEuhRzEOYMB7Rg1Zj2k69pM+JYOwkwV9rVAyZQGIkqNkn+LdW7GRCQOcldevTzEhSvmJJjrkf/YSfDt/gvkbsTtNmEw5IdOsGbCLG5YjJHbOJKPYIboqoJBKW4inDBJKegA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RE2Fth2DwuQP/DjT8tUEjLbl6pYOYp+XE9xI6b9Gi79FuVQty3pLn8n9GzG5bImBv1ex6kVw6b07JSOpuGeT1C5imH6I4arZ5dHNFePRa8iE+Ixk 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: List-Subscribe: List-Unsubscribe: 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 Reviewed-by: Kees Cook --- 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 ed5966a70495..7794b4182bac 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -3013,11 +3013,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)