linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: linux-kernel@vger.kernel.org, rjw@sisk.pl, xen-devel@lists.xensource.com
Subject: Re: Bootup regression introduced by 7bd0b0f0da3b1ec11cbcc798eb0ef747a1184077 ("memblock: Reimplement memblock allocation using reverse free area iterato") in v3.3-rc0
Date: Tue, 10 Jan 2012 14:26:25 -0800	[thread overview]
Message-ID: <20120110222625.GA26832@google.com> (raw)
In-Reply-To: <20120110202838.GA10402@phenom.dumpdata.com>

On Tue, Jan 10, 2012 at 03:28:38PM -0500, Konrad Rzeszutek Wilk wrote:
> With that patch I get this when trying to launch a 4GB xen guest:
> 
> kernel="/mnt/lab/latest/vmlinuz"
> ramdisk="/mnt/lab/latest/initramfs.cpio.gz"
> extra="console=hvc0 debug earlyprintk=xen" 
> memory=4096
> maxmem=8192
> vcpus=4
> on_crash="preserve"
> vif = [ 'mac=00:0F:4B:00:00:68, bridge=switch' ]
> vfb = [ 'vnc=1, vnclisten=0.0.0.0,vncunused=1'
> 
> If I change the "memory" to be "4000" it or if I revert the
> mention git commit it boots. This is what I get with the mentioned
> git commit:

Heh, interesting.  Can you please apply the following patch and report
the failing boot log?

Thanks.

diff --git a/mm/memblock.c b/mm/memblock.c
index 2f55f19..978b58eff 100644
--- a/mm/memblock.c
+++ b/mm/memblock.c
@@ -102,6 +102,10 @@ phys_addr_t __init_memblock memblock_find_in_range_node(phys_addr_t start,
 	/* align @size to avoid excessive fragmentation on reserved array */
 	size = round_up(size, align);
 
+	printk("memblock_find: [0x%llx, 0x%llx) size=%llu align=%llu nid=%d\n",
+	       (unsigned long long)start, (unsigned long long)end,
+	       (unsigned long long)size, (unsigned long long)align, nid);
+
 	/* pump up @end */
 	if (end == MEMBLOCK_ALLOC_ACCESSIBLE)
 		end = memblock.current_limit;
@@ -110,13 +114,27 @@ phys_addr_t __init_memblock memblock_find_in_range_node(phys_addr_t start,
 	start = max3(start, size, (phys_addr_t)PAGE_SIZE);
 	end = max(start, end);
 
+	printk("memblock_find: [0x%llx, 0x%llx) - adjusted\n",
+	       (unsigned long long)start, (unsigned long long)end);
+
 	for_each_free_mem_range_reverse(i, nid, &this_start, &this_end, NULL) {
+		printk("memblock_find: cand [0x%llx, 0x%llx) -> ",
+		       (unsigned long long)this_start,
+		       (unsigned long long)this_end);
+
 		this_start = clamp(this_start, start, end);
 		this_end = clamp(this_end, start, end);
 
+		printk("[0x%llx, 0x%llx) ",
+		       (unsigned long long)this_start,
+		       (unsigned long long)this_end);
+
 		cand = round_down(this_end - size, align);
-		if (cand >= this_start)
+		if (cand >= this_start) {
+			printk("- success %llx\n", (unsigned long long)cand);
 			return cand;
+		}
+		printk("- rejected\n");
 	}
 	return 0;
 }

  reply	other threads:[~2012-01-10 22:26 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-10 20:28 Bootup regression introduced by 7bd0b0f0da3b1ec11cbcc798eb0ef747a1184077 ("memblock: Reimplement memblock allocation using reverse free area iterato") in v3.3-rc0 Konrad Rzeszutek Wilk
2012-01-10 22:26 ` Tejun Heo [this message]
2012-01-10 22:45   ` Konrad Rzeszutek Wilk
2012-01-10 23:15     ` Tejun Heo
2012-01-11 20:04       ` Konrad Rzeszutek Wilk
2012-01-13 14:27         ` Konrad Rzeszutek Wilk
2012-01-13 18:14           ` [PATCH 3.3-rc] memblock: Fix alloc failure due to dumb underflow protection in memblock_find_in_range_node() Tejun Heo
2012-01-16  9:03             ` [tip:core/urgent] memblock: Fix alloc failure due to dumb underflow protection in memblock_find_in_range_node () tip-bot for Tejun Heo
2012-01-24 14:51               ` Konrad Rzeszutek Wilk
2012-01-25  3:58                 ` Konrad Rzeszutek Wilk

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=20120110222625.GA26832@google.com \
    --to=tj@kernel.org \
    --cc=konrad.wilk@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rjw@sisk.pl \
    --cc=xen-devel@lists.xensource.com \
    /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;
as well as URLs for NNTP newsgroup(s).