All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: Jonathan Cameron <jonathan.cameron@huawei.com>
Cc: "Dave Hansen" <dave.hansen@intel.com>,
	linux-pci@vger.kernel.org, x86@kernel.org, linuxarm@huawei.com,
	"Ingo Molnar" <mingo@kernel.org>,
	"Dave Hansen" <dave.hansen@linux.intel.com>,
	"Andy Lutomirski" <luto@kernel.org>,
	"Peter Zijlstra" <peterz@infradead.org>,
	"Martin Hundebøll" <martin@geanix.com>,
	"Linux Memory Management List" <linux-mm@kvack.org>,
	"ACPI Devel Mailing List" <linux-acpi@vger.kernel.org>
Subject: Re: [PATCH V2] x86: Fix an issue with invalid ACPI NUMA config
Date: Tue, 29 Jan 2019 15:10:15 -0600	[thread overview]
Message-ID: <20190129211015.GC91506@google.com> (raw)
In-Reply-To: <20190129194534.00004087@huawei.com>

On Tue, Jan 29, 2019 at 07:45:34PM +0000, Jonathan Cameron wrote:
> On Tue, 29 Jan 2019 13:05:56 -0600
> Bjorn Helgaas <helgaas@kernel.org> wrote:
> > On Tue, Jan 29, 2019 at 09:51:05AM +0000, Jonathan Cameron wrote:

> > > However, if there is NUMA description, but with bugs then we should
> > > protect in depth.  A simple example being that we declare 2 nodes, but
> > > then use _PXM for a third. I've done that by accident and blows up
> > > in a nasty fashion (not done it for a while, but probably still true).
> > > 
> > > Given DSDT is only parsed long after SRAT we can just check on _PXM
> > > queries.  Or I suppose we could do a verification parse for all _PXM
> > > entries and put out some warnings if they don't match SRAT entries?  
> > 
> > I'm assuming the crash happens when we call kmalloc_node() with a node
> > not mentioned in SRAT.  I think that's just sub-optimal implementation
> > in kmalloc_node().
> > 
> > We *could* fail the allocation and return a NULL pointer, but I think
> > even that is excessive.  I think we should simply fall back to
> > kmalloc().  We could print a one-time warning if that's useful.
> > 
> > If kmalloc_node() for an unknown node fell back to kmalloc(), would
> > anything else be required?
> 
> It will deal with that case, but it may not be the only one.  I
> think there are interrupt related issues as well, but will have to
> check.

Sounds like a valid concern.  Also, kmalloc() in general looks like a
performance path, so maybe it would be better to address this on the
other end, i.e., by ensuring that dev->numa_node always contains
something valid for kmalloc(), interrupts, etc.

Maybe set_dev_node() could be made smarter along that line?

Bjorn

  reply	other threads:[~2019-01-29 21:10 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-11  9:47 [PATCH V2] x86: Fix an issue with invalid ACPI NUMA config Jonathan Cameron
2018-12-11 18:19 ` Dave Hansen
2018-12-12  9:39   ` Jonathan Cameron
2018-12-20 15:12     ` Bjorn Helgaas
2018-12-20 17:13       ` Dave Hansen
2018-12-20 19:57         ` Bjorn Helgaas
2019-01-28 11:31           ` Jonathan Cameron
2019-01-28 11:31             ` Jonathan Cameron
2019-01-28 11:31             ` Jonathan Cameron
2019-01-28 23:13             ` Bjorn Helgaas
2019-01-29  9:51               ` Jonathan Cameron
2019-01-29 19:05                 ` Bjorn Helgaas
2019-01-29 19:45                   ` Jonathan Cameron
2019-01-29 21:10                     ` Bjorn Helgaas [this message]
2019-02-07 10:12                   ` Jonathan Cameron

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=20190129211015.GC91506@google.com \
    --to=helgaas@kernel.org \
    --cc=dave.hansen@intel.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=jonathan.cameron@huawei.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=luto@kernel.org \
    --cc=martin@geanix.com \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=x86@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.