Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp741180lqp; Thu, 21 Mar 2024 14:14:31 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWY+1NRrPVwyJwSXY6+qGeceVWPAZ2pElwtfoP72JFglhsQFu+KWci7N+3p03LpadIgHWEFwoPK+Py4jRZxz2VZ5ObK1lYfQjfdc/VMmw== X-Google-Smtp-Source: AGHT+IEmaVmbb2dy4obmBkanvvX/a6aK69rgvwsuoxsccbwn4Rr9yk5VZgiUkePyxX5imNFdmMV1 X-Received: by 2002:a05:6a20:2e0b:b0:1a3:719c:196 with SMTP id be11-20020a056a202e0b00b001a3719c0196mr666204pzb.20.1711055671354; Thu, 21 Mar 2024 14:14:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711055671; cv=pass; d=google.com; s=arc-20160816; b=OSXHeODg9yu01OKk4F4+jiQEqa0k/tamvvayMzyIajk+y7oFm/2yaARJ39O5zsnLNY cm8blLxQHtL5EgArL3N1KTSEtfGALpE/St6ikMcWU7RM03O+0b23ZNkoDioi+407888Z FVTf2yVRZ7t+h3dU8N9kN/x/aVqd5zTsllRyneuVJvjVz/Yb0ZZWnXXowOtbwTrVmwkb L6f3vTBCiDWv/Eb56MlHN5lUpKwlLkrKg8c2/Uk0oSEMQONERlE6OJVlUOjlS0FCCtAD QaoutVv5qOxup0+tK1Pat49IwZjOAZYcuU1wIo9R0aPKaR/kb/35NFcMZLQsm0pS+yzn AYdw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=ebQxy1c2E58rfYFrtDF0LlwrADqhUaZL+Ah6PQaZrV4=; fh=jujGXdFiwCb5EGpxzjS8fFtuJVneYrUfD5oVXg6UCdI=; b=JlGaUJNpreVkja2v9QxQYGMyBSfRHOT7BIeY6OsxhMWn8FxXV35Qn5+JguIcqi9W3d 3m3XqAfkSak8pNrWj9J5K57Cupi4da6UWMn38PGXrFDDImhkkyGcEy21kXei5LdjkziR vPFATBFOzavSm4U2bWtyRtUfobSjaE6A4wlDvQIBzto1JCiN7ATKgWY20V8VGzwWVPty 49vOt7LNHDanbk4LdulnotiTjJxXJ2997ATUN+/3PUfUGLFHWx4g2T8lVpRgeNDfa0px daBAMcQjxakmu0w4iMcpO99d1vQZhprjEDNrU+5fWNoUW6RhKe+uDdRhDe50GGm4R9Mj r7GQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=pL1V3BNr; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-110685-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-110685-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id g26-20020a63521a000000b005dcbb9ab5b7si518925pgb.277.2024.03.21.14.14.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Mar 2024 14:14:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-110685-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=pL1V3BNr; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-110685-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-110685-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id E1506283429 for ; Thu, 21 Mar 2024 21:14:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 29E3213774F; Thu, 21 Mar 2024 21:13:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="pL1V3BNr" Received: from mail-yw1-f179.google.com (mail-yw1-f179.google.com [209.85.128.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CC4221369B2 for ; Thu, 21 Mar 2024 21:13:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711055598; cv=none; b=Vu9mSi/wOwvxEceXR7TEADgKQSGZlcVWu2hHjUN+l/qRsV5iaSCcvhXp3TEnc1fguAFjAvt5S2QagihWECyWUjUgHJ18ExxApogMKiTADzDldgnRWUa/7t/GPjOVlM8aaYAXRtCRqPCqObbNIz9KwL5BCPLtojOnP5nZHd6Kj2I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711055598; c=relaxed/simple; bh=QdWLuurPKKnAKd/0efIBlHX1KMwle2RKzlVXv6YtTy4=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=cVB/joNuyVPyX46FvCjuM2JEImZx8UWRMCp2l2q24PLOAc91jBT/lLWlYXg3g0vNflIhiiC5UYAcydQIKrUdTEFfhpvkzNw6QBuyhDrH8GoqUELEGRNYKDYWZClCzBRDgOIG9XAHdIZoe8L7Q2xOZNjU6MtXVz85S+zGcZTh93A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=pL1V3BNr; arc=none smtp.client-ip=209.85.128.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-yw1-f179.google.com with SMTP id 00721157ae682-60a0579a955so17262617b3.3 for ; Thu, 21 Mar 2024 14:13:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1711055595; x=1711660395; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=ebQxy1c2E58rfYFrtDF0LlwrADqhUaZL+Ah6PQaZrV4=; b=pL1V3BNroI1V+L0QVJtIF2Bfjxr9u0dSM7FcbmtcSrpqf8cfuKeIV6bglX3Zapnm4Q lW74BtRppnFUHzxeT+5zkNdcUymSOJwC6PJyUlISyZAmiTOVNcQHrl5bjQmLke0jshL1 NoaQWgozgUIQKha6dpdZ7wLH1e3jUE1eGUBvvmjb8xf1hF+7Oy9NY0D0WqoNKwlbp/VX 6WAstCHbwWZ9PX8I92qnHu+6mLPu3GOt2TbuZf5ASnUY8jDx1iYIiyLJJbVGDDDfMO9R SqxgQ5eQzWaKNUGvvJElpFJYTzu21KbktvnRr5gy36fzXVTf6Xmz6rgFuQFcDbZ7UXWI Qt0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711055595; x=1711660395; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ebQxy1c2E58rfYFrtDF0LlwrADqhUaZL+Ah6PQaZrV4=; b=C+j9A5Gvfe6Hu/5SzWSv68QPImkfr2b6crwOJkiVvyjltzIgUW5QA2p3TuLWkdocf7 oO34mmS8nrij6Wo6Vf9JKvTpJhSioAMJKRTcOwNZm5TSq6Q+KejYE/RVPEUbM9LClAYX s3gmiBDjxGOKo9IcJ9q2v0VO1pL52TF9/h2tg79iStHFNkMVD6+s42vPYiFA8Fti/x+5 lV63t4qdWcaHigs24AIGGilRzKL7wkGbtEwAePt7lDY1F3gOBRLdi7/s31tOUmlfitxe ITpFdJW3Vx6La7b2uJYjG99fWeDSZgFd2ZrArScm2C1Vs/JPXv+Q9j0LjgoUBHutT7ND 5hxQ== X-Forwarded-Encrypted: i=1; AJvYcCVZleaV5ZorcJk294pE7WLt1U4ueEussy6fhiZGnakSLD3/JiAE20U8RC5kfM3m5jkaQBYCMIgtAUbmPIdroIF1knaRhrWzGT5htc1e X-Gm-Message-State: AOJu0YylKpOPLr4J8w8Etuy0vtYHuB65+00srEKDt7nhq427RgxVSx+e nSLC7rjFhyZFP2zSNDflCUQjOdkrzZq9Gb08axk6PIzye89YsE/ag65lK91WWWCthf6iAzWU93Q 86IdKW7OWdCYVB72A75Blix2xa67f1qIpZFpN X-Received: by 2002:a25:f40f:0:b0:dc7:4367:2527 with SMTP id q15-20020a25f40f000000b00dc743672527mr366083ybd.49.1711055594451; Thu, 21 Mar 2024 14:13:14 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240321163705.3067592-1-surenb@google.com> <20240321163705.3067592-6-surenb@google.com> <20240321133147.6d05af5744f9d4da88234fb4@linux-foundation.org> In-Reply-To: <20240321133147.6d05af5744f9d4da88234fb4@linux-foundation.org> From: Suren Baghdasaryan Date: Thu, 21 Mar 2024 14:13:03 -0700 Message-ID: Subject: Re: [PATCH v6 05/37] fs: Convert alloc_inode_sb() to a macro To: Andrew Morton 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Mar 21, 2024 at 1:31=E2=80=AFPM 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? Yeah, that's unfortunately inevitable. Even if we had compiler support we would have to add annotations for such inlined functions. For the given example of jbd2_alloc_inode() it's not so bad since it's used only from one location but in general yes, that's something we will have to improve as we find more such cases. > > > --- a/include/linux/fs.h > > +++ b/include/linux/fs.h > > @@ -3083,11 +3083,7 @@ int setattr_should_drop_sgid(struct mnt_idmap *i= dmap, > > * 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? Ack. Let's wait for more comments and then I'll post fixes. Thanks!