Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp2039320rbb; Tue, 27 Feb 2024 08:49:16 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWbAfFXLHdeX8cjnuPPjW/9rVRHnZs5gXHSSR6RypuL93ZNmv9uWabb1eBYHTaEwF9Q71Y47aHM+HO6VpxYTIaVJiktgIpXAiweV2yBpw== X-Google-Smtp-Source: AGHT+IHQ49sQTDtC4BsoBUc+d/QzHiKnookEU3AJeexTL/txXyvu6g1chwj46m2//z9dmckfqY3r X-Received: by 2002:a17:90a:e145:b0:299:6848:28c1 with SMTP id ez5-20020a17090ae14500b00299684828c1mr8524181pjb.26.1709052556024; Tue, 27 Feb 2024 08:49:16 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709052556; cv=pass; d=google.com; s=arc-20160816; b=fAUscSA54OzcEBxkKPb0tq6Gfh4nQHqTndf5uS9Var5cec1mF90vRwyEBjIw1duzwv z7mayGdpgFMWloLZKpK7eBNH4nGN/5JxYUBjdlBpLDa4N0EN6zNTzRcYQ34ca4AbGHrW 2J6v2zHtgU89EPyg5iClL9yKBIYvrqPvFwa7lEZyRJLPUQH64msHq83ZV8s8lG6wWo5j CV9cD2Id3fKUAFosTJfqtAez3vzhY94omBq3DpJ7ARbaQr1DeoIkCPs31zcoZ87poXsy /kD2Fe1tmexf2vYXGjS4LB3OtR0AFVs/SId8uoJl8JLZJV6YV6opH5nrGZgyZt1O5oGv SVIA== 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:user-agent:message-id:date:cc:to :from:subject:dkim-signature; bh=WIiS/t+fS3T73wRU+1sDG/kUyC87RhIB20xz7id1B2k=; fh=aHzArWb8dHUYJNewtjN74//flmRNijOcrZtWe5Pz3m0=; b=cEVrwZj8nokVgKWa3kFRocp8TQTaSYnvUqThOxJ3GwhMxKttJrbvx8NFa1o9XeHfuK QNfU3ThhOoKo3xUdUNiC8lDjQYR+A4MKyvyGRrqMsL1xsk0nlJ1IbsLwQokWnSb63A6l Vk05agd4IbD4/NZfciSoayrPP8BSgQ0uWFnEsfZ12rG9Smpjfkd6D8HYe+PEZf5UyxkF pthHEHUMkQzKHHuPlPy7hZX4+NgFyrZdNtQdjppryq8ZF+tqbeEXrQaxL7ht7IDCLcAM oGWJl5B0o3BgrSMJcyBx60CnwkQiNnNgHc+jUQPpVVi8l1iMq2sQ98bBMA1YaPnGcqt0 TWgA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=VAt5aIZU; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-83647-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-83647-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id t6-20020a17090a4e4600b00296a59e7eb1si7618217pjl.6.2024.02.27.08.49.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 08:49:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-83647-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=VAt5aIZU; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-83647-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-83647-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 82465282856 for ; Tue, 27 Feb 2024 16:49:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 44CFA2C688; Tue, 27 Feb 2024 16:48:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="VAt5aIZU" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.11]) (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 7C1202C69D; Tue, 27 Feb 2024 16:48:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.11 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709052531; cv=none; b=NxexG2HgZKgTvYhLIy/S59IppVrzfXvRKni1mUO0ZUP/l/wzAqmrrWob4/fPuF7exE9aVnqf8YI+HeI6fUYoRhwMS+oLprdgukMYrpZRlOan7ZqGl8o/nezOJsPSj9JPtjC9P/u6JJIRQojabLII30C2zGMhivuvRCaXKAtgve8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709052531; c=relaxed/simple; bh=GtJSUs8Zd08aEwUhpwlgPs5kZeQj2tOYnSlh4NGkwac=; h=Subject:From:To:Cc:Date:Message-ID:MIME-Version:Content-Type; b=ede/qpHqHpIVM6a9cJEyZKiFfep59qqU5GaXRulntV5/gtBrDJJJP7b74DeMQ+5dSPx6H5S5+8HDcaghVL5/Vo7HPkhbRzCERJtUV0NZkhK9Hr6GRt6OxKSADiw2TfZeOFbeHxawVa6VxWI1gvJ0HIjXcr6aP8+wMZkreEGVbMY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=VAt5aIZU; arc=none smtp.client-ip=192.198.163.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1709052529; x=1740588529; h=subject:from:to:cc:date:message-id:mime-version: content-transfer-encoding; bh=GtJSUs8Zd08aEwUhpwlgPs5kZeQj2tOYnSlh4NGkwac=; b=VAt5aIZUs9Lg5f8h3pCUYEwZVJUn9RXNEvg9Rf73c9swibJLXIa7bLkH 8UIBmeoYeVX6asbavo9nqhptmEqrZ8WYGFyo+VCymCsfWGI16tEpSzHpF 8Ibnj9noy3OQ88c8h1CoiGJDtwtg+IdoF4n3K8ljlK78qlAPm2sPVH+GI MbjKipZ6flBxn/gPbCJcsBHWLuRRM7A0wKDnzhIG3D3HoBJZqJ9VwuzJq mWaygvF9/XWNpigF0GPfqgDty3cgdzXGCGjGx2glQ3Zwz+GnG5G+Jx2QE NlKN3fyENeiQatlTB/cM1n1V2SHs5xscGCHxCQLsp+mv5R6vjRucsriF9 Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10996"; a="14043579" X-IronPort-AV: E=Sophos;i="6.06,188,1705392000"; d="scan'208";a="14043579" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by fmvoesa105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Feb 2024 08:48:49 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,188,1705392000"; d="scan'208";a="44614001" Received: from sshaik-mobl1.amr.corp.intel.com (HELO dwillia2-xfh.jf.intel.com) ([10.209.88.67]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Feb 2024 08:48:49 -0800 Subject: [PATCH 0/2] cleanup: A couple extensions for conditional resource management From: Dan Williams To: torvalds@linux-foundation.org, peterz@infradead.org, gregkh@linuxfoundation.org Cc: Ira Weiny , Dave Jiang , Jonathan Cameron , "Fabio M. De Francesco" , linux-kernel@vger.kernel.org, linux-cxl@vger.kernel.org Date: Tue, 27 Feb 2024 08:48:47 -0800 Message-ID: <170905252721.2268463.6714121678946763402.stgit@dwillia2-xfh.jf.intel.com> User-Agent: StGit/0.18-3-g996c 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="utf-8" Content-Transfer-Encoding: 7bit Hi Peter, Linus, Greg, The cond_guard() patch has gone through several rounds of review and is looking good to me, but is missing feedback from one of you that have been grappling with a cross-kernel view of what these new facilities should look like. Separately I have been running into trouble trying to fit no_free_ptr() into some cleanup patches and thought of another way to build on the conditional syntax originated in scoped_cond_guard(). More specifically, scoped_cond_guard() introduced the concept of passing a statement to the macro to handle the failure case. cond_guard() extends that to be used within an existing scope to automatically release a conditionally acquired lock rather than defining a new scope. The cond_no_free_ptr() helper takes that concept for ending the cleanup scope for objects when responsibility for freeing them has been transferred to a 3rd object or subsystem. --- Dan Williams (1): cleanup: Introduce cond_no_free_ptr() Fabio M. De Francesco (1): cleanup: Add cond_guard() to conditional guards include/linux/cleanup.h | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) base-commit: 54be6c6c5ae8e0d93a6c4641cb7528eb0b6ba478