Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp741901lqp; Thu, 21 Mar 2024 14:16:04 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXuB+kAO1p3/iLHjWIxlxnyZTMcXDxnIzujm2gZeVUd1WLBtinZDNHOy+nu/Ex3ARcayx0jSGZ86FM0yExLUPqqqaTPhlYpnZVikM5CTA== X-Google-Smtp-Source: AGHT+IFk42HjyQa2rk7Dq1NeD0/p20F+DF+DS4j3ATOc51ToV9WFDRc/7lPtfVG9+dGBumLEqYIE X-Received: by 2002:a05:622a:286:b0:430:9f6e:e63e with SMTP id z6-20020a05622a028600b004309f6ee63emr401082qtw.24.1711055764607; Thu, 21 Mar 2024 14:16:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711055764; cv=pass; d=google.com; s=arc-20160816; b=ZwkYuEAB3HMbmJIb8WJTCC3/Qu8UNxLX2M1qQL8iI/rAbjBMIZaWutb/n44ZZ+sWbV YK16XqMr2jG9OFHb1B1y1goLSbS7uyo47BYDe006MVt+YwzwNrNWlRNfFbVpAFypMBZF 2hLAUYSkHs70dOR05R28AKwQDJZ6DjbpAvtzAtLP6qIDBkUEq7IC6mT5cNXJHg0iPRgd 1/NfUEXeql4BFWl2QVu2jV7VCSxCg6fEbDnhwDKFS57ERNKwGg65ksq/sydjJXjFy0QS 5Wax03STByG2a4ZPCvDuUM0Vwj7JWEAOrYFhVl11aTBCvhV8SIHkjE6zwea/c1HiuZIE TozQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:dkim-signature:date; bh=Zg+YcWxUSQ4PW9xsrv1Bq8A+bJWYc2oFdFSsmHcvMpk=; fh=Q8iXvLX7AMaL15JHtP679LkEjZAcP9VlW5xkTCDgguY=; b=H9z/op+e9JJm3II74rC9BFlpLzsZLpkYRMxDPSVjCgSFD/md6z9N4pXxVZyIGivl8t HBNL7T9a5dPXM4xHqnByKEh7r1oVinzONnXntcTB0IFmCqvYrRJlQgssm1JZdi9BqaFg yfwhkjYsdXFSoa+9D8JbewQiWtNtkkEM/2kSPO9JWWFwAYwtrF2Ty48eV/JYYiDhbEFc WlNYY56diXKw9hnuoLIj8JeFm72PWlHdlt9YHHkKSObMlOCBtTm6Bu0L6iAgh0y9d5Qr fHfvlLZ6kFfJ4bddmn5axs+QrArReR4A6sk9xfiCWVcYwg/wBoAZeX34qbcnRC4bEfti XeIw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=eH8oK6O3; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-110686-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-110686-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id m22-20020a05622a119600b00430d834d895si596940qtk.615.2024.03.21.14.16.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Mar 2024 14:16:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-110686-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=eH8oK6O3; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-110686-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-110686-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 5988C1C22447 for ; Thu, 21 Mar 2024 21:16:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E9A0213664E; Thu, 21 Mar 2024 21:15:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="eH8oK6O3" Received: from out-184.mta0.migadu.com (out-184.mta0.migadu.com [91.218.175.184]) (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 59C0913443D for ; Thu, 21 Mar 2024 21:15:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.184 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711055755; cv=none; b=hJinFJAgdUkdh+PbGeAZkRrVFqIGmD0HL/NITBdlrzD7RENTpdJjroJOOBozEojeFG/kJqhgQ5/ouqr51z4fsJNqMUOgh566SrSgS2e0nsjiR0aoaC5HivvcsyBsXXZ3mXtIn2HhjTRsMUCaqdoTXxBhNIXPy8eg9tz80G1/tBo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711055755; c=relaxed/simple; bh=ikKSp2NuOvMpHZGFxKTZZGbjYUvlY9q8EBsen/cyAuY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=C4y5zyCFqMqB57jTPYzIQk/6papDpobB07PxAz7jiPx5+3j/nb9Fa5QPuqxkd8sEVYH4b3fXiHuofrQ3xPxaJVul7gXtNv1P0tjHMJdCtAKbpqVXeEs8l3XMjYxz458NqnotB/wjbtPQ5HkoO/b9hoTeYygZqWOxzU+wvAeWEus= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=eH8oK6O3; arc=none smtp.client-ip=91.218.175.184 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Date: Thu, 21 Mar 2024 17:15:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1711055749; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Zg+YcWxUSQ4PW9xsrv1Bq8A+bJWYc2oFdFSsmHcvMpk=; b=eH8oK6O3whN+5xkQZG4KRvkGEfJMaEROLYSVyvOMEmAr0vx034qCIMnxAzZq0oacFIqlx6 /4Zdupvf6beqxj+COUxVFOfr1DlCfPrxyCpAol5RsNR1a/MYKHHQcVdvNOqefJ+OE0+SxY ThPaS33U901JNoVemYhAKPtdu/kPXRU= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Kent Overstreet To: Andrew Morton Cc: Suren Baghdasaryan , 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: References: <20240321163705.3067592-1-surenb@google.com> <20240321163705.3067592-6-surenb@google.com> <20240321133147.6d05af5744f9d4da88234fb4@linux-foundation.org> 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-Disposition: inline In-Reply-To: <20240321133147.6d05af5744f9d4da88234fb4@linux-foundation.org> X-Migadu-Flow: FLOW_OUT On Thu, Mar 21, 2024 at 01:31:47PM -0700, Andrew Morton wrote: > 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? No, this is just what we have to do. But a fair number of these helpers shouldn't exist - jbd2_alloc_inode() is one of those, it looks like it predates kmalloc() being able to use the page allocator for large allocations. > > > --- 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? yeah, we can do that