public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: William Lee Irwin III <wli@holomorphy.com>
To: Andries Brouwer <aebr@win.tue.nl>
Cc: Ingo Molnar <mingo@elte.hu>,
	Linus Torvalds <torvalds@transmeta.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [patch] lockless, scalable get_pid(), for_each_process() elimination, 2.5.35-BK
Date: Wed, 18 Sep 2002 13:29:14 -0700	[thread overview]
Message-ID: <20020918202914.GA3530@holomorphy.com> (raw)
In-Reply-To: <20020918201134.GC14629@win.tue.nl>

On Wed, Sep 18, 2002 at 09:00:37PM +0200, Ingo Molnar wrote:
>> If you think you can outrun this O(N^2) algorithm

On Wed, Sep 18, 2002 at 10:11:34PM +0200, Andries Brouwer wrote:
> Last month or so I already showed how to make it O(N log N).
> (Also without any new data structures.)
> But there is no hurry. The constant in your O(N^2) is very
> small, since in reality it is better than O(N^2 / pid_max).
> Really, now that pid_max is large, there is no problem with get_pid.

I've seen no change in behavior with large PID_MAX. Your argument based
on sparse spaces is not empirically demonstrable. What is empirically
demonstrable are my NMI oopses, the bug reports I've had sitting around
since before 2.5 opened that are still an issue, and Ingo's actual timings.


On Wed, Sep 18, 2002 at 10:11:34PM +0200, Andries Brouwer wrote:
> Much more interesting is thinking about for_each_task.
> In a number of places we search for all tasks with a certain property.
> It would be nice to arrange things in such a way that these
> are found in some efficient way so that not the entire task list
> is searched.

Um, the original name of this patch was -for_each_task, and that's
precisely what it was intended to do. Check the file creation times
(and filenames) of the patches in

ftp://ftp.kernel.org/pub/linux/kernel/people/wli/task_mgmt/

It furthermore had the more general intent of removing exhaustive
searches not using the for_each_task() macro, of which the hotly
debated get_pid() was an instance.

I never did quite finish it, which is why Ingo had to step in and give
it a big push.


On Wed, Sep 18, 2002 at 10:11:34PM +0200, Andries Brouwer wrote:
> For ordinary Unix semantics we need to be able to find all tasks
> with a given p->pgrp or p->session or p->pid or p->uid or p->tty.
> Some kernel routines come with a given pointer tsk and want p == tsk.
> Some places need p->mm or p->mm->context or CTX_HWBITS(p->mm->context)

It doesn't sound like you read the patch at all.


On Wed, Sep 18, 2002 at 10:11:34PM +0200, Andries Brouwer wrote:
> In procfs we have a very quadratic algorithm in proc_pid_readdir()/
> get_pid_list(). Not a potential hiccup after 2^30 processes that some
> may want to smoothe, but every single "ls /proc" or "ps".
> What shall we do with /proc for all these people with 10^5 processes?
> Andries

That is actually one of the easiest ways to take out one of my machines
while it's running 10K or so tasks, mentioned a bit ago in this thread.
It also renders performance monitoring of benchmarks, customer
workloads, etc. very difficult.


Bill

  reply	other threads:[~2002-09-18 20:29 UTC|newest]

