Received: by 2002:ab2:7a55:0:b0:1f4:4a7d:290d with SMTP id u21csp351384lqp; Thu, 4 Apr 2024 15:38:59 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU1XJt3QxUY5QNdEZi06KCXksydDstqc4hR0khRzr4Jspz0NXTQbgFoCwGZnian61wRN6NMvnIXbm4U0Ybz6Qc8Ague0egVWYeyvo8hFw== X-Google-Smtp-Source: AGHT+IGEuTSQXsHwUHSMyZWSEudtSAgetN91NZSEiyoB7RARlhqY1luBzgMXUh03sQJV8ykJkz+f X-Received: by 2002:a05:6512:39d2:b0:516:d241:11f0 with SMTP id k18-20020a05651239d200b00516d24111f0mr1238578lfu.7.1712270339453; Thu, 04 Apr 2024 15:38:59 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712270339; cv=pass; d=google.com; s=arc-20160816; b=zh0UF5QitFxQoE1e9VUtRZkCE/VIDUXm+6yy8raC2XdJ73tIqNMTL8eBUcsnfqjlAn A2Z9axbaxpOLl76Zo85ryczVoL+dwZSql/nXlDpJp7U9RFDeh5fK06Ng9ojXSjGc6Suv HC0KCFFksS0rm/OptT2Wfi06MTxaDhmx4GJTDRGLMQPx0gyuZXLtitF7y0ss/IFEE8z4 VxKOrz8/iXL1GUAjzaOfQddlTAZvpgWM0khF5JLj9wH9BRf4o4o/xAK2tTbZkDWe1MWv jDOlRUIcOoGb6p7y2Jjd6EU40exBXzzkrLzqSU6/3LDeP0nMopeB5y0bpLSRKV8TKLCf 91Cg== 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=IqILBVwfm/nA4Dp8fGsnDYqiRoHSDvITblhlFgVtQ+U=; fh=ctVrRBNe885cN8Ja7W8K0j18C2hSxirp8sDSPjvyXR0=; b=JtE8+5lfYPH+9NAOrnWe4a5k5fO+6fF7MaNyLaUwsVh9Ep2mSzk9sDe9yOft8fHJjy iemXV3ss/rTnN5qR39LfbWoSwUlZHMOo1hkirj6iP8sdVYMv8XYkPIvLKlO4fTdLuX/K gZ8hN7nxZyijsTVQT6Q5cUxLbZ95u1qUNzTZKlwDj8DfbW761Gc3amfsOE8XMwwEA4P2 ZPsEgklSG0v6Omq4zZ+VLhykFqt5uBI7XXCICpwPMoQXWAn0M+tiYG+udm8Oz08Y+xTq UvGH1sKyl8nYiGaG2OaamChXFInKZ7Jb5Bu7FVBIyWh5IwMD80kJHmoMDeFdP4nNMB+N 6wbA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=SAUxTGyw; 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-crypto+bounces-3343-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-crypto+bounces-3343-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id l10-20020a1709066b8a00b00a4e358d80adsi78038ejr.657.2024.04.04.15.38.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Apr 2024 15:38:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto+bounces-3343-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.dev header.s=key1 header.b=SAUxTGyw; 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-crypto+bounces-3343-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-crypto+bounces-3343-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 am.mirrors.kernel.org (Postfix) with ESMTPS id BB5D41F27012 for ; Thu, 4 Apr 2024 22:38:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EEB016FE16; Thu, 4 Apr 2024 22:38:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="SAUxTGyw" X-Original-To: linux-crypto@vger.kernel.org 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 DC0696F077 for ; Thu, 4 Apr 2024 22:38:46 +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=1712270328; cv=none; b=i41x71HVXiOwfRaD1/nwFISTQVtnHn3911coYumC2htD8WtH/62yblwbb7JJJmUspvHoqW0cCjbPFPCxWMq7q0Eize/eiVlpFw+2uWnW0oyl9RJWscn2d794mBK26tNgvhGwPw7SrrjBkO2GGdx9GbyNYTIMivsC0RbH+EFhVWg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712270328; c=relaxed/simple; bh=5V6KdJOeWNM6RltGMxp3KI42sNBK0iidSHrpwfSYyXc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=FpNAMhOi9JY3APBStQU7cTEt+xEuoQQIjAunHASNRcLHnGEES0enKr8ty+ZKITc1Z+8HJ1yvI6+ICEaciRlLahkUmSqx3mxNakLDu5TCf3F3PUVu6/0gZNiv+r4r3QPkZnKYTBSNuQpO827K8/ad9Crfoggk/sKuYVQ/8WgVluE= 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=SAUxTGyw; 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, 4 Apr 2024 18:38:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1712270325; 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=IqILBVwfm/nA4Dp8fGsnDYqiRoHSDvITblhlFgVtQ+U=; b=SAUxTGywnGO9lMg36Yb2FwCo9q4MLPvWVKliB8A6cH5w/sjrb/WdTd6Umo4zcLkMSBRK1Q BE0UEDKEnFkNBgE9qd83+0tLNc30wXqJ2yWdjs62ognxJed0Ch4bu2Pl0Pyyj1mKJMqNpR JfY1MW4y033OYjfXMya1y+rxPLYogzs= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Kent Overstreet To: Matthew Wilcox Cc: Suren Baghdasaryan , akpm@linux-foundation.org, 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: References: <20240404165404.3805498-1-surenb@google.com> 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-Disposition: inline In-Reply-To: X-Migadu-Flow: FLOW_OUT 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.