public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Nathan Fontenot <nfont@austin.ibm.com>
To: Andi Kleen <andi@firstfloor.org>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] memory hotplug disable boot option
Date: Fri, 25 Jun 2010 09:51:37 -0500	[thread overview]
Message-ID: <4C24C279.3050206@austin.ibm.com> (raw)
In-Reply-To: <87d3vfeage.fsf@basil.nowhere.org>

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.

> 
> Yes I agree this really needs to be fixed properly, not hacked around
> with an option. Nathan can you please post some profile logs of the long
> boot times?  
> 

At this point the only profiling data I have is from adding a printk before
and after the creation of the memory sysfs files in drivers/base/memory.c and
booting with printk.time=1.

With 250 GB of memory: 10 seconds
[    0.539562] Memory Start
[   10.450409] Memory End

With 1 TB of memory: 9.1 minutes
[   31.680168] Memory Start
[  584.186500] Memory End

I am hoping to get access to a machine with 2 TB of memory sometime soon and
can post data for boot times on an unpatched kernel.

I posted a patch earlier that updated sysfs to use reb-black trees to store
the sysfs dirent structs (though the patch has issues with namespaces).  Using
this patch on a 1 TB system the memory sysfs dir creation dropped to 2.2 minutes.

[    1.295874] Memory Start
[  137.293510] Memory End

On a system with 2 TB of memory, the reb-black tree patch dropped the sysfs file
creation time down to 33 minutes and total boot time to 1 hour 15 minutes. I
haven't measured an unpatched kernel, but total boot of an unpatched kernel
is just over 8 hours.

With 2 TB and patched kernel: 33 minutes
[    3.241679] Memory Start
[ 1986.973324] Memory End
 
I am open to other ideas on a solution for this.  With this many memory sections
I feel that the sysfs memory directory really isn't human readable, not with
10's or 100's of thousands of entries.  Perhaps moving to a flat file representation
and not create all the directories?

-Nathan

  reply	other threads:[~2010-06-25 14:51 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-25  1:06 [PATCH] memory hotplug disable boot option Nathan Fontenot
2010-06-25  2:04 ` KOSAKI Motohiro
2010-06-25  9:19   ` Andi Kleen
2010-06-25 14:51     ` Nathan Fontenot [this message]
2010-06-25 14:56       ` Andi Kleen
2010-06-25 15:21         ` Nathan Fontenot
2010-06-25 15:28           ` Andi Kleen
2010-06-25 16:00             ` Nathan Fontenot
2010-06-28  2:20       ` KOSAKI Motohiro
2010-06-28  4:15         ` Eric W. Biederman
2010-06-28 14:16           ` Andi Kleen
2010-06-28 19:43             ` Eric W. Biederman
2010-06-28 15:02         ` Greg KH
2010-06-28 15:37           ` Nathan Fontenot
2010-06-28 15:44             ` Greg KH
2010-06-29  0:04               ` Dave Hansen
2010-06-29  2:56                 ` KOSAKI Motohiro
2010-06-29 15:38                   ` Nathan Fontenot
2010-06-30  0:00                     ` KOSAKI Motohiro
2010-06-29 16:03                   ` Dave Hansen
2010-06-29 18:04                     ` Greg KH
2010-06-30  0:32                       ` KAMEZAWA Hiroyuki
2010-06-30 15:47                         ` Greg KH
2010-07-01  0:31                           ` KAMEZAWA Hiroyuki
2010-07-01  3:17                             ` Nathan Fontenot
2010-07-01  3:30                               ` KAMEZAWA Hiroyuki
2010-07-01 23:28                                 ` Greg KH
2010-07-01  5:15                             ` KAMEZAWA Hiroyuki
2010-07-01 13:23                             ` Dave Hansen
2010-07-06 15:20                               ` Nathan Fontenot
2010-07-06 15:33                                 ` Dave Hansen
2010-07-06 15:47                                   ` Nathan Fontenot
2010-07-01 23:26                             ` Greg KH
2010-07-02  5:50                               ` KAMEZAWA Hiroyuki

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=4C24C279.3050206@austin.ibm.com \
    --to=nfont@austin.ibm.com \
    --cc=andi@firstfloor.org \
    --cc=kosaki.motohiro@jp.fujitsu.com \
    --cc=linux-kernel@vger.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