From patchwork Wed Feb 21 19:40:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suren Baghdasaryan X-Patchwork-Id: 13566185 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 EF418C48BEB for ; Wed, 21 Feb 2024 19:41:12 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A4BA66B0092; Wed, 21 Feb 2024 14:41:10 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 9D2BC6B0093; Wed, 21 Feb 2024 14:41:10 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7D7666B0095; Wed, 21 Feb 2024 14:41:10 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 6054C6B0092 for ; Wed, 21 Feb 2024 14:41:10 -0500 (EST) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 1D69D160AC1 for ; Wed, 21 Feb 2024 19:41:10 +0000 (UTC) X-FDA: 81816829500.23.7522559 Received: from mail-yw1-f201.google.com (mail-yw1-f201.google.com [209.85.128.201]) by imf19.hostedemail.com (Postfix) with ESMTP id 6F9C61A000F for ; Wed, 21 Feb 2024 19:41:08 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=TJuSI6HQ; spf=pass (imf19.hostedemail.com: domain of 301HWZQYKCAYy0xkthmuumrk.iusrot03-ssq1giq.uxm@flex--surenb.bounces.google.com designates 209.85.128.201 as permitted sender) smtp.mailfrom=301HWZQYKCAYy0xkthmuumrk.iusrot03-ssq1giq.uxm@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=1708544468; 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=14sostfgXdBtkigrgclSIrhsv4NljUYVKVXEohyvFzI=; b=yNxxS6ZHtP/SScj8ONxLVhG6C8J3hbboDG8HmooeyDEg2RE6+eqLHjavQZnVwbjIc7o2MS fpo7zFO2JfYIAXgSi+1IDXzV7/dAtXolcqO1ckc8OlwctMOxpqAkzqWOCWjYzerDp8I2p/ OrpjAdKc6B+ZX87dBSPyfX7D14xBsYk= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=TJuSI6HQ; spf=pass (imf19.hostedemail.com: domain of 301HWZQYKCAYy0xkthmuumrk.iusrot03-ssq1giq.uxm@flex--surenb.bounces.google.com designates 209.85.128.201 as permitted sender) smtp.mailfrom=301HWZQYKCAYy0xkthmuumrk.iusrot03-ssq1giq.uxm@flex--surenb.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1708544468; a=rsa-sha256; cv=none; b=5qVJ6sOVPX8GvHg7zxbJeOZc6fSDlSXvofF8NNVnGc99V7chwE4lMHnefuBWBlJWPwZs4t NDWoH7k9jv7UXxiiuHzTi3WKdWJF8uKK1g6mgqOfNSJ4S1erUew8kWZGckA5YcaBY7JTu6 J4Wf5RfFssPQpHuSJBeoylaZynb/nYI= Received: by mail-yw1-f201.google.com with SMTP id 00721157ae682-6047fed0132so108263307b3.1 for ; Wed, 21 Feb 2024 11:41:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1708544467; x=1709149267; 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=14sostfgXdBtkigrgclSIrhsv4NljUYVKVXEohyvFzI=; b=TJuSI6HQKTGRCDQhKLRnA9hN8hrDUlPstYih4VwTTLO/wP49a8hyrVJ5vlVlFRShRa igRNhNuifBiYDUgJWoVMDdmup+a4x6Kp1kcSc5HCtgrCgohT7ZTTkFh61c4TmKIyR5Y8 ZGZtgeAAZnh5I77vvsQAkBnOYtVGmQGPUnwlcZFwyLprFDQYO1rNwCMmXb8h4MCRyYEO GXtd8D/xOoM0Fc9iFlWUOYstjpDkWajqpHycEPuDGEIKbia6FtEiXC2S0mMm6PCyiJLG /J9GmFubyuagPOpLXwQGsoOtqMyAPOeDCHhyohlcPBTHFMZPPPQFt7HBEJ36Q38Qc/TE Ad4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708544467; x=1709149267; 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=14sostfgXdBtkigrgclSIrhsv4NljUYVKVXEohyvFzI=; b=BbZwGaayNDpQy6jM4KqaN8OOUjrOMTxeQZaaaGPQGGUnaOC3XLU9nKFFPd2Xyuyc/C vnFeTYwKJRfxbv6H9nhYZtqJ+gzCKzqO6HUu1ITdkZyz8sAoV3TkNS5G56QkvShB0QXH +8U3NBF5HZuSUoBoCOHVk4uUIwivwzuqKnmrcMf30yp/4gyejZl2gvgnw+LFoX0WN6oz d3ITr84NvOZn1AS6G8C3qt6GbrPhMRit8TTMzWK19tpFVxv4MLh6RV6fzPMR2xByyvRx nVeIBNYcHCJ0eeeLuhHoXgvzF4Qivl0JaW8ZioNxid7b0PBQubFFuJ7UUxF3JVRyv4Um cPhQ== X-Forwarded-Encrypted: i=1; AJvYcCV8fzFriuJjvHTAUCK7Yh6OnGi+gsn8wqnOgMpPDWM2K7TjmyoeThD5Cy47ksZX6WwhOVuM3iWVhqG0GL9DmQa90Os= X-Gm-Message-State: AOJu0Yx945KBOUGBJ6OD6p2o3qLZWO9+xYuxs+ba5mx6ozeHEJbv7dYi cLLR+8oGy/0LuYqZSYOAK0lbrp8ghA1sPn1KW1LuWygWxxkITdYrykrO95N6JD6/DL9NvFd2d+t ZTQ== X-Google-Smtp-Source: AGHT+IEg8J3/Tgw3rQ0HmvocmCN1KEaF26PclNShE/JXdkinKLyGnMcr7oBUIgKaZkEgV9b6wmo43w0h+Rc= X-Received: from surenb-desktop.mtv.corp.google.com ([2620:15c:211:201:953b:9a4e:1e10:3f07]) (user=surenb job=sendgmr) by 2002:a05:6902:4c2:b0:dcc:4785:b51e with SMTP id v2-20020a05690204c200b00dcc4785b51emr10314ybs.12.1708544467498; Wed, 21 Feb 2024 11:41:07 -0800 (PST) Date: Wed, 21 Feb 2024 11:40:18 -0800 In-Reply-To: <20240221194052.927623-1-surenb@google.com> Mime-Version: 1.0 References: <20240221194052.927623-1-surenb@google.com> X-Mailer: git-send-email 2.44.0.rc0.258.g7320e95886-goog Message-ID: <20240221194052.927623-6-surenb@google.com> Subject: [PATCH v4 05/36] 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, penguin-kernel@i-love.sakura.ne.jp, 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: 6F9C61A000F X-Rspam-User: X-Stat-Signature: m6t5sgxsha7wutzcgp9o7nuf7tuqymh3 X-Rspamd-Server: rspam01 X-HE-Tag: 1708544468-921273 X-HE-Meta: U2FsdGVkX1/OV9ideRMTOqYbDQmHgvf0rmFa8d0SloW7ETucp6L1YLjo01Pk8WP3+lwfP/STFgXd7HOH3jI3UqwrE5wAQkZtH5Go7xM7YSR454IfDGcX25bEK9iZ97r5KrK1CoyIvUaaHSBGB1NNKbVDTk1H1q3L5n7TqfuqCHzdO+QRKdjYDcezVPi6eXL0kYgbA5F1inZT/lrD6/zIBTvFA9jbxkvsIoQT6EMEaUw7IEUJsGmPtKCitvGXoIX7YHk2Ffy3yVXleRzqe78LDn/xtvvrETEYWra1ooaH3Xh/XIPruVwkJBxlqqRPXiSdnj+Wk/abafC+4pGYxT+cpUdAHGOrYseoWWhVwz/nc0u4zWbIaU/vAdvcIgZLcJMFfxD0mks2FzOTEDrwa/Uq0zJMkvT/vh9GjgDzh5F0uUDG9fDGVDvfz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ender: 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 Reviewed-by: Pasha Tatashin --- 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 023f37c60709..08d8246399c3 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -3010,11 +3010,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)