Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp1130058lqo; Fri, 17 May 2024 11:33:15 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWrLf+GwmGEoyQjpaNIodNFpv653odL4HYX25+viN7/dYLX+Rc+XVIHyhnBGQ8SS6wrhtyi9pO4stwJGRPzyjfV1jtsa4pelLBGABBQLw== X-Google-Smtp-Source: AGHT+IFBGDruKjaIBa0nAf1PrbZVt3qif89OZ5mNRSnshnpatuaFB7QCXLsGXXm1v6KuQkOVp6gV X-Received: by 2002:a17:902:d48d:b0:1ec:4cd7:6c7c with SMTP id d9443c01a7336-1ef43e2a1dcmr323162895ad.40.1715970794677; Fri, 17 May 2024 11:33:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715970794; cv=pass; d=google.com; s=arc-20160816; b=fw47Yh5b8Q5vEzasR3zMfvD6jbaYPU4PUcHRa0T4N0vAChj3gVtVAf3Gtgjx/d1GWO 9XzKIZPJNOvn3ViAO/WApb6sDH62oo4z74MQIU0kjHE8V7adN84K4XM/tGkNXn9LjSrB qsn93BSyZvcndRrd0fhAASd7aqbmrMMHFRsikWiKUgK/nnSiv2vxhk1HnE85xG89lm1o Q4HyJ3jSD723R/Dbucq//+0tBIOWEQlmCCLDXgO66P77H0rLCd9seYsYL+VkNF7KM0L8 J7r01SHASNDXyXRSSiaxvTsilbd5sCNUEP0X/L/A+u6KVuUAopc+6eXRX8EuG9Rvozd5 Oumg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=trmdsobqOMWDgc1D8NKUUfFAo9qR0PrBuwm8lSkrz3c=; fh=N+hnqw9hzqsZznynna/DmMq/Ukz0/MRpy1Ld7r7BJS0=; b=nZrMhWwPu8d1PIV92jWzVDq1neYtwjbmEl+UyFigbIido3btnsbyjdN5dP0fV604JD xEuUxcxpS6Scz89bq0YUf1Kt7jekGypCiXY/HhyzwVkMvQSS5IOrqR9jNs8RuiU9KKwD e4M20GBjRIAUKy2VdSuiF2pB/N4n9jzfeFYd0bX4cs+0Ezs6MiXIF7k5xv61vG1V50Hs vSw1L+oeC2SmDFRVdchPlkXOKeK6R4EvxQc0DknWLpKn4kDzkjcECGSJDtr4WHJmtp2a WwrtsPysVEYaNsSyQk1xxxl4P+0Tnla+z0Lu4GtbraIG+AEEel5TKBAbfgrmyGew3nwa wcPw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=Vg79+cHH; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-182518-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-182518-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d9443c01a7336-1f082b77220si91400805ad.274.2024.05.17.11.33.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 May 2024 11:33:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-182518-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=@quicinc.com header.s=qcppdkim1 header.b=Vg79+cHH; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-182518-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-182518-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.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 4DE3B284E4A for ; Fri, 17 May 2024 18:33:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5D33F13E02B; Fri, 17 May 2024 18:33:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="Vg79+cHH" Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (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 F15771A2C19; Fri, 17 May 2024 18:33:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715970784; cv=none; b=WtmqlXDOMEytUsNfn9+cZeUyg9kAoUT1fkESm6YKMB04q44adJ1K7pYQdd0z8iGhsfe4zCLBFKdqehWU8/cGSPKsb3o8ozKpQR6mgkRcy7IIE1qiqGu+VMA2miLzBqL9FSSSeRcwwc78ulXMeopNqO6rQos5qSv9WNRhiOzmwc8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715970784; c=relaxed/simple; bh=IpHKn100vUjrZafmZKJ1y8v2H5IiPMdG53S1ZMl4E+8=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=JZBaN1w1C4Z15A0SGIW36kQ6DFv2+fd5nxMyLqQay5WxT+iArhHmSPFZzHjWU25SS7hNbQdiLqcQiXH3+C93mdVvuZrYBStqalYuR/8uJQ9988JfH0pSQRgZpDdMIjuO5VMnDUt8k1nYNKiy4VfmyIJBGp4kal+/LaC+RMkdzXY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=Vg79+cHH; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 44H98KQL007278; Fri, 17 May 2024 18:32:48 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= message-id:date:mime-version:subject:to:cc:references:from :in-reply-to:content-type:content-transfer-encoding; s= qcppdkim1; bh=trmdsobqOMWDgc1D8NKUUfFAo9qR0PrBuwm8lSkrz3c=; b=Vg 79+cHHTr16tp9TBmcnGCAcEW4MomLM4m1TKiTIMTQjhQhCHjjJmqRKuVQpASP1VN gxPAIarbirbphn6E+t149eDVGIc8hRdrMDvVL2EPWF0/JqMPMC+sDo22wQMCLsD9 TaDEpjCGVD6MyiiC+Zypj2Qh8NGx1wx/BT6qe8gGgVukepc9SfhRSypj9nwj2AXF pdjF1XthSOHFf1ZIDamd8/2hyO6puG00UnQXR3gmAhQeqdI7avackgQZta38hLf+ F7v7kO4aoxLR8t6au8FWW0Go2wxeAf7yXaKYIS9GNA8dwVz211WwZI8AzmkmrsoI kP19QtIyiZjB95ADFoOA== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3y49ge0tmx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 17 May 2024 18:32:48 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 44HIWlH1005033 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 17 May 2024 18:32:47 GMT Received: from [10.110.126.2] (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Fri, 17 May 2024 11:32:46 -0700 Message-ID: <8000851c-f3e2-4fcb-b4d4-9acaf9763fdb@quicinc.com> Date: Fri, 17 May 2024 11:32:45 -0700 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/7] hwspinlock: Introduce refcount To: Bryan O'Donoghue , Bjorn Andersson , Baolin Wang , Peter Zijlstra , Ingo Molnar , Will Deacon , Waiman Long , Boqun Feng , Jonathan Corbet , Mathieu Poirier , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Manivannan Sadhasivam , Konrad Dybcio CC: , , , , , Richard Maina References: <20240516-hwspinlock-bust-v1-0-47a90a859238@quicinc.com> <20240516-hwspinlock-bust-v1-1-47a90a859238@quicinc.com> Content-Language: en-US From: Chris Lew In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: iv9sI3L20wtxJZlWpyoVobWcaFr13M2_ X-Proofpoint-ORIG-GUID: iv9sI3L20wtxJZlWpyoVobWcaFr13M2_ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.650,FMLib:17.11.176.26 definitions=2024-05-17_08,2024-05-17_03,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=888 impostorscore=0 clxscore=1011 priorityscore=1501 phishscore=0 spamscore=0 mlxscore=0 lowpriorityscore=0 suspectscore=0 bulkscore=0 adultscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2405010000 definitions=main-2405170144 On 5/17/2024 1:58 AM, Bryan O'Donoghue wrote: > On 17/05/2024 00:58, Chris Lew wrote: >> +    unsigned int refcnt; > > Why int and not refcount_t ? > > Have you an argument for or against use of one over another ? > I wanted to avoid the warning if you try to do a refcount_inc on 0. In this case, 0 means the the hwlock is unused but the hwlock should persist while waiting for another request. It seemed like refcount_t expected the associated object to be released once the count hit 0. Also the count here is serialized by hwspinlock_tree_lock so the need for the atomicity provided by refcount_t was unneeded. Using unsigned int here seemed simpler. > --- > bod