public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
From: Ulrich Drepper <drepper@gmail.com>
To: libc-hacker@sourceware.org
Subject: network information caching
Date: Mon, 31 Oct 2011 06:01:00 -0000	[thread overview]
Message-ID: <CAOPLpQdG71yTsKfVxpa-PbafTbonAmj1+B-STzA_jU9yRTxYJQ@mail.gmail.com> (raw)

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.

                 reply	other threads:[~2011-10-31  6:01 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAOPLpQdG71yTsKfVxpa-PbafTbonAmj1+B-STzA_jU9yRTxYJQ@mail.gmail.com \
    --to=drepper@gmail.com \
    --cc=libc-hacker@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).