public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
From: David Mosberger <davidm@napali.hpl.hp.com>
To: Jakub Jelinek <jakub@redhat.com>
Cc: Roland McGrath <roland@redhat.com>,
	davidm@hpl.hp.com,
	GNU libc hackers <libc-hacker@sources.redhat.com>
Subject: Re: enabling caching for dl_iterate_phdr()
Date: Sat, 17 Jan 2004 01:51:00 -0000	[thread overview]
Message-ID: <16392.38158.910091.724717@napali.hpl.hp.com> (raw)
In-Reply-To: <20040116232931.GL6413@sunsite.ms.mff.cuni.cz>

>>>>> On Sat, 17 Jan 2004 00:29:31 +0100, Jakub Jelinek <jakub@redhat.com> said:

  Jakub> On Fri, Jan 16, 2004 at 04:57:26PM -0800, Roland McGrath wrote:
  >> > In any case, if a callback-based approach is preferred, I can live
  >> > with that, too.

  >> I don't claim it's the best interface.  But that is the approach that
  >> doesn't have other blocking issues right now.

  Jakub> How about extending struct dl_phdr_info and passing an counter in it
  Jakub> to dl_iterate_phdr's callback?
  Jakub> The structure can be extended at the end, because dl_iterate_phdr
  Jakub> passes its size to the callback as well.
  Jakub> The callback is called with dl_load_lock held, so the counter doesn't
  Jakub> even have to be atomic.
  Jakub> libgcc_s would just see if size includes the additional field in the
  Jakub> first callback, if yes, it would record that counter and on subsequent
  Jakub> dl_iterate_phdr call it would first check whether the counter did not
  Jakub> change and if it is the same, it could use cached info.

Sounds good to me.  I assume it'd be OK to have separate "additions"
and "removals" counters?  Only the latter is needed for avoiding stale
values in a cache, but the former helps performance, because
dl_iterate_phdr() can be stopped early if we know that the list didn't
change.

I'd be happy to prototype the necessary code, but at the moment, glibc
doesn't build for me on ia64 (it crashes in rpcgen).  I assume that's
due to the stuff Uli is working on.

	--david

  parent reply	other threads:[~2004-01-17  1:51 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <16387.9755.753294.37588@napali.hpl.hp.com>
2004-01-17  0:57 ` Roland McGrath
2004-01-17  1:39   ` Jakub Jelinek
2004-01-17  1:40     ` Roland McGrath
2004-01-17  1:51     ` David Mosberger [this message]
2004-01-22  0:35     ` David Mosberger
2004-01-22  8:39       ` Jakub Jelinek
2004-01-24  5:54         ` David Mosberger
2004-01-24 20:27           ` Ulrich Drepper
2004-01-26 21:48             ` David Mosberger
2004-01-26 22:39               ` Ulrich Drepper
2004-01-26 22:58                 ` Roland McGrath
2004-01-26 23:03                 ` David Mosberger
2003-12-16 19:55 David Mosberger
2003-12-23 22:24 ` Roland McGrath

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=16392.38158.910091.724717@napali.hpl.hp.com \
    --to=davidm@napali.hpl.hp.com \
    --cc=davidm@hpl.hp.com \
    --cc=jakub@redhat.com \
    --cc=libc-hacker@sources.redhat.com \
    --cc=roland@redhat.com \
    /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).