From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f45.google.com (mail-pa0-f45.google.com [209.85.220.45]) by kanga.kvack.org (Postfix) with ESMTP id B705A6B0075 for ; Fri, 8 Nov 2013 18:43:09 -0500 (EST) Received: by mail-pa0-f45.google.com with SMTP id kp14so2876486pab.4 for ; Fri, 08 Nov 2013 15:43:09 -0800 (PST) Received: from psmtp.com ([74.125.245.150]) by mx.google.com with SMTP id do4si903020pbc.227.2013.11.08.15.43.07 for ; Fri, 08 Nov 2013 15:43:08 -0800 (PST) From: Santosh Shilimkar Subject: [PATCH 01/24] mm/memblock: debug: correct displaying of upper memory boundary Date: Fri, 8 Nov 2013 18:41:37 -0500 Message-ID: <1383954120-24368-2-git-send-email-santosh.shilimkar@ti.com> In-Reply-To: <1383954120-24368-1-git-send-email-santosh.shilimkar@ti.com> References: <1383954120-24368-1-git-send-email-santosh.shilimkar@ti.com> MIME-Version: 1.0 Content-Type: text/plain Sender: owner-linux-mm@kvack.org List-ID: To: tj@kernel.org, linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, Grygorii Strashko , Yinghai Lu , Andrew Morton , Santosh Shilimkar From: Grygorii Strashko When debugging is enabled (cmdline has "memblock=debug") the memblock will display upper memory boundary per each allocated/freed memory range wrongly. For example: memblock_reserve: [0x0000009e7e8000-0x0000009e7ed000] _memblock_early_alloc_try_nid_nopanic+0xfc/0x12c The 0x0000009e7ed000 is displayed instead of 0x0000009e7ecfff Hence, correct this by changing formula used to calculate upper memory boundary to (u64)base + size - 1 instead of (u64)base + size everywhere in the debug messages. Cc: Yinghai Lu Cc: Andrew Morton Acked-by: Tejun Heo Signed-off-by: Grygorii Strashko Signed-off-by: Santosh Shilimkar --- mm/memblock.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/memblock.c b/mm/memblock.c index 0ac412a..e03918e 100644 --- a/mm/memblock.c +++ b/mm/memblock.c @@ -545,7 +545,7 @@ int __init_memblock memblock_free(phys_addr_t base, phys_addr_t size) { memblock_dbg(" memblock_free: [%#016llx-%#016llx] %pF\n", (unsigned long long)base, - (unsigned long long)base + size, + (unsigned long long)base + size - 1, (void *)_RET_IP_); return __memblock_remove(&memblock.reserved, base, size); @@ -557,7 +557,7 @@ int __init_memblock memblock_reserve(phys_addr_t base, phys_addr_t size) memblock_dbg("memblock_reserve: [%#016llx-%#016llx] %pF\n", (unsigned long long)base, - (unsigned long long)base + size, + (unsigned long long)base + size - 1, (void *)_RET_IP_); return memblock_add_region(_rgn, base, size, MAX_NUMNODES); -- 1.7.9.5 -- 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: email@kvack.org