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()
On Wed, Oct 04, 2023 at 03:52:36PM +0200, Peter Zijlstra wrote:
> On Wed, Oct 04, 2023 at 02:34:15PM +0200, Florian Weimer wrote:
> > * Peter Zijlstra:
> >
> > > Subject: sched: Add CPU_FILL()
> > >
> > > Add the CPU_FILL() macros to easily create an all-set cpumask.
> > >
> > > FreeBSD also provides this macro with this semantic.
> > >
> > > Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
> >
> > My main concer is that obtaining the size of the mask, or at least an
> > approximiation is not exactly easy. If there's an expectation that
> > applications reset the mask more often than they do today (I don't have
> > the full context here),

Well, the only time a reset is useful, is if they first set an affinity.
So on the whole, you need the mask size thing solved either way around,
you need it for setting and then re-setting.

> > then we'd some decent interface to get the
> > approriate size.
>
> Isn't sysconf(_SC_NPROCESSORS_CONF) the right number ?

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