Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp35054rdb; Wed, 31 Jan 2024 22:52:51 -0800 (PST) X-Google-Smtp-Source: AGHT+IHIy/QxuBTCOo8RhHfk5CV8qKi852AFo/e4TRPNIXLjIKWzeXuzoTWlHHridYR6yy147DqC X-Received: by 2002:a05:6808:1809:b0:3bd:cc43:146f with SMTP id bh9-20020a056808180900b003bdcc43146fmr4249784oib.41.1706770371187; Wed, 31 Jan 2024 22:52:51 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706770371; cv=pass; d=google.com; s=arc-20160816; b=StnQf3fRzgb9QeMYUz6CkH2QeKV5IoMU31NalEUDh7Ik7s2uwQ4qe3KD39B7XNqRyY JQ/JZ5xrOG0urVgh40ycerIa4xLJtaD2fBqfr0VVhvZUjziW/SWDdziB7tHbfhkqIeKU tbihbxzVQSuu1F/zmYQbl2MJcfYaSO1c9JGCqN2uI06p/J7tmhcg0CinNuKXp6YdD0A6 NVNO1zaq++PlHVMgkRGS/fnUFOT67tX9k4tlIlmN9dQ1A4TTg3TKp2n2B1IpyfGNTSvS EVzijbblcAO1k8Xr8aKEjdH69z2y7TlAGhFm1yXp74HFhnNqp/qH07hc7jdlFqPQs2zu fX9Q== 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 :organization:message-id:date:subject:cc:to:from:dkim-signature; bh=frwbpMHhpJmLv8BVDmQu6lV8yxGyaFAjLm9+7D3w2LE=; fh=2DwX2HkCPu/HxB/DMOYPhI0btn4mMPbnXZPIYe4OGmY=; b=V80+JstAufSbmu8YydNn+Y5n6q1tVTvXKe7HoUo2VDB5kfotmqrKKHrx9f92pYMpH4 o1kZ2uo5oM+capzeGGFFK2hMq6aB5zEBnrdESIkiQB3yDk67c14UGaK9l0JpVrvT0tcT 7jBk1eze/PWT/YLgfbOaVRJLq2Yn9R1JblTnPg//lIEkazmhy0jG9rMWwV+mZTxuvs4G lbDlj8W/83D08OHQ/7X2x3F9hDPrRHyMVouUuppOlvv2Xyo6K+K/7JGD6GvvlOGcFjnP WB74ToZsTNKrG+tb9k1Xba/frrW8fwfSyo0x9Q47SPibkj+HfYc70Q4/gYCWQsPzFdxe DD+Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=VRYRA8v8; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-47495-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47495-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Forwarded-Encrypted: i=1; AJvYcCV/waGbjPVUfxe5GPiTjxr/nH4/lF3RC1AoIm+yaZ+CmNxIOt+8ksa/K29x/fdMQiS0NFn05wtLYsiBfuI+h+LAVpTATNqR4iNiqZsKdA== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id k11-20020aa79d0b000000b006dde067b3afsi11271237pfp.342.2024.01.31.22.52.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 22:52:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-47495-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=VRYRA8v8; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-47495-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47495-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 3B9DA29094B for ; Thu, 1 Feb 2024 01:26:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 43944443E; Thu, 1 Feb 2024 01:25:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="VRYRA8v8" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.12]) (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 C99474417; Thu, 1 Feb 2024 01:25:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.12 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706750755; cv=none; b=OpR3fhquI0vh1VO+Gf5f73UiclUOi8jlTOCVsOLMhQn4I2z6DncrOPNloeW6lcRsL26KEkuhDz6ahLiACiLfkkjulIQC8yG1dgVPpFBwr2OmgDbxwzfY+g1VcQNPW5ABfXlO7j3OEY5Ng75X++dTdxTcNPCo7LjGkCtIljjaaeA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706750755; c=relaxed/simple; bh=frfQKxLoEzeMVr6mq09w8CamaELprKykJ2MCygBUcGY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=G6rMyU8KUA2r8tbRgk+ZjPTIG0dhTUB0xypLhUoFctRUjYM0W4EurhG+iefTKvPta5iPIXLe6/pAz0ZqzEQb/0UKuiHty6c9CI050MVMJ728Z/XSE8BGq+CpjTChfbTcPNVF7NP9MeuvQ/5cdvSs6RU3jvXp9klo1jCG5j7wp2o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=VRYRA8v8; arc=none smtp.client-ip=192.198.163.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1706750754; x=1738286754; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=frfQKxLoEzeMVr6mq09w8CamaELprKykJ2MCygBUcGY=; b=VRYRA8v8W3/xOxU4OMWpDLNxUXVv/ZV18O2BTv+4IfhNLp9T0kiQBaiK V0NHHX239i55NNuMNZvvNc6eXsEh5oXM9f0dSvfpT7I8UpII7uCvMfv6M wOHMT1UDAPbBPMRcoiThGWMUHFT8watFJbto69DzLxsJn71Zx4v/05rA+ VFPbui9GFKv96NE3qsizAFmxaOksJLFp8IeDm+B9XMtqEzps1jJzYLeeb 48oacYvn5Ufe2afDCyV6K0RFeue4a+RJQsabteL7ppNV3jYT/Ltyo1laA QZOt8+UGXShy1PIIeM2MQNsQj/6UJDQ0lg2RNfJp5y0vEmxh/slsmSghU w==; X-IronPort-AV: E=McAfee;i="6600,9927,10969"; a="3614805" X-IronPort-AV: E=Sophos;i="6.05,233,1701158400"; d="scan'208";a="3614805" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmvoesa106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jan 2024 17:25:53 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10969"; a="911975143" X-IronPort-AV: E=Sophos;i="6.05,233,1701158400"; d="scan'208";a="911975143" Received: from fdefranc-mobl3.ger.corp.intel.com (HELO fdefranc-mobl3.localnet) ([10.213.21.45]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jan 2024 17:25:49 -0800 From: "Fabio M. De Francesco" To: Peter Zijlstra , Dan Williams Cc: linux-kernel@vger.kernel.org, Ingo Molnar , linux-cxl@vger.kernel.org, Ira Weiny Subject: Re: [RFC PATCH v3] cleanup: Add cond_guard() to conditional guards Date: Thu, 01 Feb 2024 02:25:46 +0100 Message-ID: <5284664.GXAFRqVoOG@fdefranc-mobl3> Organization: intel In-Reply-To: <65baefec49c1a_4e7f52946b@dwillia2-xfh.jf.intel.com.notmuch> References: <20240131134108.423258-1-fabio.maria.de.francesco@linux.intel.com> <6168759.DvuYhMxLoT@fdefranc-mobl3> <65baefec49c1a_4e7f52946b@dwillia2-xfh.jf.intel.com.notmuch> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" On Thursday, 1 February 2024 02:12:12 CET Dan Williams wrote: > Fabio M. De Francesco wrote: > > I just noticed that this is not the final version. It misses a semicolon. > > Please discard this v3. I'm sending v4. > > Ok, but do please copy the aspect of scoped_conf_guard() to take a > "_fail" statement argument. Passing a return code collector variable by > reference just feels a bit too magical. I like the explicitness of > passing the statement directly. I'm sorry I haven't been clear. The following call convention fails my tests: cond_guard(..., rc = -EINTR, ...); It always returns -EINTR, regardless of the success of down_read_interuptible(). There must be a reason that I can't see. It works only if we immediaely return an error code: cond_guard(..., return -EINTR, ...); But this is not what we want since we want to check 'rc'. Fabio