From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arnd Bergmann Date: Mon, 17 Apr 2006 02:07:23 +0000 Subject: Re: [PATCH 00/05] robust per_cpu allocation for modules Message-Id: <200604170407.26111.arnd@arndb.de> List-Id: References: <1145049535.1336.128.camel@localhost.localdomain> <200604161734.20256.arnd@arndb.de> <1145234750.27828.8.camel@localhost.localdomain> In-Reply-To: <1145234750.27828.8.camel@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit To: Steven Rostedt Cc: Paul Mackerras , Nick Piggin , LKML , Andrew Morton , Linus Torvalds , Ingo Molnar , Thomas Gleixner , Andi Kleen , Martin Mares , bjornw@axis.com, schwidefsky@de.ibm.com, benedict.gaster@superh.com, lethal@linux-sh.org, Chris Zankel , Marc Gauthier , Joe Taylor , David Mosberger-Tang , rth@twiddle.net, spyro@f2s.com, starvik@axis.com, tony.luck@intel.com, linux-ia64@vger.kernel.org, ralf@linux-mips.org, linux-mips@linux-mips.org, grundler@parisc-linux.org, parisc-linux@parisc-linux.org, linuxppc-dev@ozlabs.org, linux390@de.ibm.com, davem@davemloft.net, rusty@rustcorp.com.au Am Monday 17 April 2006 02:45 schrieb Steven Rostedt: > > - does not work in real mode, so percpu data can't be used > >   inside exception handlers on some architectures. > > This is probably a big issue.  I believe interrupt context in hrtimers > uses per_cpu variables. If it's just about hrtimers, it should be harmless, since they are run in softirq context. Even regular interrupt handlers are always called with paging enabled, otherwise you could not have them im modules. > > - memory consumption is rather high when PAGE_SIZE is large > > That's also something that I'm trying to solve.  To use the least amount > of memory and still have the performance. > > Now, I've also thought about allocating per_cpu and when a module is > loaded, reallocate more memory and copy it again.  Use something like > the kstopmachine to sync the system so that the CPUS don't update any > per_cpu variables while this is happening, so that things can't get out > of sync. I guess this breaks if someone holds a pointer to a per-cpu variable while a module gets loaded. Arnd <>< From mboxrd@z Thu Jan 1 00:00:00 1970 Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 17 Apr 2006 11:24:28 +0100 (BST) Received: from moutng.kundenserver.de ([212.227.126.183]:33791 "EHLO moutng.kundenserver.de") by ftp.linux-mips.org with ESMTP id S8133415AbWDQKYT convert rfc822-to-8bit (ORCPT ); Mon, 17 Apr 2006 11:24:19 +0100 Received: from [84.160.53.210] (helo=noname) by mrelayeu.kundenserver.de (node=mrelayeu7) with ESMTP (Nemesis), id 0ML2Dk-1FVJ8i0kPD-00038H; Mon, 17 Apr 2006 04:06:59 +0200 From: Arnd Bergmann To: Steven Rostedt Subject: Re: [PATCH 00/05] robust per_cpu allocation for modules Date: Mon, 17 Apr 2006 04:07:23 +0200 User-Agent: KMail/1.9.1 Cc: Paul Mackerras , Nick Piggin , LKML , Andrew Morton , Linus Torvalds , Ingo Molnar , Thomas Gleixner , Andi Kleen , Martin Mares , bjornw@axis.com, schwidefsky@de.ibm.com, benedict.gaster@superh.com, lethal@linux-sh.org, Chris Zankel , Marc Gauthier , Joe Taylor , David Mosberger-Tang , rth@twiddle.net, spyro@f2s.com, starvik@axis.com, tony.luck@intel.com, linux-ia64@vger.kernel.org, ralf@linux-mips.org, linux-mips@linux-mips.org, grundler@parisc-linux.org, parisc-linux@parisc-linux.org, linuxppc-dev@ozlabs.org, linux390@de.ibm.com, davem@davemloft.net, rusty@rustcorp.com.au References: <1145049535.1336.128.camel@localhost.localdomain> <200604161734.20256.arnd@arndb.de> <1145234750.27828.8.camel@localhost.localdomain> In-Reply-To: <1145234750.27828.8.camel@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8BIT Content-Disposition: inline Message-Id: <200604170407.26111.arnd@arndb.de> X-Provags-ID: kundenserver.de abuse@kundenserver.de login:bf0b512fe2ff06b96d9695102898be39 Return-Path: X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0) X-Orcpt: rfc822;linux-mips@linux-mips.org Original-Recipient: rfc822;linux-mips@linux-mips.org X-archive-position: 11128 X-ecartis-version: Ecartis v1.0.0 Sender: linux-mips-bounce@linux-mips.org Errors-to: linux-mips-bounce@linux-mips.org X-original-sender: arnd@arndb.de Precedence: bulk X-list: linux-mips Am Monday 17 April 2006 02:45 schrieb Steven Rostedt: > > - does not work in real mode, so percpu data can't be used > >   inside exception handlers on some architectures. > > This is probably a big issue.  I believe interrupt context in hrtimers > uses per_cpu variables. If it's just about hrtimers, it should be harmless, since they are run in softirq context. Even regular interrupt handlers are always called with paging enabled, otherwise you could not have them im modules. > > - memory consumption is rather high when PAGE_SIZE is large > > That's also something that I'm trying to solve.  To use the least amount > of memory and still have the performance. > > Now, I've also thought about allocating per_cpu and when a module is > loaded, reallocate more memory and copy it again.  Use something like > the kstopmachine to sync the system so that the CPUS don't update any > per_cpu variables while this is happening, so that things can't get out > of sync. I guess this breaks if someone holds a pointer to a per-cpu variable while a module gets loaded. Arnd <>< From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.177]) by ozlabs.org (Postfix) with ESMTP id A117967B26 for ; Mon, 17 Apr 2006 12:08:07 +1000 (EST) From: Arnd Bergmann To: Steven Rostedt Subject: Re: [PATCH 00/05] robust per_cpu allocation for modules Date: Mon, 17 Apr 2006 04:07:23 +0200 References: <1145049535.1336.128.camel@localhost.localdomain> <200604161734.20256.arnd@arndb.de> <1145234750.27828.8.camel@localhost.localdomain> In-Reply-To: <1145234750.27828.8.camel@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Message-Id: <200604170407.26111.arnd@arndb.de> Cc: Andrew Morton , linux-mips@linux-mips.org, David Mosberger-Tang , linux-ia64@vger.kernel.org, Martin Mares , spyro@f2s.com, Joe Taylor , Andi Kleen , linuxppc-dev@ozlabs.org, Paul Mackerras , benedict.gaster@superh.com, bjornw@axis.com, Ingo Molnar , Nick Piggin , grundler@parisc-linux.org, rusty@rustcorp.com.au, starvik@axis.com, Linus Torvalds , Thomas Gleixner , rth@twiddle.net, Chris Zankel , tony.luck@intel.com, LKML , ralf@linux-mips.org, Marc Gauthier , lethal@linux-sh.org, schwidefsky@de.ibm.com, linux390@de.ibm.com, davem@davemloft.net, parisc-linux@parisc-linux.org List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Am Monday 17 April 2006 02:45 schrieb Steven Rostedt: > > - does not work in real mode, so percpu data can't be used > > =C2=A0 inside exception handlers on some architectures. > > This is probably a big issue. =C2=A0I believe interrupt context in hrtime= rs > uses per_cpu variables. If it's just about hrtimers, it should be harmless, since they are run in softirq context. Even regular interrupt handlers are always called with paging enabled, otherwise you could not have them im modules. > > - memory consumption is rather high when PAGE_SIZE is large > > That's also something that I'm trying to solve. =C2=A0To use the least am= ount > of memory and still have the performance. > > Now, I've also thought about allocating per_cpu and when a module is > loaded, reallocate more memory and copy it again. =C2=A0Use something like > the kstopmachine to sync the system so that the CPUS don't update any > per_cpu variables while this is happening, so that things can't get out > of sync. I guess this breaks if someone holds a pointer to a per-cpu variable while a module gets loaded. Arnd <><