Re: [PATCH] memory hotplug disable boot option

Eric W. Biederman
2010-06-28T04:15:40Z

KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> writes:

>> 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?

Simplicity of the current implementation.

I have a prototype patch sitting around somewhere. I think ultimately
it makes sense to do something like extN's htree directory structure
in sysfs. I wanted to get the tagged sysfs support in before I worked
on scalability because that slightly changes the requirements.

Improving the scalability here is certainly worth doing, but I am slightly
concerned there is something else algorithmically wrong if this is still
going to take 33 minutes to boot with 2TB.

Eric