Re: [RFC][PATCH 2/6] mm: stack based kmap_atomic

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 19 Aug 2010 22:13:19 +0200
Peter Zijlstra <a.p.zijlstra@xxxxxxxxx> wrote:

> Keep the current interface but ignore the KM_type and use a stack
> based approach.
> 
> Signed-off-by: Peter Zijlstra <a.p.zijlstra@xxxxxxxxx>
> ---
 
> +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 from this list: send the line "unsubscribe linux-arch" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel]     [Kernel Newbies]     [x86 Platform Driver]     [Netdev]     [Linux Wireless]     [Netfilter]     [Bugtraq]     [Linux Filesystems]     [Yosemite Discussion]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]

  Powered by Linux