Was: Q: sys_perf_event_open() && PF_EXITING
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest2 patches 41 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | perf: fix find_get_context() vs perf_event_exit_task() racekernel/ | +20 | 9 replies | |
| 2/2 | perf: fix perf_event_init_task()/perf_event_free_task() interactionkernel/ | +4 | 2 replies |
Reviews trailers per patch
All 2 patches have a Reviewed-by or Acked-by.
| Patch | Peter Zijlstra |
|---|---|
| 1/2 | A-b A-b |
| 2/2 | A-b A-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH 0/2] Was: Q: sys_perf_event_open() && PF_EXITING
Quoted 8 lines · Oleg Nesterov
I am puzzled by
PF_EXITINGcheck infind_lively_task_by_vpid().How can it help? The task can call
do_exit()right after the check.And why do we need it? The comment only says "Can't attach events to a dying task". Maybe it tries protect
sys_perf_event_open()againstperf_event_exit_task_context(), but it can't.
Yes.
Please see 1/2. Well, I can't say I really like the idea to reuse task->perf_event_mutex, but I do not see a better fix.
Also, I have no idea how can I actually test the changes in the code I can hardly understand, please review.
Also. I believe there are more problems in perf_install_event(), but I need to recheck.
Quoted 4 lines
Hmm. jump_label_inc/dec looks obviously racy too. Say,
free_event()races withperf_event_alloc(). There is a window betweenatomic_xxx()andjump_label_update(), afaics it is possible to calljump_label_disable()when perf_task_events/perf_swevent_enabled != 0.
Another issue...
Oleg.