Re: [PATCH v5 02/14] memory-hotplug: check whether all memory blocks are offlined or not when removing memory
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: Kamezawa Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx>
- Subject: Re: [PATCH v5 02/14] memory-hotplug: check whether all memory blocks are offlined or not when removing memory
- From: Tang Chen <tangchen@xxxxxxxxxxxxxx>
- Date: Thu, 27 Dec 2012 11:10:56 +0800
- Cc: akpm@xxxxxxxxxxxxxxxxxxxx, rientjes@xxxxxxxxxx, liuj97@xxxxxxxxx, len.brown@xxxxxxxxx, benh@xxxxxxxxxxxxxxxxxxx, paulus@xxxxxxxxx, cl@xxxxxxxxx, minchan.kim@xxxxxxxxx, kosaki.motohiro@xxxxxxxxxxxxxx, isimatu.yasuaki@xxxxxxxxxxxxxx, wujianguo@xxxxxxxxxx, wency@xxxxxxxxxxxxxx, hpa@xxxxxxxxx, linfeng@xxxxxxxxxxxxxx, laijs@xxxxxxxxxxxxxx, mgorman@xxxxxxx, yinghai@xxxxxxxxxx, x86@xxxxxxxxxx, linux-mm@xxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, linuxppc-dev@xxxxxxxxxxxxxxxx, linux-acpi@xxxxxxxxxxxxxxx, linux-s390@xxxxxxxxxxxxxxx, linux-sh@xxxxxxxxxxxxxxx, linux-ia64@xxxxxxxxxxxxxxx, cmetcalf@xxxxxxxxxx, sparclinux@xxxxxxxxxxxxxxx
- In-reply-to: <50DA6AB3.2030608@jp.fujitsu.com>
- List-id: <linux-ia64.vger.kernel.org>
- References: <1356350964-13437-1-git-send-email-tangchen@cn.fujitsu.com> <1356350964-13437-3-git-send-email-tangchen@cn.fujitsu.com> <50DA6AB3.2030608@jp.fujitsu.com>
- User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120430 Thunderbird/12.0.1
On 12/26/2012 11:10 AM, Kamezawa Hiroyuki wrote:
> (2012/12/24 21:09), Tang Chen wrote:
>> From: Yasuaki Ishimatsu<isimatu.yasuaki@xxxxxxxxxxxxxx>
>>
>> We remove the memory like this:
>> 1. lock memory hotplug
>> 2. offline a memory block
>> 3. unlock memory hotplug
>> 4. repeat 1-3 to offline all memory blocks
>> 5. lock memory hotplug
>> 6. remove memory(TODO)
>> 7. unlock memory hotplug
>>
>> All memory blocks must be offlined before removing memory. But we don't hold
>> the lock in the whole operation. So we should check whether all memory blocks
>> are offlined before step6. Otherwise, kernel maybe panicked.
>>
>> Signed-off-by: Wen Congyang<wency@xxxxxxxxxxxxxx>
>> Signed-off-by: Yasuaki Ishimatsu<isimatu.yasuaki@xxxxxxxxxxxxxx>
>
> Acked-by: KAMEZAWA Hiroyuki<kamezawa.hiroyu@xxxxxxxxxxxxxx>
>
> a nitpick below.
>
>> +
>> + for (pfn = start_pfn; pfn< end_pfn; pfn += PAGES_PER_SECTION) {
>
> I prefer adding mem = NULL at the start of this for().
Hi Kamezawa-san,
Added, thanks. :)
>
>> + section_nr = pfn_to_section_nr(pfn);
>> + if (!present_section_nr(section_nr))
>> + continue;
>> +
>> + section = __nr_to_section(section_nr);
>> + /* same memblock? */
>> + if (mem)
>> + if ((section_nr>= mem->start_section_nr)&&
>> + (section_nr<= mem->end_section_nr))
>> + continue;
>> +
>
> Thanks,
> -Kame
>
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
[Index of Archives]
[Linux Kernel]
[Sparc Linux]
[DCCP]
[Linux ARM]
[Yosemite News]
[Linux SCSI]
[Linux x86_64]
[Linux for Ham Radio]