From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20588 invoked by alias); 18 Oct 2006 00:05:23 -0000 Received: (qmail 20581 invoked by uid 22791); 18 Oct 2006 00:05:23 -0000 X-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mga01.intel.com (HELO mga01.intel.com) (192.55.52.88) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 18 Oct 2006 00:05:19 +0000 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by mga01.intel.com with ESMTP; 17 Oct 2006 17:05:16 -0700 Received: from orsmsx334.jf.intel.com ([10.22.226.45]) by fmsmga001.fm.intel.com with ESMTP; 17 Oct 2006 17:05:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: i="4.09,321,1157353200"; d="scan'208"; a="148024206:sNHT2686775630" Received: from orsmsx419.amr.corp.intel.com ([10.22.226.88]) by orsmsx334.jf.intel.com with Microsoft SMTPSVC(6.0.3790.1830); Tue, 17 Oct 2006 17:04:57 -0700 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: [PATCH]_stp_free_percpu function definition responding to _stp_alloc_percpu Date: Wed, 18 Oct 2006 00:05:00 -0000 Message-ID: <8A3E977AB3C24845947ADAAE0526E395CB8D28@orsmsx419.amr.corp.intel.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PATCH]_stp_free_percpu function definition responding to _stp_alloc_percpu thread-index: AcbxE3IQmw7ncP/BRBGRUHD5S5wUkABNPqEg From: "Keshavamurthy, Anil S" To: "Mao, Bibo" , X-OriginalArrivalTime: 18 Oct 2006 00:04:57.0462 (UTC) FILETIME=[0C01D960:01C6F249] X-IsSubscribed: yes Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org X-SW-Source: 2006-q4/txt/msg00148.txt.bz2 Will this not break the older kernels?=20 How can systemtap makes sure that it is=20 backward compatible while supporting newer kernels? -Anil Keshavamurthy Open Source Technology Center/SSG Intel Corp. -----Original Message----- From: systemtap-owner@sourceware.org [mailto:systemtap-owner@sourceware.org] On Behalf Of bibo,mao Sent: Monday, October 16, 2006 4:08 AM To: systemtap@sourceware.org Subject: [PATCH]_stp_free_percpu function definition responding to _stp_alloc_percpu Hi, On the newest 2.6.19-rc2 smp machines, stap fails to run. It is because _stp_free_percpu is defined as free_percpu macro and one function at the same time. This patch modifies this, and replaces for_each_cpu with for_each_possible_cpu macro. thanks bibo,mao --- src.org/runtime/alloc.c 2006-01-25 18:08:47.000000000 +0800 +++ src/runtime/alloc.c 2006-10-16 18:17:40.000000000 +0800 @@ -18,14 +18,9 @@ #define kmalloc_node(size,flags,node) kmalloc(size,flags) #endif /* LINUX_VERSION_CODE */ -#ifdef CONFIG_SMP -#define _stp_free_percpu(ptr) free_percpu(ptr) -#else -#define _stp_free_percpu(ptr) kfree(ptr) -#endif - #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,15) #define _stp_alloc_percpu(size) __alloc_percpu(size, 8) +#define _stp_free_percpu(ptr) free_percpu(ptr) #else #ifdef CONFIG_SMP /* This is like alloc_percpu() except it simply takes a size, instead=20 of a type. */ @@ -37,7 +32,7 @@ void *_stp_alloc_percpu(size_t size) if (!pdata) return NULL; - for_each_cpu(i) { + for_each_possible_cpu(i) { int node =3D cpu_to_node(i); if (node_online(node)) @@ -68,7 +63,7 @@ void _stp_free_percpu(const void *objp) int i; struct percpu_data *p =3D (struct percpu_data *) (~(unsigned long) objp); - for_each_cpu(i) + for_each_possible_cpu(i) kfree(p->ptrs[i]); kfree(p); } @@ -80,6 +75,7 @@ void *_stp_alloc_percpu(size_t size) memset(ret, 0, size); return ret; } +#define _stp_free_percpu(ptr) kfree(ptr) #endif /* CONFIG_SMP */ #endif /* LINUX_VERSION_CODE */ #endif /* _ALLOC_C_ */