public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ian Rogers <irogers@google.com>
Cc: langfei@huawei.com, Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	Namhyung Kim <namhyung@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Jiri Olsa <jolsa@kernel.org>,
	Adrian Hunter <adrian.hunter@intel.com>,
	Kan Liang <kan.liang@linux.intel.com>,
	Nathan Chancellor <nathan@kernel.org>,
	Nick Desaulniers <nick.desaulniers+lkml@gmail.com>,
	Bill Wendling <morbo@google.com>,
	Justin Stitt <justinstitt@google.com>,
	James Clark <james.clark@linaro.org>,
	Chaitanya S Prakash <chaitanyas.prakash@arm.com>,
	Athira Rajeev <atrajeev@linux.vnet.ibm.com>,
	Stephen Brennan <stephen.s.brennan@oracle.com>,
	Howard Chu <howardchu95@gmail.com>,
	linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org,
	llvm@lists.linux.dev
Subject: Re: [PATCH v1 1/3] perf dso: Minor refactor to allow Wthread-safety analysis
Date: Tue, 20 May 2025 18:17:21 -0300	[thread overview]
Message-ID: <aCzxYS_knO4rokdi@x1> (raw)
In-Reply-To: <20250519224645.1810891-1-irogers@google.com>

On Mon, May 19, 2025 at 03:46:43PM -0700, Ian Rogers wrote:
> The pattern:
> ```
> if (x) {
>    lock(...)
> }
> block1;
> if (x) {
>    unlock(...)
> }
> ```
> defeats clang's -Wthread-safety analysis where it complains of locks
> held on one path and not another. Add helper functions for "block1"
> then restructure as:
> ```
> if (x) {
>    lock(...);
>    block1();
>    unlock(...);
> } else {
>    block1();
> }
> ```

Got the three in the tmp.perf-tools-next branch, will try and test it
further and then push it out to perf-tools-next.

Thanks,

- Arnalod

      parent reply	other threads:[~2025-05-20 21:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-19 22:46 [PATCH v1 1/3] perf dso: Minor refactor to allow Wthread-safety analysis Ian Rogers
2025-05-19 22:46 ` [PATCH v1 2/3] perf rwsem: Add thread-safety annotations Ian Rogers
2025-05-19 22:46 ` [PATCH v1 3/3] perf thread: Ensure comm_lock held for comm_list Ian Rogers
2025-05-20 21:17 ` Arnaldo Carvalho de Melo [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aCzxYS_knO4rokdi@x1 \
    --to=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=atrajeev@linux.vnet.ibm.com \
    --cc=chaitanyas.prakash@arm.com \
    --cc=howardchu95@gmail.com \
    --cc=irogers@google.com \
    --cc=james.clark@linaro.org \
    --cc=jolsa@kernel.org \
    --cc=justinstitt@google.com \
    --cc=kan.liang@linux.intel.com \
    --cc=langfei@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=morbo@google.com \
    --cc=namhyung@kernel.org \
    --cc=nathan@kernel.org \
    --cc=nick.desaulniers+lkml@gmail.com \
    --cc=peterz@infradead.org \
    --cc=stephen.s.brennan@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox