Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp722373lqp; Thu, 21 Mar 2024 13:32:11 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUPcEahDH+AA6b6U6OaJOon1oIwgHFff4QdqDZu1WA+ORhopjF0GeetTRzWcgK6RRYzIIJ/MClyGu6EjxrjWVB5vyzPXAjKQ6zNCz9Eag== X-Google-Smtp-Source: AGHT+IEGXxyfJsJm2FwD8yEBaum5T5zvl2nLhilzFPv4KmFDMv9YjFbvtxy+SP9DZvr8knMIL6oh X-Received: by 2002:ac2:446d:0:b0:513:cb93:cd9a with SMTP id y13-20020ac2446d000000b00513cb93cd9amr244464lfl.18.1711053131180; Thu, 21 Mar 2024 13:32:11 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711053131; cv=pass; d=google.com; s=arc-20160816; b=naHBYedfrXkxzC3LLtJgZxesANVEJmO3Bk5nL9Wxi4simewszUi0CFox2jYCCO54f9 EbxjdL1wK/B6DDzKZJfIt+4TquGHUFaUDF3gIP26i05BXDLWr59g+eX9Ph8WZ0F5fKQR h7eH+nudLPoTca7VzYkoGiclQKJPbv0+VyM/UPGglvnFGTqKlZaU0odwcvsKlWI5YwEs Js5ou0NxX4njZchCvEFkdpRqIuDNlumeNwZAS03cOCmKcPVQVxKnMBJ1zhuDHaxQ9JGp mbzL1tC1YOLua4NBF8PkjOeqdsSd2Cqo53WlYWgfVf2GksD36K/IvXla3I6+WWaV3A3G d8rw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=5bivwr0w6V4Aq5kxqPnIVYurFU/PCEOCVDjr9lQ9raQ=; fh=k43ZFzTGpw3h4AfHH7vRtExqnNiSeKNDN9LVZdLMZ6U=; b=jvpaivb5jX+KEXGfnRWMGC2Reuuzh9XVATg0OuuTtdMYEQq8RCvKj2KKFY5Gucyu4B exHyqj0BM7PLgvo5oYTghOkxyXutc5K6fuFc0Dw8+39oBt2TlQm62nS4ye/2eKH3QFr1 xKm+3lX5osT9MFl4V1mLLFmeV4D+FL5LWaQprMqzVLnWaC6BLBUWAfv3H5AKWvoLrOBS /MwONX0p3W89aoADX5ZmHCdFJp2JQDbpmrVb+pyO+EKV6G5GEP1c4RBUcv71y73amARZ 85Dm8Z5bRKONG4G1p35KX84/6f4J9Kyup0QPiCrJPAEacNVjG/NK8TDxF26yen0itG/B YBYQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=myqqqaYb; arc=pass (i=1 dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-kernel+bounces-110647-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-110647-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id ji8-20020a170907980800b00a461f6da4ebsi270314ejc.271.2024.03.21.13.32.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Mar 2024 13:32:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-110647-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=myqqqaYb; arc=pass (i=1 dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-kernel+bounces-110647-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-110647-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 82E671F21DE3 for ; Thu, 21 Mar 2024 20:32:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C6CE71353F2; Thu, 21 Mar 2024 20:31:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="myqqqaYb" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8A00E5680; Thu, 21 Mar 2024 20:31:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711053111; cv=none; b=U8f0onOFfhAERUKKryZoe7bfx9AAEsYqbeRp9UhkdEtPE5JYse6Ee8sn15F08GlQ1ZnnZ/iFDFY9McLbcQa91UpvvSRdHNrSB2WNDU6SFFXjGge6x3Y2yzY5o/DQs/nly50FYYYwqzw4oHHx0cdEf6fZJe+7PXWLERSOu/uzdPY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711053111; c=relaxed/simple; bh=baRa6A2qOinOd5YVAtWej5lfyO2Yw47YmlHbzlE1Jvg=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=OE+semlzvoEKhY1+ZzXqxt61kWAta5CLgzXWUp+ilDqSxYI7VV0Ph2ix9CoWZfcqW2kCbGRn7dS9UOtC3oi5eUO1q5uskRm4BbLtWW+Tj97ajKqTsszNZDCtkpG0pNDWJtf7DX8Z/WrShhh+73u78YkN0+T2fHOxMItE6xc0lZI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=myqqqaYb; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id C826DC433C7; Thu, 21 Mar 2024 20:31:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1711053110; bh=baRa6A2qOinOd5YVAtWej5lfyO2Yw47YmlHbzlE1Jvg=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=myqqqaYbliRJE7PVgZhrPNW4VsZSILLB+0SlZqyShzqltI9nE6pTdWnygoFZn4dbb cd7SNGeTgLc7GfmU2xwl33gTqeb9pkt91tBji4fk8llEMAbUkAQtFXJU5/LCiWBvgC EtAkHaVZ9tqLwxhvUHQb1iYeHrpwdBWq8Zx/XJf4= Date: Thu, 21 Mar 2024 13:31:47 -0700 From: Andrew Morton To: Suren Baghdasaryan 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, jhubbard@nvidia.com, 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, songmuchun@bytedance.com, jbaron@akamai.com, aliceryhl@google.com, rientjes@google.com, minchan@google.com, kaleshsingh@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 Subject: Re: [PATCH v6 05/37] fs: Convert alloc_inode_sb() to a macro Message-Id: <20240321133147.6d05af5744f9d4da88234fb4@linux-foundation.org> In-Reply-To: <20240321163705.3067592-6-surenb@google.com> References: <20240321163705.3067592-1-surenb@google.com> <20240321163705.3067592-6-surenb@google.com> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Thu, 21 Mar 2024 09:36:27 -0700 Suren Baghdasaryan wrote: > 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. I'd have thought that there would be many similar inlines-which-allocate-memory. Such as, I dunno, jbd2_alloc_inode(). Do we have to go converting things to macros as people report misleading or less useful results, or is there some more general solution to this? > --- a/include/linux/fs.h > +++ b/include/linux/fs.h > @@ -3083,11 +3083,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) Parenthesizing __sb seems sensible here?