Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp1893219rdf; Sun, 5 Nov 2023 19:59:13 -0800 (PST) X-Google-Smtp-Source: AGHT+IFZfKukFaH/MOpXpUf6IOLKyngCAaHKM+il+axLgm2wXLnq493j04WTHlmaW4KWI27Z3UNd X-Received: by 2002:a17:902:c14a:b0:1cc:32df:427a with SMTP id 10-20020a170902c14a00b001cc32df427amr10592060plj.27.1699243152803; Sun, 05 Nov 2023 19:59:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699243152; cv=none; d=google.com; s=arc-20160816; b=hR25d6hQuEF6n2dmHuLkUTibrx4H3YWS1Cw3s7EqdchTvp/uEb6gkkM3MiPqZknimz S8mgRmfYoEX/otz9k4oPtwMxhpSC6z437CV2N6EcEyL0zvBiuXJn+U2V5F8bVgZ8Eijg 2bY8/wHy3ZiKk+p27PUChSuk0b1SbcZ+5xtmzxaB5qANdV72H2ZXrZJLNytm/vhWhSfY V8K836EkwHPJStDnmZcu1ZYqklWmJzfN7pPVRtnr+FJhxrlwxC4ml3lspmNRJIM9tyjo xrMytQjW1VSO8GSMaH2GQmW1eAhtDL98xrZilVILoY5FxtDWes2Z/+JYjiPG80Q5kYfW gNNg== 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; bh=uCKeP1tk4A4FQUP4n08ZKtxE57ASbNYqNEwgMsOkjDo=; fh=mapERlogJ/cQt0xtLiOgnrZ5zpp0wMkpfbiUTcLZi4s=; b=waHpmAXVg1p0bdNmevezGKJBX/hvRdSAuJLlCKYGlXB5gWfuPSyH5iGjqEKtiPqoG4 7OZjK9QAZFhlJkvKYNJTRwUVoQ4LJSCOdBnbMCHh393l5YyoejFoXiz2X6XcqVp9pAmR ZyCL1eovqKpTPiZtv4wJjpQaUdkcOT2tPLEGZbCf86AkLcoWXBRlmj3sO6HIUSkr9LDG sjZtc1RPOKlI2BNHwNcqI7JWAH2uIyHx5gN0Xe8qVhhCDaHKVuRHITZyTLdzXrmYCFZ6 6kBgvMV2/m3gRKo6E9nD/1rVwd/EySjAcwfTH4VtH07V/eKR2nGfF5WEHRxKG6HK0E68 7SkQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id 21-20020a170902c15500b001cc2853bfe6si6914827plj.192.2023.11.05.19.59.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Nov 2023 19:59:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 913B38097163; Sun, 5 Nov 2023 19:59:10 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230269AbjKFD7E convert rfc822-to-8bit (ORCPT + 99 others); Sun, 5 Nov 2023 22:59:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45262 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230266AbjKFD7D (ORCPT ); Sun, 5 Nov 2023 22:59:03 -0500 Received: from mail-pg1-f180.google.com (mail-pg1-f180.google.com [209.85.215.180]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C4C7EBF; Sun, 5 Nov 2023 19:59:00 -0800 (PST) Received: by mail-pg1-f180.google.com with SMTP id 41be03b00d2f7-577fff1cae6so2943011a12.1; Sun, 05 Nov 2023 19:59:00 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699243140; x=1699847940; 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=yEdoTvgGm7uaeRMpxpJUiRCbk25iqfmxfW6IznSRR4k=; b=wAaHvs2KpBGLKpnrkB7I1GLIFdcdqWNOlu2Qfx4TU7Gh0gomvyOFXKEmq7AapXKCci IgKbhp4Cu7nZpvfbJYQ2oHR5WNaSKEKVoUqkZ9S0EstMhqMwjSD7QKuGLOzv6jI+rdp3 RAyqtvS7D5FaCGiFeiqSh1MdRrQgtCVXB8lvhhK32hvxTUQQ3iIje5EoSrsHoLVoQBlx DczNb5VYf0KE8EF86KymxcdOoqARn/7r4UC8seQqRtEK6lag/ThwrOdvwgL6u0Xj/sZj PJgRpAmH+gAOGWLA1Q8c7w27DsDR5xKDKO74uBhGOR/6QseSVG0Mh1zOTUHzer+D0djP Gb3Q== X-Gm-Message-State: AOJu0Yzr1C0sO4W08V8oOtW8s6KntMb9opBk4w7POxnF0M01yTBoSIJL HvJ+SL62t96+8Ah8v3RviZqHHLfs+m5NLfoQ0Vs= X-Received: by 2002:a17:90b:1c01:b0:280:280c:efe3 with SMTP id oc1-20020a17090b1c0100b00280280cefe3mr12716575pjb.14.1699243140100; Sun, 05 Nov 2023 19:59:00 -0800 (PST) MIME-Version: 1.0 References: <20231102175735.2272696-1-irogers@google.com> <20231102175735.2272696-2-irogers@google.com> In-Reply-To: From: Namhyung Kim Date: Sun, 5 Nov 2023 19:58:49 -0800 Message-ID: Subject: Re: [PATCH v4 01/53] perf comm: Use regular mutex To: Ian Rogers 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: 8BIT X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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]); Sun, 05 Nov 2023 19:59:10 -0800 (PST) On Sun, Nov 5, 2023 at 1:35 PM Ian Rogers wrote: > > On Sun, Nov 5, 2023 at 9:32 AM Namhyung Kim wrote: > > > > Hi Ian, > > > > On Thu, Nov 2, 2023 at 10:58 AM 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. Thanks, Namhyung