From: Xishi Qiu <qiuxishi@huawei.com>
To: tangchen <tangchen@cn.fujitsu.com>
Cc: akpm@linux-foundation.org, santosh.shilimkar@ti.com,
grygorii.strashko@ti.com, phacht@linux.vnet.ibm.com,
yinghai@kernel.org, fabf@skynet.be, Emilian.Medve@freescale.com,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] memblock, memhotplug: Fix wrong type in memblock_find_in_range_node().
Date: Mon, 11 Aug 2014 10:03:52 +0800 [thread overview]
Message-ID: <53E82488.2030607@huawei.com> (raw)
In-Reply-To: <53E70DB4.4000606@cn.fujitsu.com>
On 2014/8/10 14:14, tangchen wrote:
> Sorry, add Xishi Qiu <qiuxishi@huawei.com>
>
> On 08/10/2014 02:12 PM, Tang Chen wrote:
>> In memblock_find_in_range_node(), we defeind ret as int. But it shoule
>> be phys_addr_t because it is used to store the return value from
>> __memblock_find_range_bottom_up().
>>
>> The bug has not been triggered because when allocating low memory near
>> the kernel end, the "int ret" won't turn out to be minus. When we started
>> to allocate memory on other nodes, and the "int ret" could be minus.
>> Then the kernel will panic.
>>
>> A simple way to reproduce this: comment out the following code in numa_init(),
>>
>> memblock_set_bottom_up(false);
>>
>> and the kernel won't boot.
>>
>> Reported-by: Xishi Qiu <qiuxishi@huawei.com>
>> Signed-off-by: Tang Chen <tangchen@cn.fujitsu.com>
>> ---
>> mm/memblock.c | 3 +--
>> 1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/mm/memblock.c b/mm/memblock.c
>> index 6d2f219..70fad0c 100644
>> --- a/mm/memblock.c
>> +++ b/mm/memblock.c
>> @@ -192,8 +192,7 @@ phys_addr_t __init_memblock memblock_find_in_range_node(phys_addr_t size,
>> phys_addr_t align, phys_addr_t start,
>> phys_addr_t end, int nid)
>> {
>> - int ret;
>> - phys_addr_t kernel_end;
>> + phys_addr_t kernel_end, ret;
>> /* pump up @end */
>> if (end == MEMBLOCK_ALLOC_ACCESSIBLE)
>
>
Hi, Tang Chen
It is OK now.
Tested-by: Xishi Qiu <qiuxishi@huawei.com>
> .
>
--
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>
next prev parent reply other threads:[~2014-08-11 2:06 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-10 6:12 Tang Chen
2014-08-10 6:14 ` tangchen
2014-08-11 2:03 ` Xishi Qiu [this message]
2014-08-12 22:03 ` Andrew Morton
2014-08-13 4:57 ` tangchen
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=53E82488.2030607@huawei.com \
--to=qiuxishi@huawei.com \
--cc=Emilian.Medve@freescale.com \
--cc=akpm@linux-foundation.org \
--cc=fabf@skynet.be \
--cc=grygorii.strashko@ti.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=phacht@linux.vnet.ibm.com \
--cc=santosh.shilimkar@ti.com \
--cc=tangchen@cn.fujitsu.com \
--cc=yinghai@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