lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 07 May 2010 14:52:54 +0200
From:	Peter Zijlstra <peterz@...radead.org>
To:	Tetsuo Handa <penguin-kernel@...ove.SAKURA.ne.jp>
Cc:	xiaosuo@...il.com, akpm@...ux-foundation.org,
	eric.dumazet@...il.com, jslaby@...e.cz, viro@...iv.linux.org.uk,
	paulmck@...ux.vnet.ibm.com, adobriyan@...il.com, mingo@...e.hu,
	linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
	avi@...hat.com
Subject: Re: [RFC] mm: generic adaptive large memory allocation APIs

On Fri, 2010-05-07 at 21:42 +0900, Tetsuo Handa wrote:
> Changli Gao wrote:
> > static void __kvfree(void *ptr, bool inatomic)
> 
> inatomic might be confusing because what vfree() checks is
> BUG_ON(in_interrupt()) rather than BUG_ON(in_atomic()).
> 
> > {
> >         if (unlikely(ZERO_OR_NULL_PTR(ptr)))
> >                 return;
> >         if (is_vmalloc_addr(ptr)) {
> >                 if (inatomic) {
> 
> By the way, is in_interrupt() a heavy operation?
> 
>   register unsigned long current_stack_pointer asm("esp") __used;
>   static inline struct thread_info *current_thread_info(void)
>   {
>   	return (struct thread_info *)
>   		(current_stack_pointer & ~(THREAD_SIZE - 1));
>   }
>   #define preempt_count() (current_thread_info()->preempt_count)
>   #define irq_count()     (preempt_count() & (HARDIRQ_MASK | SOFTIRQ_MASK | NMI_MASK))
>   #define in_interrupt()  (irq_count())
> 
> If we can agree on changing from (inatomic) to (in_interrupt()),
> we can merge kvfree() and kvfree_inatomic().

I really dislike all of that, just don't allow usage from interrupt
context.



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