public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Manfred Spraul <manfred@colorfullife.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [RFC] O(1) proc_pid_readdir
Date: Sun, 16 Mar 2003 22:24:34 +0100	[thread overview]
Message-ID: <3E74EB92.7010801@colorfullife.com> (raw)
In-Reply-To: <Pine.LNX.4.44.0303162203590.11399-100000@localhost.localdomain>

Ingo Molnar wrote:

>On Sun, 16 Mar 2003, Manfred Spraul wrote:
>
>  
>
>>Below is a proposal to get rid of the quadratic behaviour of
>>proc_pid_readir(): Instead of storing the task number in f_pos and
>>walking tasks by tasklist order, the pid is stored in f_pos and the
>>tasks are walked by (hash-mangled) pid order.
>>    
>>
>
>have you seen my "procfs/procps threading performance speedup" patch? It
>does something like this.
>
Interesting patch. Do seekdir and telldir still work? I think you must 
detect lseek calls and invalidate the cookie - either by hooking lseek 
or by looking at f_version.

I think my solution for proc_pid_readdir() is better: You must fall back 
to the old algorithm if the pid number stored in f_private got invalid 
between two syscalls. I've modified the hash table slightly and search 
for the next pid value directly, which works even if the current 
position disappeared.

--
    Manfred


  reply	other threads:[~2003-03-16 21:13 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-16 15:52 [RFC] O(1) proc_pid_readdir Manfred Spraul
2003-03-16 20:10 ` William Lee Irwin III
2003-03-16 21:05 ` Ingo Molnar
2003-03-16 21:24   ` Manfred Spraul [this message]
2003-03-16 21:35     ` William Lee Irwin III
2003-03-16 21:45       ` Manfred Spraul
2003-03-17  6:22       ` Ingo Molnar
2003-03-17  7:03         ` William Lee Irwin III
2003-03-17 18:17           ` Manfred Spraul
2003-03-18  0:14             ` William Lee Irwin III
2003-03-18  0:48               ` William Lee Irwin III
2003-03-18  1:22                 ` William Lee Irwin III
2003-03-18  9:25             ` William Lee Irwin III
2003-03-17  6:19     ` Ingo Molnar
2003-03-22 16:02   ` Manfred Spraul

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=3E74EB92.7010801@colorfullife.com \
    --to=manfred@colorfullife.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /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