Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp3315298rdh; Mon, 27 Nov 2023 10:59:53 -0800 (PST) X-Google-Smtp-Source: AGHT+IHIi1R4b7LGbU/uCZv4ICSrLdGdiW1zy+k+IrOUMvwi+eUvKD10BBnYDXKlUK2i3yxCLbwJ X-Received: by 2002:a05:6830:11c3:b0:6d7:d732:48f1 with SMTP id v3-20020a05683011c300b006d7d73248f1mr13352454otq.36.1701111593339; Mon, 27 Nov 2023 10:59:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701111593; cv=none; d=google.com; s=arc-20160816; b=mi8yKDgxozb4DCjkst7GgL3eC7EYJoh1rf7rTWNrt3iFZF2gbnvdfORn67p60KRztl OquGHmv0TWVuCVvQhC2jr2nqy/IG4fNpb3tTx4r7/Yph0GAwNrBG+8qKegC8s+DFeRlE +z3yb1Fj9cKydPDpnhfZXD3iyRx2idVypfaCE4QN/F+oPtq6FMJq0BBkVUjKyWP96G1/ Y7nUri3a6J+tufKqrO6DlsPNU8zC16rd47BhCdzePeDCWZmjOVWREt2U99pIxoYZfri+ gaw9ZQUkFZjNz9zzGC9Cwa9zXZfz972tbjm75d+hTsVQ058dDbap79rdBIb9XpOs0hx6 1G8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=T/wNL+0r9M3vEkbA09HZd27UVLvLuDyJ6shtN1Fiw18=; fh=ZP5rkIgi+sgQyvA0Nb5diyJQn/QILptIgBv8r67XkSs=; b=owP4Bli+bqJySpnG/fftCohZINW1htyyd97AVQsZDR5mc9N6kcuXqX0wx6Yt49wr5b x1EuKYLC+3YT02+qW9LMbO3e0FunvAtH8uHLzF0quWSGL+BxUQmdYFfkN220DD02DBfe Nc7YycpW8u5lYYhqEM0nt4busTkjn1LLnPRKYV01EBsGWF5aTbf85CiMzGdNoVr07eyA 2htFAHIh/LYsQ+XYEIJ01Q/kk0llR+KKp1+u4VHu9vM9lIEhcraEJk5zBJXonCClJLnv oGOsukl3cBKTTrprgsKapMW+ftDuxUBl69TkNBpknPVTUZ6/ekE87gDUM+EdlW0x9/JF oEmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=EVpxeUBh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id r15-20020a6560cf000000b005aa644010a6si10342888pgv.205.2023.11.27.10.59.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Nov 2023 10:59:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=EVpxeUBh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 81414809588C; Mon, 27 Nov 2023 10:59:47 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232706AbjK0S7a (ORCPT + 99 others); Mon, 27 Nov 2023 13:59:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43572 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231339AbjK0S72 (ORCPT ); Mon, 27 Nov 2023 13:59:28 -0500 Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com [IPv6:2a00:1450:4864:20::131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 56F3B10C3 for ; Mon, 27 Nov 2023 10:59:33 -0800 (PST) Received: by mail-lf1-x131.google.com with SMTP id 2adb3069b0e04-50ba8177c9fso6512e87.1 for ; Mon, 27 Nov 2023 10:59:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1701111571; x=1701716371; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=T/wNL+0r9M3vEkbA09HZd27UVLvLuDyJ6shtN1Fiw18=; b=EVpxeUBhEtaaEZLJ2EaBAzJW/AI/02XaVVTWkJZhJQQAj5jji6Jj8B7AtDIxJjlyOw eGqrplgxchQsvnIxz3inYTDFeMLX/A9SohlR/+N+Jx8A4dXCA18LMCcWtFWODfTzmm3V RZuVEQEhbDShg45MrpyV8+rOPlf7BO1i5aURp/cbwPUt0Ursb+bokAcS9TIkx3w/VWNz NXNTFCn01EFadNN+hHuTuTizuN15k/znCEk46opJGDTvMA3NiH7pv+nJeDtHSNkfJ3K2 IsIjiULNRH9x45uotkZ64IdC15Z+QiOwE1EsPtNOE27HEP7qV3jP5ie3xV8jyxhFLIXZ BFyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701111571; x=1701716371; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=T/wNL+0r9M3vEkbA09HZd27UVLvLuDyJ6shtN1Fiw18=; b=dLjm20s7LdrKmyDhTgJIbii2jICER6HPbIYqS5/+wtrQja6LyXGKxk9V8aW9ubGfFM BHxQIL1aawDPs+Nuimv3iRTJfJ1NAVhd1XJ20pDNy94hHClJTVa60HiIsmz7nl2ffT0/ oertWZwa7rCIxO+rnk+HTV9gPMWNd5p1PWrmZawy6OFOGsR+X4WKkAnbrfeihy/GwarE zmg07s19F/EIjd7YzhFv0ADNGZ/vNIiukqp/yNqfHogy4/t4CdMmhRT8KWfuCaNRbIlZ T7J7mWqBfto6qbxmPDvG9x3zvNU9oJnKyp6Idhydpy1KxaHs+zSbb58ZBZMbCs2u7lW3 aXVA== X-Gm-Message-State: AOJu0YzXHOnJRoHZUUoTs2q9uareSIfvYQBHnRbz7HXlB/aQ3+2fRcik IqC8BdHXcaenOjWUqtP7xg0AvJIYDWI1iPjcNIPoZw== X-Received: by 2002:a05:6512:6ce:b0:4fe:ffbc:ac98 with SMTP id u14-20020a05651206ce00b004feffbcac98mr564192lff.4.1701111571318; Mon, 27 Nov 2023 10:59:31 -0800 (PST) MIME-Version: 1.0 References: <20231102175735.2272696-1-irogers@google.com> <20231102175735.2272696-2-irogers@google.com> In-Reply-To: From: Ian Rogers Date: Mon, 27 Nov 2023 10:59:19 -0800 Message-ID: Subject: Re: [PATCH v4 01/53] perf comm: Use regular mutex To: Namhyung Kim Cc: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Adrian Hunter , Nick Terrell , Kan Liang , Andi Kleen , Kajol Jain , Athira Rajeev , Huacai Chen , Masami Hiramatsu , Vincent Whitchurch , "Steinar H. Gunderson" , Liam Howlett , Miguel Ojeda , Colin Ian King , Dmitrii Dolgov <9erthalion6@gmail.com>, Yang Jihong , Ming Wang , James Clark , K Prateek Nayak , Sean Christopherson , Leo Yan , Ravi Bangoria , German Gomez , Changbin Du , Paolo Bonzini , Li Dong , Sandipan Das , liuwenyu , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Mon, 27 Nov 2023 10:59:47 -0800 (PST) On Sun, Nov 5, 2023 at 7:59=E2=80=AFPM Namhyung Kim w= rote: > > On Sun, Nov 5, 2023 at 1:35=E2=80=AFPM Ian Rogers wr= ote: > > > > On Sun, Nov 5, 2023 at 9:32=E2=80=AFAM Namhyung Kim wrote: > > > > > > Hi Ian, > > > > > > On Thu, Nov 2, 2023 at 10:58=E2=80=AFAM Ian Rogers wrote: > > > > > > > > The rwsem is only after used for writing so switch to a mutex that = has > > > > better error checking. > > > > > > Hmm.. ok. It doesn't make sense to use rwsem without readers. > > > > > > > > > > > Fixes: 7a8f349e9d14 ("perf rwsem: Add debug mode that uses a mutex"= ) > > > > > > But I'm not sure this is a fix. Other than that, > > > > Thanks Namhyung, it fixes the case that you enable RWS_ERRORCHECK in > > rwsem.h as the rwsem static initialization is wrong for a mutex. > > Sounds like we need a separate fix. Maybe you need to > add a static initializer macro depending on the config. Agreed, but the only use would be here and switching this case to a mutex gives extra error checking such as the mutex being taken recursively. Given that, I prefer the existing change and the static initializer for rwsem can be a follow up when needed. Thanks, Ian > Thanks, > Namhyung