linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Matt Fleming <matt@codeblueprint.co.uk>
To: Dave Young <dyoung@redhat.com>
Cc: "Nicolai Stange" <nicstange@gmail.com>,
	"Ard Biesheuvel" <ard.biesheuvel@linaro.org>,
	"Thomas Gleixner" <tglx@linutronix.de>,
	"Ingo Molnar" <mingo@redhat.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	x86@kernel.org, linux-efi@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	"Mika Penttilä" <mika.penttila@nextfour.com>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	linux-mm@kvack.org, "Vlastimil Babka" <vbabka@suse.cz>,
	"Michal Hocko" <mhocko@suse.cz>,
	"Mel Gorman" <mgorman@techsingularity.net>
Subject: Re: [PATCH v2 2/2] efi: efi_mem_reserve(): don't reserve through memblock after mm_init()
Date: Mon, 9 Jan 2017 11:44:00 +0000	[thread overview]
Message-ID: <20170109114400.GF16838@codeblueprint.co.uk> (raw)
In-Reply-To: <20170105091242.GA11021@dhcp-128-65.nay.redhat.com>

On Thu, 05 Jan, at 05:12:42PM, Dave Young wrote:
> On 12/22/16 at 11:23am, Nicolai Stange wrote:
> > Before invoking the arch specific handler, efi_mem_reserve() reserves
> > the given memory region through memblock.
> > 
> > efi_mem_reserve() can get called after mm_init() though -- through
> > efi_bgrt_init(), for example. After mm_init(), memblock is dead and should
> > not be used anymore.
> 
> It did not fail during previous test so we did not catch this bug, if memblock
> can not be used after mm_init(), IMHO it should fail instead of silently succeed.
 
This must literally be the fifth time or so that I've been caught out
by this over the years because there's no hard error if you call the
memblock code after slab and co. are up.

MM folks, is there some way to catch these errors without requiring
the sprinkling of slab_is_available() everywhere?

> Matt, can we move the efi_mem_reserve to earlier code for example in
> efi_memblock_x86_reserve_range just after reserving the memmap?
 
No, it *needs* to be callable from efi_bgrt_init(), because you only
want to reserve those regions if you have the BGRT driver available.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

       reply	other threads:[~2017-01-09 11:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20161222102340.2689-1-nicstange@gmail.com>
     [not found] ` <20161222102340.2689-2-nicstange@gmail.com>
     [not found]   ` <20170105091242.GA11021@dhcp-128-65.nay.redhat.com>
2017-01-09 11:44     ` Matt Fleming [this message]
2017-01-09 13:31       ` Mel Gorman
2017-01-09 13:45         ` Matt Fleming
2017-02-27 21:57         ` Matt Fleming
2017-01-10  0:37       ` Dave Young
2017-01-10 12:51         ` Matt Fleming
2017-01-11  8:04           ` Dave Young

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=20170109114400.GF16838@codeblueprint.co.uk \
    --to=matt@codeblueprint.co.uk \
    --cc=akpm@linux-foundation.org \
    --cc=ard.biesheuvel@linaro.org \
    --cc=dyoung@redhat.com \
    --cc=hpa@zytor.com \
    --cc=linux-efi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@techsingularity.net \
    --cc=mhocko@suse.cz \
    --cc=mika.penttila@nextfour.com \
    --cc=mingo@redhat.com \
    --cc=nicstange@gmail.com \
    --cc=tglx@linutronix.de \
    --cc=vbabka@suse.cz \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox