mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Yinghai Lu <Yinghai.Lu@Sun.COM>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	"David S. Miller" <davem@davemloft.net>
Subject: Re: [PATCH] mm: fix dma_poor_create
Date: Wed, 20 Feb 2008 07:52:30 +0100	[thread overview]
Message-ID: <20080220065230.GG7493@elte.hu> (raw)
In-Reply-To: <200802191845.28802.yinghai.lu@sun.com>


* Yinghai Lu <Yinghai.Lu@Sun.COM> wrote:

> dev_to_node could return node that without RAM. So check it before use 
> it in kmalloc_node

> -	retval = kmalloc_node(sizeof(*retval), GFP_KERNEL, dev_to_node(dev));
> +	node = dev_to_node(dev);
> +	if (node == -1 || !node_online(node))
> +		node = numa_node_id();
> +
> +	retval = kmalloc_node(sizeof(*retval), GFP_KERNEL, node);

so this is about not crashing during bootup on nodes that have CPUs but 
which have no node-specific memory attached, right?

Shouldnt kmalloc_node() be made more robust instead? I.e. push the same 
code into kmalloc_node() - and make sure it will allocate _something_? 
That would probably also fix a similar bug in net/core/skbuff.c's 
__netdev_alloc_skb(), which too passes a dev_to_node() result to an 
allocator.

	Ingo

  reply	other threads:[~2008-02-20  6:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-20  2:45 Yinghai Lu
2008-02-20  6:52 ` Ingo Molnar [this message]
2008-02-20  7:50   ` Yinghai Lu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080220065230.GG7493@elte.hu \
    --to=mingo@elte.hu \
    --cc=Yinghai.Lu@Sun.COM \
    --cc=akpm@linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®