lkml.org 
[lkml]   [2009]   [Oct]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC][PATCH] kmap_atomic_push
On Mon, Oct 12, 2009 at 11:30:07AM -0700, Linus Torvalds wrote:
>
>
> On Mon, 12 Oct 2009, Andi Kleen wrote:
>
> > Peter Zijlstra <peterz@infradead.org> writes:
> > > -
> > > -static inline void debug_kmap_atomic(enum km_type type)
> > > +static inline int kmap_atomic_push_idx(void)
> > > {
> > > + int idx = __get_cpu_var(__kmap_atomic_depth)++;
> >
> > The counter needs to be of local atomic type. Otherwise kmap_atomic cannot
> > be done from interrupts/nmis, which is unfortunately occasionally needed.
>
> I thought so too on lookin gat it initially, but it's not actually true.
>
> It's both IRQ and NMI safe as-is, for a very simple reason: any interrupts

Good point, thanks.

I was thinking of CPU migration in interrupt cases, but even there
it should be ok in mainline.

I suppose it's not true for the preempt-rt folks (who can migrate
CPUs at any time), so it might be still more friendly to handle it for them
though.

-Andi

--
ak@linux.intel.com -- Speaking for myself only.


\
 
 \ /
  Last update: 2009-10-12 20:49    [W:0.039 / U:0.104 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site