Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Wed, 18 Sep 2002 13:12:33 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Wed, 18 Sep 2002 13:12:33 -0400 Received: from mx1.elte.hu ([157.181.1.137]:22937 "HELO mx1.elte.hu") by vger.kernel.org with SMTP id ; Wed, 18 Sep 2002 13:12:31 -0400 Date: Wed, 18 Sep 2002 19:24:40 +0200 (CEST) From: Ingo Molnar Reply-To: Ingo Molnar To: Linus Torvalds Cc: Rik van Riel , Andries Brouwer , William Lee Irwin III , Subject: Re: [patch] lockless, scalable get_pid(), for_each_process() elimination, 2.5.35-BK In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1366 Lines: 35 On Wed, 18 Sep 2002, Linus Torvalds wrote: > And guys, if this is a performance problem for some extreme site, the > fix is truly trivial: > > echo $((0x7fffffff)) > /proc/sys/max_pid > > and you're done. it is a problem still. We can create/destroy 2 billion threads: venus:~> ./p3 -s 2000000 -t 10 -r 0 -T --sync-join Runtime: 19.889182138 seconds in roughly 5 hours, on bog-standard 2-CPU x86 hardware. Or in 1.25 hours on an 8-way box. And then we are back to step #1: trying to pass over already allocated PIDs by destroying the contents of the L1 and L2 cache once for each allocated PID passed. Sure, with 2 billion PIDs space that averages out, but it's an algorithm with a very nasty worst-case behavior, which is not so hard to trigger. Plus the not-so-unlikely case of having to pass a couple of tens of thousands of allocated PIDs, in a couple of minutes, with all user input blocked, and interrupts disabled, website silent. Obviously sites will not create threads at such a high rate as demonstrated above, so it will 'only' happen once every couple of days, or every couple of weeks. Ingo - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/