Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp6799969rdb; Fri, 15 Dec 2023 08:36:56 -0800 (PST) X-Google-Smtp-Source: AGHT+IEiCP8NI2hXFqlw67hvUshoC04QJHdemhbB0w3cv2ENjcu7CllWNHAyEembQU6r9D6mIQbI X-Received: by 2002:a05:6e02:18c5:b0:35d:63cf:420c with SMTP id s5-20020a056e0218c500b0035d63cf420cmr18689308ilu.16.1702658216520; Fri, 15 Dec 2023 08:36:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702658216; cv=none; d=google.com; s=arc-20160816; b=oDP9eKKtRCeT3aoh7n90qWwemOfLdP+ljz9VUe1CYIeUL3Y3IWkpcZlgFGumVWiLz5 pqwJUVRNQIDe3GXiIpoP0vaQEsaATQHYbIzFi8al2prKFHamDq0zzsaOeQsUCDu39dOD C8aXO0NsdJVfO0F3Y4HOANbO6/vNbyn+K8aQtIkefuTscf3DHmuUjRNTWdHCwig30gPK bZzz1NnGEDipusFZHHIDqr21lwe6jO6xmXOP3L0A4DpPmXXxeDzH4794padQsMb2ZAIo yxJv2kkAuR6jvI/9N+as9zlgrlsjclvTgJdJfOMmHNWB8G8AbXdCV45GCvdblHpC2Vpb vtbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=organization:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date; bh=D6kLQrVcUvgphosu+JRSPtotlgYJ0Pqml658UOrpUwo=; fh=BiTih3HBn05OJvpBeKJCJhFgvirybBPBq65CdTV6sMo=; b=zy8jgsOGVDYFr7kTk1R2AnwKtdWL4ZJOn0C7n1tG8CPgpzZ5kfMBCkCY9ZaqOx9/vg fPuowvcgZTMHoDbwFQbd9V2IcbloKqTyCWKaw9TpoJjzB0Zx2R+bXAlvQng+v/MQVNtP 2hlsmLaR4tYCGaSqJOLhaz6w7nXDP5qEYRxRHqJe0Cb4tT2aUFZv1tFU2i8AA2UmRtqJ mSB4X0Vpd9d9HtNZ8DEJ5VDFF9YB/OLvQn8RL50U59u6OtaYITFdB5fhWLirv/uP4LWw IZebYXRekj8uXRxKL6m3FsoQaZdbDaGJtENRCksUhlH16mrPS3UBRpBJ3V0Je/93EGa+ V7uw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-1310-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1310-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id ca14-20020a056a02068e00b0059b70e69eddsi13677605pgb.300.2023.12.15.08.36.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 08:36:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-1310-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; spf=pass (google.com: domain of linux-kernel+bounces-1310-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1310-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 2FE4D283132 for ; Fri, 15 Dec 2023 16:36:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E785D3DB83; Fri, 15 Dec 2023 16:36:36 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.24]) (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 51ADC3EA73; Fri, 15 Dec 2023 16:36:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=kernel.org X-IronPort-AV: E=McAfee;i="6600,9927,10924"; a="398088456" X-IronPort-AV: E=Sophos;i="6.04,279,1695711600"; d="scan'208";a="398088456" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Dec 2023 08:36:34 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10924"; a="948021596" X-IronPort-AV: E=Sophos;i="6.04,279,1695711600"; d="scan'208";a="948021596" Received: from smile.fi.intel.com ([10.237.72.54]) by orsmga005.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Dec 2023 08:36:26 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.97) (envelope-from ) id 1rEBAl-00000006AaA-3piW; Fri, 15 Dec 2023 18:36:23 +0200 Date: Fri, 15 Dec 2023 18:36:23 +0200 From: Andy Shevchenko To: Kent Gibson Cc: linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, brgl@bgdev.pl, linus.walleij@linaro.org Subject: Re: [PATCH v3 3/5] gpiolib: cdev: reduce locking in gpio_desc_to_lineinfo() Message-ID: References: <20231215023805.63289-1-warthog618@gmail.com> <20231215023805.63289-4-warthog618@gmail.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: <20231215023805.63289-4-warthog618@gmail.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo On Fri, Dec 15, 2023 at 10:38:03AM +0800, Kent Gibson wrote: > Reduce the time holding the gpio_lock by snapshotting the desc flags, > rather than testing them individually while holding the lock. > > Accept that the calculation of the used field is inherently racy, and > only check the availability of the line from pinctrl if other checks > pass, so avoiding the check for lines that are otherwise in use. Just wondering if you are using --histogram (diff algo) when preparing the patches... -- With Best Regards, Andy Shevchenko