Received: by 2002:ab2:7a55:0:b0:1f4:4a7d:290d with SMTP id u21csp352636lqp; Thu, 4 Apr 2024 15:42:02 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXC9kG4JVt6Mgio0g8/dgwxLRRNIHaz60rYu6DcKOTgZAX0OuR2MlT89ca1YJsY2XH6cuEvCxLT9vJ6QjHsTEekJUZfkkUY1Rh7o09kqg== X-Google-Smtp-Source: AGHT+IEU6jVf5uQc6aQBssRKWJjwbvK8y9wlCcBCUIaSF4Hq0+PMaeLRiqwqfILZ9drtqfgjYawA X-Received: by 2002:a17:906:808:b0:a51:7d8f:7ec1 with SMTP id e8-20020a170906080800b00a517d8f7ec1mr684966ejd.11.1712270522664; Thu, 04 Apr 2024 15:42:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712270522; cv=pass; d=google.com; s=arc-20160816; b=z24F21zdoOhc8SR6LnP5Bz7Liu0Mt0I8EsQL0iH9WuNG1CpDoOP1SpAOOWGsbaPze1 LrIgMI8pQ0w3+uZC8Wmg4SBBn1A3f2c2YTEL895XuBJ+iKD/8IZJOIzlH53utaBKuziU O936VfDW/iFXrLR5c51PJcYoYLlhzzDTxUe8CpLkrZ4Db9JcTXsqRe2iwxSVq1sbsXQV mZLgKi8lkneRKbYTWqf6YIUwAKivr2FNutRIU7POPA0joeFuLazredKedfr4pYZZ9ONZ V7k+2yGkVRW9VMB/ayiSv7Fga2Do3QdhyJuRwTBz3hInepd2mivDpV9sArJZDxStFO8r 7QbQ== 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=y4Gz1vNAZUco0LW3MKH7RdD23LzqKqUv31xci5CqT5g=; fh=W4YKdaThJXQ4rCiMTB0hwHR58nAXb4eRCiSM9xFweXM=; b=Z3GO7WJFAWWTpgb9fUrYBJes8W/gqE0eSDoh2X92te5dU3mhsrWwoeIkrVLzHdR4Z6 lRAnP7Fv215BbJZ8CAuiD8/NDW+YGT+4zwM9NHx/R7azfoY1/73qlaq1ob0UitO9jZFj Hwhsm41gH0JacQ0N3Gt2ymLIKFbQ3lgAnkoNhx//bPDgP4h69uVv96F7KQ+5jNTr4bL/ ah2y8cS7CNiSQLJztd5eB7wXwkaWUkkOYrfh4L/tAMMpWRfa9v/DU0qn8JJLIXQxdabh 5V5AxCjoNcUZBkCPquWdSX21euITaJYMldzqELkhyR0Yz1M+VgZqbmuf95nR15s1Yze0 3Quw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=DJmiDZtT; arc=pass (i=1 dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-crypto+bounces-3345-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-crypto+bounces-3345-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id he7-20020a1709073d8700b00a474d24d9easi85364ejc.825.2024.04.04.15.42.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Apr 2024 15:42:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto+bounces-3345-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=DJmiDZtT; arc=pass (i=1 dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-crypto+bounces-3345-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-crypto+bounces-3345-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 447221F26C29 for ; Thu, 4 Apr 2024 22:42:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7C26870CCC; Thu, 4 Apr 2024 22:41:53 +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="DJmiDZtT" X-Original-To: linux-crypto@vger.kernel.org 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 E257E286A6; Thu, 4 Apr 2024 22:41:52 +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=1712270513; cv=none; b=s70UriHC+tGo7PIC586+kMUQL7x4AAv/HKT6zV28UxfLBTPC0d4/ltp6CxtB/DaHUfzv+QDJAcT+2P8wK2JCTBzmVU/rKAgAgm6zt1CJLY+3aUrd0bC6h0ve3TwALW1Silz/v4Gd66Gj5Tvk/QiGQ9G8r9AEryUmsE3x4x0k1zg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712270513; c=relaxed/simple; bh=WxchYk7iOFEaVdROAH9qR3JO5cQ+eY2vs3aB2U8kcyA=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=JXs0qybqjq4/MGcoM3pGmsCT2/cN/2cuIv16ZVj+4uCTUQsZB/oeLfEl2bXoxyVTyARjG+6YbJLEK5bAvuGEndd9KiA+oy5Fb8aYhVrIwv+Z7lWEwI7LfTRALN2OSC4lDuUy3IF1anKsrT/mNAcr12eeoBY0O9B17gcv6WwQjPg= 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=DJmiDZtT; arc=none smtp.client-ip=10.30.226.201 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) Precedence: bulk X-Mailing-List: linux-crypto@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, 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.