This is the mail archive of the libc-hacker@sourceware.org mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


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

network information caching


getaddrinfo was forever quite inefficient since it often had to had to
read network information to determine the sorting.  In a normal
process this information cannot be cached since it can change at any
time and there is no change counter.

nscd can track changes, though.  netlink provides a way for a
userlevel process to be notified about network configuration changes.
This is now used in git head.  In addition to optimizing the
getaddrinfo calls in nscd itself (i.e., the previous results are
reused if the network configuraiton hasn't changed), the information
is also exported to other processes using nscd's shared memory.

You now might see that many/most getaddrinfo calls won't need a single
system call.

The only minimal drawback is that the nscd cache and shared memory
layout changed.  nscd can transparently handle this.  It's just that
the cache content gets lost if a new nscd is launched.  That's all.

The code is lightly tested.


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