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] [day] [month] [year] [list]
Message-ID: <20090209113410.GB18757@elte.hu>
Date:	Mon, 9 Feb 2009 12:34:10 +0100
From:	Ingo Molnar <mingo@...e.hu>
To:	Andrew Morton <akpm@...ux-foundation.org>
Cc:	Yinghai Lu <yinghai@...nel.org>, tglx@...utronix.de, hpa@...or.com,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] irq: optimize init_kstat_irqs/init_copy_kstat_irqs


* Andrew Morton <akpm@...ux-foundation.org> wrote:

> On Mon, 9 Feb 2009 09:37:39 +0100 Ingo Molnar <mingo@...e.hu> wrote:
> 
> > 
> > * Andrew Morton <akpm@...ux-foundation.org> wrote:
> > 
> > > On Mon, 9 Feb 2009 09:11:24 +0100 Ingo Molnar <mingo@...e.hu> wrote:
> > > 
> > > > 
> > > > * Andrew Morton <akpm@...ux-foundation.org> wrote:
> > > > 
> > > > > On Sat, 7 Feb 2009 01:01:03 -0800 Yinghai Lu <yinghai@...nel.org> wrote:
> > > > > 
> > > > > > 
> > > > > > add kzalloc_node_safe()?
> > > > > 
> > > > > I cannot find that function.
> > > > 
> > > > His suggestion is to provide that allocator variant.
> > > > 
> > > 
> > > Oh.
> > > 
> > > It isn't possible to write a kzalloc_node_safe(GFP_ATOMIC).  Or at
> > > least, we've never worked out a way.
> > > 
> > > Maybe I'm confused again.
> > 
> > Indeed - duh - more morning tea needed.
> > 
> > Yinghai, why are those allocations GFP_ATOMIC to begin with? These:
> > 
> > earth4:~/tip> grep GFP_ATOMIC kernel/irq/*.c
> > kernel/irq/handle.c:	ptr = kzalloc_node(nr * sizeof(*desc->kstat_irqs), GFP_ATOMIC, node);
> > kernel/irq/handle.c:	desc = kzalloc_node(sizeof(*desc), GFP_ATOMIC, node);
> > kernel/irq/manage.c:	action = kmalloc(sizeof(struct irqaction), GFP_ATOMIC);
> > 
> > Should all be GFP_KERNEL. Wherever they are within a spinlocked section the code 
> > should be restructured. All descriptor data structures should be preallocated at 
> > __setup_irq() time. If we ever need to allocate dynamically later on, in the middle 
> > of some difficult codepath that's a structure bug in the code.
> 
> yup, something along those lines.
> 
> > and this one:
> > 
> > kernel/irq/numa_migrate.c:	desc = kzalloc_node(sizeof(*desc), GFP_ATOMIC, node);
> > 
> > should fail the migration silently if GFP_ATOMIC returns NULL.
> 
> Silent failure sounds bad?
> 
> The allocation attempt will spew a page-allocation-failure backtrace
> anyway, so people will still get alarmed.
> 
> You might instead choose to suppress that warning with __GFP_NOWARN and
> instead add a more meaningful warning at the calling codesite.

Well this is a NUMA performance optimization that gets re-tried anyway, so
spewing anything because we are so low on RAM that we cannot fulfill
GFP_ATOMIC wont help things. Silence is better there i think. At most
a WARN_ONCE().

	Ingo
--
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