From patchwork Fri Aug 21 20:27:08 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Luck X-Patchwork-Id: 7053831 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 8C6BEC05AC for ; Fri, 21 Aug 2015 20:27:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1832120570 for ; Fri, 21 Aug 2015 20:27:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7A7012055A for ; Fri, 21 Aug 2015 20:27:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752163AbbHUU1b (ORCPT ); Fri, 21 Aug 2015 16:27:31 -0400 Received: from mga03.intel.com ([134.134.136.65]:21598 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752044AbbHUU1a (ORCPT ); Fri, 21 Aug 2015 16:27:30 -0400 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga103.jf.intel.com with ESMTP; 21 Aug 2015 13:27:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,723,1432623600"; d="scan'208";a="773330455" Received: from agluck-desk.sc.intel.com ([10.3.79.148]) by fmsmga001.fm.intel.com with ESMTP; 21 Aug 2015 13:27:08 -0700 Date: Fri, 21 Aug 2015 13:27:08 -0700 From: "Luck, Tony" To: Yinghai Lu Cc: Daniel J Blueman , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Bjorn Helgaas , the arch/x86 maintainers , Linux Kernel Mailing List , "linux-pci@vger.kernel.org" , Steffen Persvold Subject: Re: [PATCH v4 4/4] Use 2GB memory block size on large-memory x86-64 systems Message-ID: <20150821202707.GA920@agluck-desk.sc.intel.com> References: <1415089784-28779-1-git-send-email-daniel@numascale.com> <1415089784-28779-4-git-send-email-daniel@numascale.com> <20150821181910.GA31378@agluck-desk.sc.intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Fri, Aug 21, 2015 at 11:38:13AM -0700, Yinghai Lu wrote: > That commit could be reverted. > According to > https://lkml.org/lkml/2014/11/10/123 Do we really need to force the MIN_MEMORY_BLOCK_SIZE on small systems? What about this patch - which just uses max_pfn to choose the block size. It seems that many systems with large amounts of memory will have a nicely aligned max_pfn ... so they will get the 2GB block size. If they don't have a well aligned max_pfn, then they need to use a smaller size to avoid the crash I saw. -Tony --- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c index 3fba623e3ba5..e14e90fd1cf8 100644 --- a/arch/x86/mm/init_64.c +++ b/arch/x86/mm/init_64.c @@ -1195,15 +1195,6 @@ static unsigned long probe_memory_block_size(void) /* start from 2g */ unsigned long bz = 1UL<<31; - if (totalram_pages >= (64ULL << (30 - PAGE_SHIFT))) { - pr_info("Using 2GB memory block size for large-memory system\n"); - return 2UL * 1024 * 1024 * 1024; - } - - /* less than 64g installed */ - if ((max_pfn << PAGE_SHIFT) < (16UL << 32)) - return MIN_MEMORY_BLOCK_SIZE; - /* get the tail size */ while (bz > MIN_MEMORY_BLOCK_SIZE) { if (!((max_pfn << PAGE_SHIFT) & (bz - 1)))