Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261471AbUKWUxk (ORCPT ); Tue, 23 Nov 2004 15:53:40 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261602AbUKWUwb (ORCPT ); Tue, 23 Nov 2004 15:52:31 -0500 Received: from omx3-ext.sgi.com ([192.48.171.20]:11651 "EHLO omx3.sgi.com") by vger.kernel.org with ESMTP id S261471AbUKWUls (ORCPT ); Tue, 23 Nov 2004 15:41:48 -0500 Message-ID: <41A3A0BC.9080006@sgi.com> Date: Tue, 23 Nov 2004 14:42:36 -0600 From: Ray Bryant User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.2) Gecko/20040805 Netscape/7.2 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Robin Holt CC: Kernel Mailing List , "linux-ia64@vger.kernel.org" , lse-tech , Dean Roe , Brian Sumner , John Hawkes Subject: Re: scalability of signal delivery for Posix Threads References: <41A20AF3.9030408@sgi.com> <20041122171932.GA19440@lnx-holt.americas.sgi.com> In-Reply-To: <20041122171932.GA19440@lnx-holt.americas.sgi.com> Content-Type: multipart/mixed; boundary="------------020803050208060509030506" Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4234 Lines: 177 This is a multi-part message in MIME format. --------------020803050208060509030506 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Robin Holt wrote: > > Ray, can you provide a simple example application that trips this case? > Robin, Attached is a pthreads program (y.c) that exercises the scaling problem discussed above. Compile this as: gcc y.c -o y -lpthread -lm Call it as: ./y nthread We start to see problems on Altix with this program at around 76 cpus. -- Best Regards, Ray ----------------------------------------------- Ray Bryant 512-453-9679 (work) 512-507-7807 (cell) raybry@sgi.com raybry@austin.rr.com The box said: "Requires Windows 98 or better", so I installed Linux. ----------------------------------------------- --------------020803050208060509030506 Content-Type: text/plain; name="y.c" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="y.c" #define _GNU_SOURCE #include #include #include #include #include #include #include #include #include #include #define NITER 100000000 #define perrorx(s) (perror(s), exit(1)) #define MAX_THREADS 512 #define CACHE_LINE_SIZE 128 #define __cache_aligned __attribute__((__aligned__(CACHE_LINE_SIZE))) static struct itimerval itv; /* this makes count a per thread variable */ static __thread unsigned volatile long count; pthread_t ptid[MAX_THREADS]; struct child_state_struct { int state; pid_t tid; long start_count; long end_count; double result; char filler[CACHE_LINE_SIZE - (sizeof(int)+sizeof(pid_t)+2*sizeof(long)+sizeof(double))]; }; struct child_state_struct child_state[MAX_THREADS] __cache_aligned; volatile int go __cache_aligned = 0; char filler[CACHE_LINE_SIZE - (sizeof(int))]; static void sigprof_handler(int signo, struct siginfo *sip, void *scp) { ++count; } void *func(void *arg) { int i, id = (int)(long)arg; double a = 0.1; pid_t tid; tid = syscall(__NR_gettid); child_state[id].tid = tid; child_state[id].state = 1; if (setitimer(ITIMER_PROF, &itv, 0) < 0) { fprintf(stderr, "Setitimer failed: %s\n", strerror(errno)); exit(1); } while(go<1); child_state[id].start_count = count; for (i=0;i