From: David Vrabel <david.vrabel@citrix.com>
To: David Vrabel <david.vrabel@citrix.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Jens Axboe <axboe@kernel.dk>,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] block: initialize the bounce pool if high memory may be added later
Date: Thu, 20 Oct 2011 16:27:24 +0100 [thread overview]
Message-ID: <4EA03DDC.9070808@citrix.com> (raw)
In-Reply-To: <1318334018-3312-1-git-send-email-david.vrabel@citrix.com>
On 11/10/11 12:53, David Vrabel wrote:
> init_emergency_pool() does not create the page pool for bouncing block
> requests if the current count of high pages is zero. If high memory
> may be added later (either via memory hotplug or a balloon driver in a
> virtualized system) then a oops occurs if a request with a high page
> need bouncing because the pool does not exist.
>
> So, always create the pool if memory hotplug is enabled and change the
> test so it's valid even if all high pages are currently in the balloon
> (the balloon drivers adjust totalhigh_pages but not max_pfn).
Jens, you don't seem to have picked up this patch yet. Should it have
gone via Andrew Morton instead?
David
> Signed-off-by: David Vrabel <david.vrabel@citrix.com>
> ---
> mm/bounce.c | 9 ++++-----
> 1 files changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/mm/bounce.c b/mm/bounce.c
> index 1481de6..434fb4f 100644
> --- a/mm/bounce.c
> +++ b/mm/bounce.c
> @@ -14,6 +14,7 @@
> #include <linux/init.h>
> #include <linux/hash.h>
> #include <linux/highmem.h>
> +#include <linux/bootmem.h>
> #include <asm/tlbflush.h>
>
> #include <trace/events/block.h>
> @@ -26,12 +27,10 @@ static mempool_t *page_pool, *isa_page_pool;
> #ifdef CONFIG_HIGHMEM
> static __init int init_emergency_pool(void)
> {
> - struct sysinfo i;
> - si_meminfo(&i);
> - si_swapinfo(&i);
> -
> - if (!i.totalhigh)
> +#ifndef CONFIG_MEMORY_HOTPLUG
> + if (max_pfn <= max_low_pfn)
> return 0;
> +#endif
>
> page_pool = mempool_create_page_pool(POOL_SIZE, 0);
> BUG_ON(!page_pool);
next prev parent reply other threads:[~2011-10-20 15:27 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-11 11:53 David Vrabel
2011-10-20 15:27 ` David Vrabel [this message]
2011-10-20 19:21 ` Jens Axboe
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=4EA03DDC.9070808@citrix.com \
--to=david.vrabel@citrix.com \
--cc=akpm@linux-foundation.org \
--cc=axboe@kernel.dk \
--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
Powered by JetHome