lkml.org 
[lkml]   [2022]   [Aug]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [RFC v2] perf: Rewrite core context handling
On Fri, Jun 17, 2022 at 03:36:51PM +0200, Peter Zijlstra wrote:
> On Mon, Jun 13, 2022 at 04:35:11PM +0200, Peter Zijlstra wrote:
> > +/* XXX: No need of list now. Convert it to per-cpu variable */
> > static DEFINE_PER_CPU(struct list_head, cgrp_cpuctx_list);
>
> Something like so I suppose...
>

I need this on top to avoid a spat on perf_cgroup_attach()

---


diff --git a/kernel/events/core.c b/kernel/events/core.c
index 0cd81a3ef374..c6b64a48dea6 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -13536,9 +13536,12 @@ static int perf_cgroup_css_online(struct cgroup_subsys_state *css)
static int __perf_cgroup_move(void *info)
{
struct task_struct *task = info;
- rcu_read_lock();
- perf_cgroup_switch(task);
- rcu_read_unlock();
+
+ preempt_disable();
+ if (atomic_read(this_cpu_ptr(&perf_cgroup_events)))
+ perf_cgroup_switch(task);
+ preempt_enable();
+
return 0;
}

\
 
 \ /
  Last update: 2022-08-24 12:15    [W:0.341 / U:0.080 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site