Re: [PATCH] memory hotplug disable boot option

Nathan Fontenot
2010-06-28T15:37:20Z

On 06/28/2010 10:02 AM, Greg KH wrote:
> On Mon, Jun 28, 2010 at 11:20:27AM +0900, KOSAKI Motohiro wrote:
>>> On 06/25/2010 04:19 AM, Andi Kleen wrote:
>>>> KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> writes:
>>>>
>>>>>> Proposed patch to disable memory hotplug via a boot option,
>>>>>> mem_hotplug=[on|off]. The patch only disables memory hotplug in that it
>>>>>> prevents the creation of the memory sysfs directories for memory sections.
>>>>>>
>>>>>> This patch is meant to help alleviate very long boot times on systems with
>>>>>> large memory (1+ TB) and many memory sections (10's of thousands).
>>>>>
>>>>> Why making simple /sys file is so slowly? Couldn't we fix such performance
>>>>> problem?
>>>
>>> The issue is the large number of sysfs memory directories that get created.
>>> On a system with 1 TB of memory I am seeing ~63,00 directories. The long
>>> creation time is due to the string compare check in sysfs code to ensure
>>> we are not creating a directory with a duplicate name.
>>
>> Ah, I see. probably this is sysfs issue. So Let's cc Greg and Eric.
>> Greg, I have dumb question. Why sysfs call strcmp() so heavily? I mean why sysfs
>> don't have hash based name dupliation check?
>
> Because we have not needed such complexity before.
>
> You might want to take a step back and asky why you are creating 63
> thousand directories in sysfs for large memory systems. Are you really
> going to use all of those directories? What are they for? Perhaps
> someone created the wrong interface to memory and that needs to be fixed
> instead?
>

The directories being created are the standard directories, one for each of the memory
sections present at boot. I think the most used files in each of these directories
is the state and removable file used to do memory hotplug.

-Nathan