lkml.org 
[lkml]   [2021]   [May]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v7 13/22] sched: Allow task CPU affinity to be restricted on asymmetric systems
On Wed, May 26, 2021 at 06:02:06PM +0100, Will Deacon wrote:
> On Wed, May 26, 2021 at 06:30:08PM +0200, Peter Zijlstra wrote:
> > On Tue, May 25, 2021 at 04:14:23PM +0100, Will Deacon wrote:
> > > @@ -2426,20 +2421,166 @@ static int __set_cpus_allowed_ptr(struct task_struct *p,
> > >
> > > __do_set_cpus_allowed(p, new_mask, flags);
> > >
> > > - return affine_move_task(rq, p, &rf, dest_cpu, flags);
> > > + if (flags & SCA_USER)
> > > + release_user_cpus_ptr(p);
> > > +
> > > + return affine_move_task(rq, p, rf, dest_cpu, flags);
> > >
> > > out:
> > > - task_rq_unlock(rq, p, &rf);
> > > + task_rq_unlock(rq, p, rf);
> > >
> > > return ret;
> > > }
> >
> > So sys_sched_setaffinity() releases the user_cpus_ptr thingy ?! How does
> > that work?
>
> Right, I think if the task explicitly changes its affinity then it makes
> sense to forget about what it had before. It then behaves very similar to
> CPU hotplug, which is the analogy I've been trying to follow: if you call
> sched_setaffinity() with a mask containing offline CPUs then those CPUs
> are not added back to the affinity mask when they are onlined.

Oh right, crap semantics all the way down :/ I always forget how
horrible they are.

You're right though; this is consistent with the current mess.

\
 
 \ /
  Last update: 2021-05-27 09:58    [W:0.051 / U:0.556 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site