Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760452Ab3HNVhu (ORCPT ); Wed, 14 Aug 2013 17:37:50 -0400 Received: from mail-ob0-f171.google.com ([209.85.214.171]:55726 "EHLO mail-ob0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760403Ab3HNVh2 (ORCPT ); Wed, 14 Aug 2013 17:37:28 -0400 MIME-Version: 1.0 In-Reply-To: <20130814203546.GA6200@kroah.com> References: <1376508705-3188-1-git-send-email-sjenning@linux.vnet.ibm.com> <20130814194348.GB10469@kroah.com> <520BE30D.3070401@sr71.net> <20130814203546.GA6200@kroah.com> Date: Wed, 14 Aug 2013 14:37:26 -0700 X-Google-Sender-Auth: zpbWxTVZYKWv3cZKSbHQQs3oUF0 Message-ID: Subject: Re: [RFC][PATCH] drivers: base: dynamic memory block creation From: Yinghai Lu To: Greg Kroah-Hartman , "H. Peter Anvin" Cc: Dave Hansen , Seth Jennings , Nathan Fontenot , Cody P Schafer , Andrew Morton , Lai Jiangshan , "Rafael J. Wysocki" , Linux Kernel Mailing List , Linux MM Content-Type: multipart/mixed; boundary=047d7b471da4f1197604e3ef29d7 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 5186 Lines: 94 --047d7b471da4f1197604e3ef29d7 Content-Type: text/plain; charset=ISO-8859-1 On Wed, Aug 14, 2013 at 1:35 PM, Greg Kroah-Hartman wrote: > On Wed, Aug 14, 2013 at 01:05:33PM -0700, Dave Hansen wrote: >> On 08/14/2013 12:43 PM, Greg Kroah-Hartman wrote: >> > On Wed, Aug 14, 2013 at 02:31:45PM -0500, Seth Jennings wrote: >> >> ppc64 has a normal memory block size of 256M (however sometimes as low >> >> as 16M depending on the system LMB size), and (I think) x86 is 128M. With >> >> 1TB of RAM and a 256M block size, that's 4k memory blocks with 20 sysfs >> >> entries per block that's around 80k items that need be created at boot >> >> time in sysfs. Some systems go up to 16TB where the issue is even more >> >> severe. >> > >> > The x86 developers are working with larger memory sizes and they haven't >> > seen the problem in this area, for them it's in other places, as I >> > referred to in my other email. >> >> The SGI guys don't run normal distro kernels and don't turn on memory >> hotplug, so they don't see this. I do the same in my testing of >> large-memory x86 systems to speed up my boots. I'll go stick it back in >> there and see if I can generate some numbers for a 1TB machine. >> >> But, the problem on x86 is at _worst_ 1/8 of the problem on ppc64 since >> the SECTION_SIZE is so 8x bigger by default. >> >> Also, the cost of creating sections on ppc is *MUCH* higher than x86 >> when amortized across the number of pages that you're initializing. A >> section on ppc64 has to be created for each (2^24/2^16)=256 pages while >> one on x86 is created for each (2^27/2^12)=32768 pages. >> >> Thus, x86 folks with our small pages and large sections tend to be >> focused on per-page costs. The ppc folks with their small sections and >> larger pages tend to be focused on the per-section costs. > > Ah, thanks for the explaination, now it makes more sense why they are > both optimizing in different places. I had one local patch that sent before, it will probe block size for generic x86_64. set it to 2G looks more reasonable for system with 1T+ ram. Also can we add block_size in that /sys directly so could generate less entries ? Thanks Yinghai --047d7b471da4f1197604e3ef29d7 Content-Type: application/octet-stream; name="block_size_x86_64.patch" Content-Disposition: attachment; filename="block_size_x86_64.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_hkd20u9n0 U3ViamVjdDogW1BBVENIIC12Ml0geDg2LCBtbTogUHJvYmUgbWVtb3J5IGJsb2NrIHNpemUgZm9y IGdlbmVyaWMgeDg2IDY0Yml0CgpVc3VhbGx5IGlmIHRoZSBzeXN0ZW0gc3VwcG9ydCBtZW1vcnkg cmVtYXBwaW5nIHRvIGdldCBiYWNrIG1lbW9yeSBmb3IgbW1pbwpyYW5nZSwgd2Ugd2lsbCBoYXZl IDEyOE0gLi4uIDJHIGF0IHRoZSBlbmQuCgpUcnkgdG8gcHJvYmUgdGhhdCBzaXplLgoKU28gd2Ug Y2FuIGdldCBsZXNzIGVudHJpZXMgaW4gL3N5cy9kZXZpY2VzL3N5c3RlbS9tZW1vcnkvCgotdjI6 IGRvbid0IHByb2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5fTUVNT1JZX0JMT0NLX1NJWkU7Ci19 CiAjZW5kaWYKIAorCS8qIGxlc3MgdGhhbiA2NGcgaW5zdGFsbGVkICovCisJaWYgKChtYXhfcGZu IDw8IFBBR0VfU0hJRlQpIDwgKDE2VUwgPDwgMzIpKQorCQlyZXR1cm4gTUlOX01FTU9SWV9CTE9D S19TSVpFOworCisJLyogZ2V0IHRoZSB0YWlsIHNpemUgKi8KKwl3aGlsZSAoYnogPiBNSU5fTUVN T1JZX0JMT0NLX1NJWkUpIHsKKwkJaWYgKCEoKG1heF9wZm4gPDwgUEFHRV9TSElGVCkgJiAoYnog LSAxKSkpCisJCQlicmVhazsKKwkJYnogPj49IDE7CisJfQorCisJcHJpbnRrKEtFUk5fREVCVUcg Im1lbW9yeSBibG9jayBzaXplIDogJWxkTUJcbiIsIGJ6ID4+IDIwKTsKKworCXJldHVybiBiejsK K30KKworc3RhdGljIHVuc2lnbmVkIGxvbmcgbWVtb3J5X2Jsb2NrX3NpemVfcHJvYmVkOwordW5z aWduZWQgbG9uZyBtZW1vcnlfYmxvY2tfc2l6ZV9ieXRlcyh2b2lkKQoreworCWlmICghbWVtb3J5 X2Jsb2NrX3NpemVfcHJvYmVkKQorCQltZW1vcnlfYmxvY2tfc2l6ZV9wcm9iZWQgPSBwcm9iZV9t ZW1vcnlfYmxvY2tfc2l6ZSgpOworCisJcmV0dXJuIG1lbW9yeV9ibG9ja19zaXplX3Byb2JlZDsK K30KKwogI2lmZGVmIENPTkZJR19TUEFSU0VNRU1fVk1FTU1BUAogLyoKICAqIEluaXRpYWxpc2Ug dGhlIHNwYXJzZW1lbSB2bWVtbWFwIHVzaW5nIGh1Z2UtcGFnZXMgYXQgdGhlIFBNRCBsZXZlbC4K --047d7b471da4f1197604e3ef29d7-- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/