From wli@holomorphy.com Fri Aug 20 12:31:57 2004 Return-Path: X-Original-To: jbarnes@spamtin.engr.sgi.com Delivered-To: jbarnes@spamtin.engr.sgi.com Received: from ledzep.americas.sgi.com (ledzep.americas.sgi.com [192.48.203.134]) by spamtin.engr.sgi.com (Postfix) with ESMTP id AC2A724071E2 for ; Fri, 20 Aug 2004 09:33:23 -0700 (PDT) Received: from mx1.sgi.com (mx1.SGI.COM [192.48.168.24]) by ledzep.americas.sgi.com (8.12.9/8.12.10/SGI_generic_relay-1.2) with ESMTP id i7KGXMZO17767815 for ; Fri, 20 Aug 2004 11:33:23 -0500 (CDT) Received: from holomorphy.com (holomorphy.com [207.189.100.168]) by mx1.sgi.com (8.12.11/8.12.11/freebsd-nospam-3.3) with ESMTP id i7KGXD1E040105 for ; Fri, 20 Aug 2004 09:33:13 -0700 (PDT) Received: from wli by holomorphy.com with local (Exim 3.36 #1 (Debian)) id 1ByCJ3-0001j4-00; Fri, 20 Aug 2004 09:31:57 -0700 Date: Fri, 20 Aug 2004 09:31:57 -0700 From: William Lee Irwin III To: jbarnes@sgi.com Subject: flip-collate-loop.patch Message-ID: <20040820163157.GG11200@holomorphy.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Organization: The Domain of Holomorphy User-Agent: Mutt/1.5.6+20040722i X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on spamtin.engr.sgi.com X-Spam-Level: X-Spam-Status: No, hits=-4.9 required=5.0 tests=BAYES_00 autolearn=ham version=2.63 X-UID: 12358 Index: mm2-2.6.8.1/kernel/profile.c =================================================================== --- mm2-2.6.8.1.orig/kernel/profile.c 2004-08-19 15:11:40.000000000 -0700 +++ mm2-2.6.8.1/kernel/profile.c 2004-08-20 09:32:08.986630798 -0700 @@ -251,16 +251,15 @@ static void collate_per_cpu_profiles(void) { - unsigned long i; + int cpu; - for (i = 0; i < prof_len; ++i) { - int cpu; + memset(prof_buffer, 0, prof_len * sizeof(atomic_t)); + for_each_online_cpu(cpu) { + unsigned long i; + atomic_t *buf per_cpu(cpu_prof_buffer, cpu); - atomic_set(&prof_buffer[i], 0); - for_each_online_cpu(cpu) { - atomic_t *buf = per_cpu(cpu_prof_buffer, cpu); - atomic_add(atomic_read(&buf[i]), &prof_buffer[i]); - } + for (i = 0; i < prof_len; ++i) + prof_buffer[i].counter += atomic_read(&buf[i]); } }