Thread overview: 82+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-17 23:06 [patch] lockless, scalable get_pid(), for_each_process() elimination, 2.5.35-BK Ingo Molnar
2002-09-18  0:22 ` William Lee Irwin III
2002-09-18  1:27   ` David S. Miller
2002-09-18  2:22     ` William Lee Irwin III
2002-09-18 10:11   ` Ingo Molnar
2002-09-18 14:28     ` William Lee Irwin III
2002-09-18 12:32 ` Andries Brouwer
2002-09-18 12:56   ` Ingo Molnar
2002-09-18 16:17     ` Linus Torvalds
2002-09-18 16:46       ` Ingo Molnar
2002-09-18 16:57       ` Ingo Molnar
2002-09-18 18:28     ` Andries Brouwer
2002-09-18 18:27       ` William Lee Irwin III
2002-09-18 19:00       ` Ingo Molnar
2002-09-18 20:11         ` Andries Brouwer
2002-09-18 20:29           ` William Lee Irwin III [this message]
2002-09-18 21:15             ` Andries Brouwer
2002-09-19  3:05               ` Ingo Molnar
2002-09-19 13:11                 ` Andries Brouwer
2002-09-21 12:56                   ` quadratic behaviour Andries Brouwer
2002-09-21 17:06                     ` Linus Torvalds
2002-09-21 17:35                       ` William Lee Irwin III
2002-09-21 17:49                       ` Ingo Molnar
2002-09-21 17:46                         ` William Lee Irwin III
2002-09-18 14:49   ` [patch] lockless, scalable get_pid(), for_each_process() elimination, 2.5.35-BK William Lee Irwin III
2002-09-18 15:01     ` Cort Dougan
2002-09-18 15:33       ` Ingo Molnar
2002-09-18 15:31         ` yodaiken
2002-09-18 15:35         ` Cort Dougan
2002-09-18 15:37       ` Rik van Riel
2002-09-18 15:50       ` Alan Cox
2002-09-18 18:31     ` Andries Brouwer
2002-09-18 18:32       ` William Lee Irwin III
2002-09-18 16:15   ` Linus Torvalds
2002-09-18 16:32     ` Rik van Riel
2002-09-18 16:48       ` Linus Torvalds
2002-09-18 17:31         ` Ingo Molnar
2002-09-18 21:46         ` Rogier Wolff
2002-09-18 16:41     ` Ingo Molnar
2002-09-18 16:45       ` William Lee Irwin III
2002-09-18 16:59         ` Linus Torvalds
2002-09-18 17:36         ` Ingo Molnar
2002-09-18 17:36           ` William Lee Irwin III
2002-09-18 17:46             ` Linus Torvalds
2002-09-18 17:47               ` William Lee Irwin III
2002-09-18 17:59             ` Ingo Molnar
2002-09-18 17:50               ` William Lee Irwin III
2002-09-18 18:07                 ` Ingo Molnar
2002-09-19 19:27           ` Martin Mares
2002-09-17 15:31             ` Pavel Machek
2002-09-19 20:07             ` Richard B. Johnson
2002-09-18 16:46     ` Rik van Riel
2002-09-18 16:53       ` Linus Torvalds
2002-09-18 17:00         ` Rik van Riel
2002-09-18 17:16           ` Linus Torvalds
2002-09-18 17:28             ` Ingo Molnar
2002-09-18 17:38           ` Ingo Molnar
2002-09-18 17:24         ` Ingo Molnar
2002-09-18 17:30           ` Linus Torvalds
2002-09-18 17:35             ` Cort Dougan
2002-09-18 17:43               ` Rik van Riel
2002-09-18 17:48               ` Martin J. Bligh
2002-09-18 17:57                 ` Cort Dougan
2002-09-18 18:08                   ` Martin J. Bligh
2002-09-18 18:28                     ` Ingo Molnar
2002-09-18 18:33                       ` Linus Torvalds
2002-09-18 18:51                         ` Ingo Molnar
2002-09-18 18:56                           ` interruptible_sleep_on_timeout() and signals Imran Badr
2002-09-19  7:16                             ` David Woodhouse
2002-09-18 19:53                       ` [patch] lockless, scalable get_pid(), for_each_process() elimination, 2.5.35-BK Martin J. Bligh
2002-09-22  0:34                   ` Andrea Arcangeli
2002-09-22 10:02                     ` Ingo Molnar
2002-09-22 15:27                       ` Andrea Arcangeli
2002-09-18 18:02               ` Ingo Molnar
2002-09-18 17:58                 ` Cort Dougan
2002-09-18 18:14                   ` Ingo Molnar
2002-09-18 17:54             ` Alan Cox
2002-09-18 17:54             ` Ingo Molnar
2002-09-18 18:00               ` yodaiken
2002-09-18 18:21                 ` Ingo Molnar
2002-09-18 18:33                   ` yodaiken
2002-09-18 16:55     ` Alan Cox

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=20020918202914.GA3530@holomorphy.com \
    --to=wli@holomorphy.com \
    --cc=aebr@win.tue.nl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=torvalds@transmeta.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