[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160504150138.GR3430@twins.programming.kicks-ass.net>
Date: Wed, 4 May 2016 17:01:38 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Vineet Gupta <Vineet.Gupta1@...opsys.com>
Cc: Nicolas Pitre <nicolas.pitre@...aro.org>,
Andrew Morton <akpm@...ux-foundation.org>,
David Hildenbrand <dahi@...ux.vnet.ibm.com>,
Thomas Petazzoni <thomas.petazzoni@...e-electrons.com>,
Russell King <linux@....linux.org.uk>,
lkml <linux-kernel@...r.kernel.org>,
"linux-mm@...ck.org" <linux-mm@...ck.org>,
"linux-arch@...r.kernel.org" <linux-arch@...r.kernel.org>
Subject: Re: kmap_atomic and preemption
On Wed, May 04, 2016 at 02:16:11PM +0000, Vineet Gupta wrote:
> > static inline void *kmap_atomic(struct page *page)
> > {
> > preempt_disable();
> > pagefault_disable();
> > if (!PageHighMem(page))
> > return page_address(page);
> >
> > return __kmap_atomic(page);
> > }
>
> I actually want to return early for !PageHighMem and avoid the pointless 2
> LD-ADD-ST to memory for map and 2 LD-SUB-ST for unmap for regular pages for such
> cases.
So I'm fairly sure people rely on the fact you cannot have pagefault
inside a kmap_atomic().
But you could potentially get away with leaving preemption enabled. Give
it a try, see if something goes *bang* ;-)
Powered by blists - more mailing lists