From mboxrd@z Thu Jan 1 00:00:00 1970 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 4ABD3CD1292 for ; Thu, 4 Apr 2024 22:42:02 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C75746B0089; Thu, 4 Apr 2024 18:42:01 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BFE476B0099; Thu, 4 Apr 2024 18:42:01 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A9EAD6B009C; Thu, 4 Apr 2024 18:42:01 -0400 (EDT) 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 8C1486B0089 for ; Thu, 4 Apr 2024 18:42:01 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 205D6C0844 for ; Thu, 4 Apr 2024 22:42:01 +0000 (UTC) X-FDA: 81973323642.14.D6BA5F4 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf17.hostedemail.com (Postfix) with ESMTP id EF4E440018 for ; Thu, 4 Apr 2024 22:41:57 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=DJmiDZtT; spf=pass (imf17.hostedemail.com: domain of akpm@linux-foundation.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1712270518; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=y4Gz1vNAZUco0LW3MKH7RdD23LzqKqUv31xci5CqT5g=; b=dUz3RXtTQLYChlaFfKyf6W4mdUaCFqYgmlbGqaW5GSqTjCaPxSgF2CY5SBJUac56vBkcvp xE4YsPAAsnpVHez9YIC1ytyJMM9aPIlQ2MUFdsZNZ3QYtjAz2zlcckfU1tOo2bVWnT82aQ Kmc3xEZ8+jmYSG+EJKpMJnyt1ccn8dY= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1712270518; a=rsa-sha256; cv=none; b=ok4dvIQ/lCXnJtv8YrGtO+dic8XOvGgiUkcn+/ZZB7z19ARetxRGw7eCTxLs1nVxhcJepS ORPuvM6s9eJSoJZwja/l3bSBoXDfDvJoAFrnOz8HjAGtyX3T9yd85iSe9tRTr7Z1ax3Sxb oal2FnJ7GKiNJU8pNTtHylR98NILM+k= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=DJmiDZtT; spf=pass (imf17.hostedemail.com: domain of akpm@linux-foundation.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 2E1CECE346F; Thu, 4 Apr 2024 22:41:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 34B4FC433C7; Thu, 4 Apr 2024 22:41:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1712270512; bh=WxchYk7iOFEaVdROAH9qR3JO5cQ+eY2vs3aB2U8kcyA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=DJmiDZtTAOAbNMoX64viWyqorfYleRZpTdeOScuJfhB7fHrUsgtkQLBS1Nt6GhjYB YmI6GfafpeecNLQVDEJtxQkgxxNJ71KIxeMmVuDxohT+xw006Hk+bvFniIeaTQBWNQ Y1qNJX1d42EjrfNnvlrxW0MEaQUlMewa8JJRd3dQ= Date: Thu, 4 Apr 2024 15:41:50 -0700 From: Andrew Morton To: Kent Overstreet Cc: Matthew Wilcox , Suren Baghdasaryan , joro@8bytes.org, will@kernel.org, trond.myklebust@hammerspace.com, anna@kernel.org, arnd@arndb.de, herbert@gondor.apana.org.au, davem@davemloft.net, jikos@kernel.org, benjamin.tissoires@redhat.com, tytso@mit.edu, jack@suse.com, dennis@kernel.org, tj@kernel.org, cl@linux.com, jakub@cloudflare.com, penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com, vbabka@suse.cz, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, iommu@lists.linux.dev, linux-kernel@vger.kernel.org, linux-nfs@vger.kernel.org, linux-acpi@vger.kernel.org, acpica-devel@lists.linux.dev, linux-arch@vger.kernel.org, linux-crypto@vger.kernel.org, bpf@vger.kernel.org, linux-input@vger.kernel.org, linux-ext4@vger.kernel.org, linux-mm@kvack.org, netdev@vger.kernel.org, linux-security-module@vger.kernel.org Subject: Re: [PATCH 1/1] mm: change inlined allocation helpers to account at the call site Message-Id: <20240404154150.c25ba3a0b98023c8c1eff3a4@linux-foundation.org> In-Reply-To: References: <20240404165404.3805498-1-surenb@google.com> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Stat-Signature: a96bjb3165ruesr89jrczqkmruyopyic X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: EF4E440018 X-Rspam-User: X-HE-Tag: 1712270517-811045 X-HE-Meta: U2FsdGVkX19EEz6PeKQNDAYZOqNMK/UGd6DEMJfou7RURsgOZwYsEc69io41z7c6yrE7RgDt0K/dwP/XYq6rTqB0Y1pJqy3I4T3uw+Ip0cDhwDsuCZggG2BNhjDDs1+PykftoIoxqxqk4x/r+4JQkAv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HexcU/8THeSjcQr+B2hXHeqihJOPsJ6aUU1ZyN/Pjue5nVqT+bYlgFkCLrc/ICOXzfLFRMg== 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: On Thu, 4 Apr 2024 18:38:39 -0400 Kent Overstreet wrote: > On Thu, Apr 04, 2024 at 11:33:22PM +0100, Matthew Wilcox wrote: > > On Thu, Apr 04, 2024 at 03:17:43PM -0700, Suren Baghdasaryan wrote: > > > Ironically, checkpatch generates warnings for these type casts: > > > > > > WARNING: unnecessary cast may hide bugs, see > > > http://c-faq.com/malloc/mallocnocast.html > > > #425: FILE: include/linux/dma-fence-chain.h:90: > > > + ((struct dma_fence_chain *)kmalloc(sizeof(struct dma_fence_chain), > > > GFP_KERNEL)) > > > > > > I guess I can safely ignore them in this case (since we cast to the > > > expected type)? > > > > I find ignoring checkpatch to be a solid move 99% of the time. > > > > I really don't like the codetags. This is so much churn, and it could > > all be avoided by just passing in _RET_IP_ or _THIS_IP_ depending on > > whether we wanted to profile this function or its caller. vmalloc > > has done it this way since 2008 (OK, using __builtin_return_address()) > > and lockdep has used _THIS_IP_ / _RET_IP_ since 2006. > > Except you can't. We've been over this; using that approach for tracing > is one thing, using it for actual accounting isn't workable. I missed that. There have been many emails. Please remind us of the reasoning here.