This is the mail archive of the mailing list for the glibc project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [glibc] Fix Linux sysconf(_SC_NPROCESSORS_[CONF|ONLN])performance problem

Am Fri, 17 Jun 2011 08:14:00 +0000
schrieb Klaus Dittrich <>:

> Am 06/16/11 20:25, schrieb Linus Torvalds:
> > On Thu, Jun 16, 2011 at 1:04 PM, Paul Eggert<>
> > wrote:
> >>
> >> "Stale" could mean "the tv_sec value doesn't match", or it could
> >> be something fancier; I doubt whether it matters much.
> >
> > I certainly think that would be a lot better than what glibc does
> > now
> > - at least limiting the /proc/stat reading to a maximum of once per
> > second or similar.
> >
> > And it could be combined with the patch I just sent out (which ends
> > up parsing /sys/devices/system/cpu/online every time. It's a
> > cheaper (and more obvious) file than /proc/stat, but it's still not
> > zero-cost.
> >
> >                         Linus
> As, at least today, most users run with a constant number of cpus,
> how about a configure option like num_of_cpus_may_vary in either
> kernel or glibc.
> This would give the time to discuss calmly a better solution for the
> others.

That's not a valid option for distribution packagers that don't know
where the packages will be used. It needs to be done by either
detecting this automatically or by a user configuration. Not at compile


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]