All of lore.kernel.org
 help / color / mirror / Atom feed
From: William Lee Irwin III <wli@holomorphy.com>
To: Albert Cahalan <albert@users.sf.net>
Cc: linux-kernel mailing list <linux-kernel@vger.kernel.org>
Subject: Re: /proc reliability & performance
Date: Thu, 16 Oct 2003 19:51:28 -0700	[thread overview]
Message-ID: <20031017025128.GA25291@holomorphy.com> (raw)
In-Reply-To: <1066356438.15931.125.camel@cube>

On Thu, Oct 16, 2003 at 10:07:18PM -0400, Albert Cahalan wrote:
> Tie directory readers to a task_struct (or to
> some of the PID tracking structs), so that
> a directory reader is on a list. When a task
> exits, move the list of directory readers on
> to a neighboring task.
> That is O(1) on task exit, and generally O(n)
> for the whole /proc or /proc/42/task read.
> It's O(1) per step of the read, excepting
> where multiple directory readers wind up at
> the same location.
> Another benefit is that it is reliable as
> long as tasks don't move around on the lists.
> Each task will appear at most once, and will
> appear exactly once if it doesn't start or
> exit during the directory scan.

Several other things have been tried.
(a) something mingo wrote I forgot the nature of
(b) a thing manfred wrote that recovers positions in hashtable
	collision chains by sorting them, with O(chain length)
	insertion
(c) a thing I wrote that turns the tasklist and pid_chains into
	rbtrees and uses the last-seen pid to seek in O(lg(n))
	time, and uses a routine to seek and fill buffers as a
	drop-in replacement for get_tgid_list()/get_tid_list().

I have a current implementation of (c), as well as a patch to
restore 2.4 semantics to proc_pid_statm() in O(1) time.


-- wli

  parent reply	other threads:[~2003-10-17  2:48 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-17  2:07 /proc reliability & performance Albert Cahalan
2003-10-17  2:34 ` Larry McVoy
2003-10-17  8:01   ` dada1
2003-10-17  9:10     ` David S. Miller
2003-10-17 14:46       ` Valdis.Kletnieks
2003-10-17 17:24       ` dada1
2003-10-17 23:48       ` Albert Cahalan
2003-10-18  6:35       ` Willy Tarreau
2003-10-18  6:38         ` David S. Miller
2003-10-17  2:51 ` William Lee Irwin III [this message]
2003-10-17  3:24 ` Brian McGroarty
2003-10-17  4:31   ` Albert Cahalan
2003-10-17  4:56     ` William Lee Irwin III
2003-10-17  8:21     ` David Rees
2003-10-17  7:40 ` Zan Lynx
2003-10-17  7:54   ` William Lee Irwin III

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=20031017025128.GA25291@holomorphy.com \
    --to=wli@holomorphy.com \
    --cc=albert@users.sf.net \
    --cc=linux-kernel@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.