Received: by 2002:ab2:6486:0:b0:1ef:eae8:a797 with SMTP id de6csp401219lqb; Sat, 16 Mar 2024 08:41:25 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVVEi7/JD6VnKMEH9nJaXBk06mWXkGQ6cbNqyLmZYi3halDKJRGHsv6shXduKfbUvY1z9IxUF+z1+PORhHRGan/rUK3W8PocYxT0IScTQ== X-Google-Smtp-Source: AGHT+IFpA4BrC1bJcQKkucbclDD+Mn9LoLgpoYI74KJflde87dJJX9/ZcDAmr/NRDqUHMwJPWqkf X-Received: by 2002:a05:620a:1a83:b0:789:f11d:66e2 with SMTP id bl3-20020a05620a1a8300b00789f11d66e2mr1219365qkb.13.1710603685418; Sat, 16 Mar 2024 08:41:25 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710603685; cv=pass; d=google.com; s=arc-20160816; b=ws1uCrkrZxKPUZFgh7KXdb9RhX1+2s0ixNK+NAvDffV/R4MXTcB0DDc6mSQ0MOublz q4PLdf6SNpF6vD654+pJmhdIdFB0k4a2Pjlid2rNq7kXC6TSO+Ql4AblLUlKs5bu6R7L eK3PhIBsZtjY3tjn68LK29UoEr5OTqYw9iufT+kacri0EMx62xGvPFnqCdOsrVaTQ+4f 9kymei0JBoHq7Lytv8+VbklQoPomKTlXjBn01mte3d4KSb/XL1v3LsrFBx0JZ9YmrGCA vUHXnQdBfph+qiJrCo/DXFGsKjKivuZx97iCXpdeQBtosGIKZKUnADDnL6dEM8PsZwBY a7Mw== 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:date:dkim-signature; bh=r08nE6M+052czd6TDRRSKiJ72BtB1MGicKvM+Jhq7Do=; fh=65o4YyQjBKkyWXqw94spp66sMcbvfwtzmxy1f3aiyMg=; b=XlYT7E8w2wvQ7sw3TC24sBgn79V/wgsaJ9/b/iOLgPUOnsMKUCChpbJ9LoWUdEBypK d94ONTMDR9et3ELwM9usntgPN9a4vIEFC1O0gnDeIQfyQa4vJmtuzxtVIoaQulzTQAnL Addi2sQMFX2aI/0iZBpbQUI0lUobKyIkzBzuuyAJCL+Zm0F7EAYvBuLsFx8LBIkSwB4M T5YTDjdJaXlDcqvmrDzASBhN8fp4crUwWBjT01v1oP9o4BhWQHGj/w+/w3bQXJK1inA6 UwHVW6QjAHVvtN0AR5s+umqlkIRX1eFCowrTi4VenqociyCjRqF5mg4T6OLZ1QblatWq O1ag==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@resnulli-us.20230601.gappssmtp.com header.s=20230601 header.b="MG/SJNiB"; arc=pass (i=1 dkim=pass dkdomain=resnulli-us.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-105213-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-105213-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id k6-20020a05620a414600b00789eb0ef1dbsi2159966qko.17.2024.03.16.08.41.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Mar 2024 08:41:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-105213-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@resnulli-us.20230601.gappssmtp.com header.s=20230601 header.b="MG/SJNiB"; arc=pass (i=1 dkim=pass dkdomain=resnulli-us.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-105213-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-105213-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 2924D1C20E9A for ; Sat, 16 Mar 2024 15:41:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CEBA71B970; Sat, 16 Mar 2024 15:41:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=resnulli-us.20230601.gappssmtp.com header.i=@resnulli-us.20230601.gappssmtp.com header.b="MG/SJNiB" Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) (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 69AF81B80F for ; Sat, 16 Mar 2024 15:41:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710603677; cv=none; b=c0RqeczdfgpM6qcQItXbwzCLP9hnohXEY4SfzouWmlv6aUirnJg3pfuC9/koNC7SDkBe6RuSSqVXCeFEOM+lUwh+oGz0saDUWmnNbIosvQ9wVMcAWQsJz5XH6Zk7KsXs8xQjIvTx+wxiwflCya+R0YPIJk0m/MIWWIx0pY/a45o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710603677; c=relaxed/simple; bh=DVKnrx4LTWg3PJvGZiH9RqXWaCCjAmllk8cytlWNXq4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=GIf5pJFPeZ5I9BfD7lMBCsZNpXMseRAE5N7csDAcckEI7+0SxWXQHCAAbjq+wB08tJ8o3bj0pGY6cL4vLFLCg3T9JMU7LMznkZQJftMcQxSuoNOEUWBPsCaEHdjYzSYK67kfVGOXeqhIvnpYf5YxOk+i5FJCxgLKABN52U9QtPU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=resnulli.us; spf=none smtp.mailfrom=resnulli.us; dkim=pass (2048-bit key) header.d=resnulli-us.20230601.gappssmtp.com header.i=@resnulli-us.20230601.gappssmtp.com header.b=MG/SJNiB; arc=none smtp.client-ip=209.85.128.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=resnulli.us Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=resnulli.us Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-41409fd8b6eso1966075e9.2 for ; Sat, 16 Mar 2024 08:41:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=resnulli-us.20230601.gappssmtp.com; s=20230601; t=1710603673; x=1711208473; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=r08nE6M+052czd6TDRRSKiJ72BtB1MGicKvM+Jhq7Do=; b=MG/SJNiBQXstzPfIOb9A8hDhaab9s+7iSDafv2grb0IrG+b23BjqJ/SAUyjAmh+6qc gXuZS3RJ7/jIcyPeQbbnsx2mcF3L4tWDaPvXDeqwXVfyQvRarPPz7XFcDirY5RZhTHwP AsvRmRXApVGk/4O8gn/7ypnyo8ZQoe/12AqNsQ84V0ml/RM5BOid3juV6DgNpVhQrJuF kdSq4qCNHvfOIW6hQ+G3FEIHgznK7Cr2+XRvTNbx2fWB0Qvyfwie6E9ROytNlHTLWpDy 1kuQEG17xrxtVBDMrQ1uTvWa//R+FH8MrCFrppTtg7SnmtRlwKL9jDjYH5u3GRfnPIMK 0pjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710603673; x=1711208473; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=r08nE6M+052czd6TDRRSKiJ72BtB1MGicKvM+Jhq7Do=; b=PprKm6qYS6vIU+Zb4IoOSTS8Xrdgy5HbxmZihVU9OOFGkB+kTXp0ZlSfyqn/qn3na2 pbL3eDWzox8zatsCds+yRHw2l3SPPvT3PgROUUHYzjEYVI6PYK83LTPa5ciOCNZbczhX LQ0fl/zoZskUOiO7uWCDXukzKRXlwnPeVM7JFuxIdJWrboCYMvPx+SXd4MHQzs49+NfX NQD/vh0Bwo6MOzJwytCy36gt+lgXEZc5SPk4pJCEg6/TV5K26zUyVUAt58+nXIWPS/yi TtPp/cxrAkOoWhxYs6FV2ZIQQC+DWTtgatW1k+EEvfmAdHQE26iFrfmjhd9b2ENHDKJ2 ctLA== X-Gm-Message-State: AOJu0YxGhDlfsKvNeMBj/4ucNiWUBcpsX6+D5haQ/dhvdqFzKK9cLT+9 0xdxVmi4i8jrhCnxXPTLVj8Dyc6p4sjoVWWh2NmfyhAg1vAEQxOPRu8wDzrwN5U= X-Received: by 2002:a05:600c:45c8:b0:413:1212:3eed with SMTP id s8-20020a05600c45c800b0041312123eedmr1818806wmo.3.1710603673172; Sat, 16 Mar 2024 08:41:13 -0700 (PDT) Received: from localhost ([193.47.165.251]) by smtp.gmail.com with ESMTPSA id g6-20020a05600c4ec600b004140726eac3sm2366569wmq.6.2024.03.16.08.41.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Mar 2024 08:41:12 -0700 (PDT) Date: Sat, 16 Mar 2024 16:41:09 +0100 From: Jiri Pirko To: David Rientjes Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, cl@linux.com, penberg@kernel.org, iamjoonsoo.kim@lge.com, akpm@linux-foundation.org, vbabka@suse.cz, roman.gushchin@linux.dev, 42.hyeyoo@gmail.com, peterz@infradead.org, mingo@kernel.org, danielj@nvidia.com Subject: Re: [patch RFC] mm/slab: introduce KZALLOC_FREE() cleanup-ed allocation macro Message-ID: References: <20240315132249.2515468-1-jiri@resnulli.us> <171412ef-1a93-3e56-2b7b-3baf83233eb2@google.com> 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: <171412ef-1a93-3e56-2b7b-3baf83233eb2@google.com> Fri, Mar 15, 2024 at 10:39:02PM CET, rientjes@google.com wrote: >On Fri, 15 Mar 2024, Jiri Pirko wrote: > >> From: Jiri Pirko >> >> With introduction of __free() macro using cleanup infrastructure, it >> will very likely become quite common to see following pattern: >> type *var __free(kfree) = kzalloc(sizeof(*var), GFP_KERNEL); >> >> To follow the CLASS() flow from cleanup.h, introduce a simple macro >> KZALLOC_FREE() to wrap this over and allow the same flow. >> >> Show an example usage in gpio-sim driver. >> > >Seems highly specialized especially for kzalloc specifically, so not sure >this warrants its own macro. Yeah, but having like 2-3 macro variants would probably cover vast majority of usecases now. The rest could still do things manually.