Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp697843rwe; Fri, 26 Aug 2022 12:32:51 -0700 (PDT) X-Google-Smtp-Source: AA6agR78EeFY70RL9R7rO8ayBHxE1clNVxp4hMlw/IKzth9D43PHSQlVpPlQYCQTbIxHGEoJnTpA X-Received: by 2002:a17:90b:17c2:b0:1fb:7a6f:7977 with SMTP id me2-20020a17090b17c200b001fb7a6f7977mr6045894pjb.53.1661542371333; Fri, 26 Aug 2022 12:32:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661542371; cv=none; d=google.com; s=arc-20160816; b=GK2eodq/j4IHOn81GzWGSG3IQsPPRtfTCJ8kxPheiAYmzw/SklSRYQ/rlM4PQBZ/rj Ly/j+1yEk21K87nL2VBMmKi2r3It8gW3IMZJZlVZ+tGv5f2bMcrZu4ogKpYrVdnTQE/+ jhUWHaYY/TdfO59iIAX1Q2CcSOEIngNui4CGBzS+T1sI2r1Jjn4h58fFly2sjJld4+qh Fq7FcNT6+fw7YGNj8fTDXSUVsukH3hfnAeIweMOg0/l8aeVVh5aOQ3LugmHeJ2JxKiDH HB/Sd1k8JOlX/XSUi8kdFiVO+P0eh+t/E2JljVVZfG3t1nqkFQVqt5HNezmpEcapmKat H3Fw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=OTw1xkrC4uxuQEq4ZJT4YHOUbQA52XmV6m7grlCrHJc=; b=swhtheJFeV0Hdk/55x0D4DwYngpR2mIZJWrmPFuEbUfNU69mVC/dVb9HGfjOkIWhbq hv4zMULa+ppHHY86DlZou6U07MaeZFnx5nkDMnwqT+L3kG49pShLPsYswv9kvvgmLVk6 db/TQHoLAW945RaD4mJYaIoYvCAHdDRZP0zQjvFSw3DR1Xi7XOyP5+NjLROHSE7nNeyp DbgL7OfeiXVjHHr6ZbSxUCVetSE9C5UStcHhG21SHLX83T2MX3WmaNk2vXKQ+ntoUCmk 2XWbyqZRZjzveVzNDl0EpGulpV7EZYCVFfBfCL3B5U6McoHQDHXKwIXX6JoiGbcpHrb4 yzhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hpZWFIk7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u6-20020a056a00098600b00537e88da121si322731pfg.35.2022.08.26.12.32.40; Fri, 26 Aug 2022 12:32:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hpZWFIk7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231267AbiHZTVL (ORCPT + 99 others); Fri, 26 Aug 2022 15:21:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45946 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235389AbiHZTVJ (ORCPT ); Fri, 26 Aug 2022 15:21:09 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 44FD7B07F6; Fri, 26 Aug 2022 12:21:08 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id BB19461E86; Fri, 26 Aug 2022 19:21:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C381FC433C1; Fri, 26 Aug 2022 19:21:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1661541667; bh=QvGGfd4u3ZgGNQzPE8cvR++tbeSXUZdTtSLRfphuRE0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=hpZWFIk7lRrtsGJa4ByLTO07Az2diNblNKXw38vxSFZWOD5B5cddPYiKIDDRz4a// 9z+u4etBw19PB9BzhBsiLLLgBx4B4Rnxz+QfB3YAMd476DOnri7C5lM19u5jIlagix oyLfXFn7SoKxxcABMjSlmAHd3zMGL7jkuBIlDS3Mcy7ARZF68/7kuiTDVuFYFyO1FP c/1LWUsqCALw5vcgk/UF6mHPL8w0GyN87zfyXVQf4r1XtzTLVJkh6yCcy/brxEi5Hx lZCD8w78PS5G2+p4ExhYnVdXG3fOZfd25Gpr4SPH8C0qPG1Ctj+sXhTeORATjWmyxq JTDkKV//4dBzg== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 9B00B404A1; Fri, 26 Aug 2022 16:21:04 -0300 (-03) Date: Fri, 26 Aug 2022 16:21:04 -0300 From: Arnaldo Carvalho de Melo To: Namhyung Kim Cc: Ian Rogers , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Thomas Gleixner , Darren Hart , Davidlohr Bueso , =?iso-8859-1?Q?Andr=E9?= Almeida , Nathan Chancellor , Nick Desaulniers , Tom Rix , Weiguo Li , Athira Rajeev , Thomas Richter , Ravi Bangoria , Dario Petrillo , Hewenliang , yaowenbin , Wenyu Liu , Song Liu , Andrii Nakryiko , Dave Marchevsky , Leo Yan , Kim Phillips , Pavithra Gurushankar , Alexandre Truong , Quentin Monnet , William Cohen , Andres Freund , Adrian Hunter , Martin =?utf-8?B?TGnFoWth?= , Colin Ian King , James Clark , Fangrui Song , Stephane Eranian , Kajol Jain , Alexey Bayduraev , Riccardo Mancini , Andi Kleen , Masami Hiramatsu , Zechuan Chen , Jason Wang , Christophe JAILLET , Remi Bernon , linux-kernel , linux-perf-users , bpf , llvm@lists.linux.dev Subject: Re: [PATCH v4 00/18] Mutex wrapper, locking and memory leak fixes Message-ID: References: <20220826164242.43412-1-irogers@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Url: http://acmel.wordpress.com X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Fri, Aug 26, 2022 at 12:08:06PM -0700, Namhyung Kim escreveu: > On Fri, Aug 26, 2022 at 9:42 AM Ian Rogers wrote: > > > > When fixing a locking race and memory leak in: > > https://lore.kernel.org/linux-perf-users/20211118193714.2293728-1-irogers@google.com/ > > > > It was requested that debug mutex code be separated out into its own > > files. This was, in part, done by Pavithra Gurushankar in: > > https://lore.kernel.org/lkml/20220727111954.105118-1-gpavithrasha@gmail.com/ > > > > These patches fix issues with the previous patches, add in the > > original dso->nsinfo fix and then build on our mutex wrapper with > > clang's -Wthread-safety analysis. The analysis found missing unlocks > > in builtin-sched.c which are fixed and -Wthread-safety is enabled by > > default when building with clang. > > > > v4. Adds a comment for the trylock result, fixes the new line (missed > > in v3) and removes two blank lines as suggested by Adrian Hunter. > > v3. Adds a missing new line to the error messages and removes the > > pshared argument to mutex_init by having two functions, mutex_init > > and mutex_init_pshared. These changes were suggested by Adrian Hunter. > > v2. Breaks apart changes that s/pthread_mutex/mutex/g and the lock > > annotations as requested by Arnaldo and Namhyung. A boolean is > > added to builtin-sched.c to terminate thread funcs rather than > > leaving them blocked on delted mutexes. > > > > Ian Rogers (17): > > perf bench: Update use of pthread mutex/cond > > perf tests: Avoid pthread.h inclusion > > perf hist: Update use of pthread mutex > > perf bpf: Remove unused pthread.h include > > perf lock: Remove unused pthread.h include > > perf record: Update use of pthread mutex > > perf sched: Update use of pthread mutex > > perf ui: Update use of pthread mutex > > perf mmap: Remove unnecessary pthread.h include > > perf dso: Update use of pthread mutex > > perf annotate: Update use of pthread mutex > > perf top: Update use of pthread mutex > > perf dso: Hold lock when accessing nsinfo > > perf mutex: Add thread safety annotations > > perf sched: Fixes for thread safety analysis > > perf top: Fixes for thread safety analysis > > perf build: Enable -Wthread-safety with clang > > > > Pavithra Gurushankar (1): > > perf mutex: Wrapped usage of mutex and cond > > For the patches 1-7 and 10-13 > > Acked-by: Namhyung Kim Thanks added it, will try to get what is done so far merged and then we can go on addressing the other issues brought up in this thread. - Arnaldo