[<prev] [next>] [day] [month] [year] [list]
Message-ID: <aUnWFc_mILUDFavi@google.com>
Date: Mon, 22 Dec 2025 15:36:53 -0800
From: Namhyung Kim <namhyung@...nel.org>
To: Peter Zijlstra <peterz@...radead.org>, Ingo Molnar <mingo@...hat.com>
Cc: Arnaldo Carvalho de Melo <acme@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Jiri Olsa <jolsa@...nel.org>, Ian Rogers <irogers@...gle.com>,
Adrian Hunter <adrian.hunter@...el.com>,
James Clark <james.clark@...aro.org>,
linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [BUG] perf/core: Task stuck on global_ctx_data_rwsem
Added a subject prefix and CC LKML.
Thanks,
Namhyung
On Mon, Dec 22, 2025 at 03:34:23PM -0800, Namhyung Kim wrote:
> Hello,
>
> I got a report that a task is stuck in perf_event_exit_task() waiting
> for global_ctx_data_rwsem. On large systems, it'd have performance
> issues when it grabs the lock to iterate all threads in the system to
> allocate the context data. And it'd block task exit path which is
> problematic especially under memory pressure.
>
> perf_event_open
> perf_event_alloc
> attach_perf_ctx_data
> attach_global_ctx_data
> percpu_down_write (global_ctx_data_rwsem)
> for_each_process_thread
> alloc_task_ctx_data
> do_exit
> perf_event_exit_task
> percpu_down_read (global_ctx_data_rwsem)
>
> I think attach_global_ctx_data() should skip tasks with PF_EXITING and
> it'd be nice if perf_event_exit_task() could release the ctx_data
> unconditionally. But I'm not sure how to synchronize them properly.
>
> Any thoughts?
>
> Thanks,
> Namhyung
>
Powered by blists - more mailing lists