From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail138.messagelabs.com (mail138.messagelabs.com [216.82.249.35]) by kanga.kvack.org (Postfix) with SMTP id DFBFE6008D8 for ; Tue, 24 Aug 2010 03:29:31 -0400 (EDT) Received: from m3.gw.fujitsu.co.jp ([10.0.50.73]) by fgwmail7.fujitsu.co.jp (Fujitsu Gateway) with ESMTP id o7O7TTlq030307 for (envelope-from kamezawa.hiroyu@jp.fujitsu.com); Tue, 24 Aug 2010 16:29:29 +0900 Received: from smail (m3 [127.0.0.1]) by outgoing.m3.gw.fujitsu.co.jp (Postfix) with ESMTP id 2419445DE51 for ; Tue, 24 Aug 2010 16:29:29 +0900 (JST) Received: from s3.gw.fujitsu.co.jp (s3.gw.fujitsu.co.jp [10.0.50.93]) by m3.gw.fujitsu.co.jp (Postfix) with ESMTP id 0212145DE4E for ; Tue, 24 Aug 2010 16:29:29 +0900 (JST) Received: from s3.gw.fujitsu.co.jp (localhost.localdomain [127.0.0.1]) by s3.gw.fujitsu.co.jp (Postfix) with ESMTP id D47181DB803C for ; Tue, 24 Aug 2010 16:29:28 +0900 (JST) Received: from m106.s.css.fujitsu.com (m106.s.css.fujitsu.com [10.249.87.106]) by s3.gw.fujitsu.co.jp (Postfix) with ESMTP id 94E891DB8038 for ; Tue, 24 Aug 2010 16:29:28 +0900 (JST) Date: Tue, 24 Aug 2010 16:24:27 +0900 From: KAMEZAWA Hiroyuki Subject: Re: [RFC][PATCH 2/6] mm: stack based kmap_atomic Message-Id: <20100824162427.58e2eb88.kamezawa.hiroyu@jp.fujitsu.com> In-Reply-To: <20100819202753.656285068@chello.nl> References: <20100819201317.673172547@chello.nl> <20100819202753.656285068@chello.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org To: Peter Zijlstra Cc: Linus Torvalds , Andrew Morton , Ingo Molnar , Thomas Gleixner , "H. Peter Anvin" , Russell King , David Howells , Ralf Baechle , David Miller , Paul Mackerras , Benjamin Herrenschmidt , Hugh Dickins , linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-arch@vger.kernel.org List-ID: On Thu, 19 Aug 2010 22:13:19 +0200 Peter Zijlstra wrote: > Keep the current interface but ignore the KM_type and use a stack > based approach. > > Signed-off-by: Peter Zijlstra > --- > +DECLARE_PER_CPU(int, __kmap_atomic_idx); > + > +static inline int kmap_atomic_idx_push(void) > +{ > + int idx = __get_cpu_var(__kmap_atomic_idx)++; > +#ifdef CONFIG_DEBUG_HIGHMEM > + BUG_ON(idx > KM_TYPE_NR); > +#endif > + return idx; > +} > + > +static inline int kmap_atomic_idx_pop(void) > +{ > + int idx = --__get_cpu_var(__kmap_atomic_idx); > +#ifdef CONFIG_DEBUG_HIGHMEM > + BUG_ON(idx < 0); > +#endif > + return idx; > +} > + > #else /* CONFIG_HIGHMEM */ > I may don't understand anything... Is irq already disabled ? And Is it documented that kmap_atomic shouln't be used under NMI or something special interrupts ? Thanks, -Kame -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org