lkml.org 
[lkml]   [2023]   [Oct]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v4] sched/core: Use zero length to reset cpumasks in sched_setaffinity()

* Peter Zijlstra <peterz@infradead.org> wrote:

> On Wed, Oct 04, 2023 at 11:23:41AM +0200, Ingo Molnar wrote:
>
> > > if (user_mask) {
> > > - cpumask_copy(user_mask, in_mask);
> > > + /*
> > > + * All-set user cpumask resets affinity and drops the explicit
> > > + * user mask.
> > > + */
> > > + cpumask_and(user_mask, in_mask, cpu_possible_mask);
> > > + if (cpumask_equal(user_mask, cpu_possible_mask)) {
> > > + kfree(user_mask);
> > > + user_mask = NULL;
> > > + }
> >
> > Question: is there any observable behavioral difference between current
> > (old) all-set cpumask calls and the patched (new) one?
>
> Very little I think -- the main difference is that we no longer carry
> the ->user_cpus_ptr mask around, and that saves a little masking.

So calling with a full mask would actually work fine on 'old' kernels too,
as it's a 'reset' event in essence. (With a bit of allocation & masking
overhead.)

This pretty unambiguously marks the full-mask solution as the superior ABI ...

Thanks,

Ingo

\
 
 \ /
  Last update: 2023-10-04 12:07    [W:0.053 / U:0.152 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site