From mboxrd@z Thu Jan 1 00:00:00 1970 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 A815F18A6DB for ; Sun, 22 Feb 2026 07:05:39 +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=1771743939; cv=none; b=m7i1u2O+3/8T5wHEYd/5KoTNgtKpX+vHsbzqvK+QpmfkMx4lRv3fBMO138ByZxC3wTkGrv8xee7bjr4xoRS3Z9lT5bdEdZlIq0+V8+8DZvJRjsNfULpNiEalpibS8kWPrrQtHMCd+x4gQdkbnKCL6DT+AhD9q6iGXNlH+e1wVuU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771743939; c=relaxed/simple; bh=DN18ITlmqK0VarnQT/wrza5f3ngWp//g44DuhudDZkU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=DQ1s5f0Kmbr70xfZr1oSaFZR72IqWOS0eYEIJ4TyDeJtpSdqADTUx4SfR+Ze6qEfiCSLp4UoQVjkczgdHOQSZ0njVWjI0+xlKzZoYMLRAOjbtl0ZhxAZtyV0S7IIdYdsrsVE7fg7GcLRFO3IuCaS16kr4wGe9sgMtijiEIb6yfA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=WOh6qKR/; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="WOh6qKR/" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 758C3C19424; Sun, 22 Feb 2026 07:05:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1771743939; bh=DN18ITlmqK0VarnQT/wrza5f3ngWp//g44DuhudDZkU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=WOh6qKR/S+ZbSciJrEN7ajedVx1L3B7qONDHSgO0AJPg6g6V0OOYP/xpztNYlJySz 4cD+OUtRM8n6SPjwAO2trqvrdzobkMgr26Fr67Vatl5faqnJTYoGcYTKB5iSseLn+v zurb+nBOMUogkirtrVd3YdTmIs5fhKtRn2/J9/EVhKOh0sWy7x3Be0DKkULTHxb7kc l0b1nux9aZEAHJG6wWw/5l3O+3pTvnj+VI550GzETv3lR4Urp3leJ9qXNtDTqipxIt 2EdDMH73+oNzsAJHdfYcZ5wCV2J+1su65g79pGWYiXvLFsZujtxROSo5dp75byJR+R yJTFgaXmH3RvA== Date: Sat, 21 Feb 2026 23:05:39 -0800 From: Kees Cook To: Linus Torvalds Cc: linux-kernel@vger.kernel.org, Julia Lawall , Eric Biggers Subject: Re: [GIT PULL] kmalloc_obj treewide refactor for v7.0-rc1 Message-ID: <202602212257.95B8298@keescook> References: <202602210108.0EABDA1CDD@keescook> 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: On Sat, Feb 21, 2026 at 08:52:55PM -0800, Linus Torvalds wrote: > So I decided to just do this now, because it's going to cause > unnecessary merge conflict pain if I do it at any other time. Sounds good; thanks for doing this! > I'm adding Julia, because for the line-wrapping case I first tried to > use coccinelle to do it, but spatch failed on me half-way with an > assertion failure in kernel/trace/trace_events_hist.c, which I > couldn't figure out. > > My script was probably to blame, but it boiled down to basically just > > -ALLOC(E, GFP_KERNEL) > +ALLOC(E) You can break up match elements across lines, so you can drop the ", GFP_KERNEL" portion explicitly without needing to capture the rest of the line, and since it's always the last argument, you can use "..." to avoid needing to do any syntactic evaluation of the prior arguments. This seems to catch the remaining: @gfp@ identifier ALLOC = {kmalloc_obj,kmalloc_objs,kmalloc_flex, kzalloc_obj,kzalloc_objs,kzalloc_flex, kvmalloc_obj,kvmalloc_objs,kvmalloc_flex, kvzalloc_obj,kvzalloc_objs,kvzalloc_flex}; @@ ALLOC(... - , GFP_KERNEL ) Which results in: 415 files changed, 612 insertions(+), 833 deletions(-) > And yes, I verified the end result by not just building it, but also > booting it. I'm sorry again about the glitch. As Eric noted about it not being in -next, it's a risk of these tree-wide refactors is their lack of (infeasible) bake time in -next. But maybe there's a way to do it that I didn't see that doesn't cause giant pain for merging it into -next. I will (boot!) test the above output, and send a patch in the morning if you don't beat me to it. :) -Kees -- Kees Cook