lkml.org 
[lkml]   [2012]   [Sep]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC v8 PATCH 04/20] memory-hotplug: offline and remove memory when removing the memory device
At 09/01/2012 04:55 AM, Andrew Morton Wrote:
> On Tue, 28 Aug 2012 18:00:11 +0800
> wency@cn.fujitsu.com wrote:
>
>> +int remove_memory(int nid, u64 start, u64 size)
>> +{
>> + int ret = -EBUSY;
>> + lock_memory_hotplug();
>> + /*
>> + * The memory might become online by other task, even if you offine it.
>> + * So we check whether the cpu has been onlined or not.
>
> I think you meant "memory", not "cpu".

Yes. I will fix it.

Thanks
Wen Congyang

>
> Actually, "check whether any part of this memory range has been
> onlined" would be better. If that is accurate ;)
>
>> + */
>> + if (!is_memblk_offline(start, size)) {
>> + pr_warn("memory removing [mem %#010llx-%#010llx] failed, "
>> + "because the memmory range is online\n",
>> + start, start + size);
>> + ret = -EAGAIN;
>> + }
>> +
>> + unlock_memory_hotplug();
>> + return ret;
>> +
>> +}
>> +EXPORT_SYMBOL_GPL(remove_memory);
>



\
 
 \ /
  Last update: 2012-09-03 04:02    [W:0.147 / U:0.152 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site