User: Password:
Subscribe / Log in / New account

Add a sysconf syscall

From:  Andi Kleen <>
Subject:  Add a sysconf syscall
Date:  Fri, 13 May 2011 16:24:14 -0700
Message-ID:  <>
Archive-link:  Article

We ran into some problems with programs querying then number
of processors at startup through sysconf. This calls into /proc
from glibc, which is quite slow and scales poorly if the program
is frequently executed. This happens with programs using
Sleepycat DB for example.

While there are worarounds -- like using sched_getaffinity --
they don't have quite equivalent semantics.

This patchkit adds a sysconf() syscall to the kernel that allows
to get this information much faster. It only implements a subset
of sysconf() -- all the information the kernel knows usefully

Another advantage is that the kernel can in several cases offer
more accurate information than glibc, which has to guess.

The syscall is quite compat and not a significant burden.

In addition I did a few cleanups first to export all the information
needed by sysconf clearly from other subsystems.


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

Copyright © 2011, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds