From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 98F58C0502C for ; Sat, 27 Aug 2022 07:05:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232683AbiH0HFf (ORCPT ); Sat, 27 Aug 2022 03:05:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58878 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345438AbiH0HFQ (ORCPT ); Sat, 27 Aug 2022 03:05:16 -0400 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C1661FCFF; Sat, 27 Aug 2022 00:05:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1661583904; x=1693119904; h=message-id:date:mime-version:subject:to:references:from: in-reply-to:content-transfer-encoding; bh=MeyfiG1WV/G+fVqDdCE4FjaLpNOunPp15e4AIulnecM=; b=UGfOOp/9oby/TYmXXzs2+uYQEHBxKq/oB4myjghrg4h0zzQKA745ux7i L+GdKaJmowO/ZOybEF/iMp27IirQEZ6lrlk1FQOTpOsaClr3DvQn7JBxx L5hFl+bucGcYMzS1AvEzvqjyt7PNx0n04KyseFhlbiA5K9MpXV3Wx8kEN e9t3Y+vxX+H5HcpCg6P+e5++gXq7i2ibjUUgTmVhMf32SPDFwbxOb8JUS FMIh4c8939bfJ27z2nJyT1zgnJXzrxMVgROSpdHV939TsWtz3qi/agHjO xrV1cRSHsxISPwLAPklg9hdnjIkiJinxl0Ih08J1GBcjsODMrOj2MaAuo w==; X-IronPort-AV: E=McAfee;i="6500,9779,10451"; a="281610135" X-IronPort-AV: E=Sophos;i="5.93,267,1654585200"; d="scan'208";a="281610135" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Aug 2022 00:05:03 -0700 X-IronPort-AV: E=Sophos;i="5.93,267,1654585200"; d="scan'208";a="671745348" Received: from ahunter6-mobl1.ger.corp.intel.com (HELO [10.0.2.15]) ([10.252.52.233]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Aug 2022 00:04:48 -0700 Message-ID: <0026becb-4e17-9e5f-0f59-9796d689c238@intel.com> Date: Sat, 27 Aug 2022 10:04:44 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0 Thunderbird/91.11.0 Subject: Re: [PATCH v4 00/18] Mutex wrapper, locking and memory leak fixes Content-Language: en-US To: Ian Rogers , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Thomas Gleixner , Darren Hart , Davidlohr Bueso , =?UTF-8?Q?Andr=c3=a9_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 , =?UTF-8?Q?Martin_Li=c5=a1ka?= , 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@vger.kernel.org, linux-perf-users@vger.kernel.org, bpf@vger.kernel.org, llvm@lists.linux.dev References: <20220826164027.42929-1-irogers@google.com> From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki In-Reply-To: <20220826164027.42929-1-irogers@google.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-perf-users@vger.kernel.org On 26/08/22 19:40, 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 all patches except 9 and 16 Reviewed-by: Adrian Hunter