This is the mail archive of the
mailing list for the glibc project.
Re: [glibc] Fix Linux sysconf(_SC_NPROCESSORS_[CONF|ONLN])performance problem
On Thu, Jun 16, 2011 at 14:07, Linus Torvalds
> But the caching is needed, because whatever the process wants, I
> guarantee that it doesn't want "slow and crappy".
And how do we find out when the system changes? CPUs can be added,
CPU masks can be changed, even from outside the process. Not everyone
will agree that updates to this information can be ignored.
I would be happy to use any new interface to get to this information
more quickly. Then we can do caching. This is no new thing. For
instance, we need a similar mechanism to make getaddrinfo acceptable
because currently we always have to pull the kernel data. This was
discussed a bit a long time ago and we discussed having a way to query
the kernel "has the configuration X been changed since Y", where X is
CPU settings, network interfaces, ... and Y is some timestamp.
Do you have interest in reviving that discussion?