From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DE6B8C433DB for ; Mon, 8 Mar 2021 19:25:49 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 595046521F for ; Mon, 8 Mar 2021 19:25:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 595046521F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id C2D2D8D006C; Mon, 8 Mar 2021 14:25:48 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id BDD708D001D; Mon, 8 Mar 2021 14:25:48 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A59DD8D006C; Mon, 8 Mar 2021 14:25:48 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0169.hostedemail.com [216.40.44.169]) by kanga.kvack.org (Postfix) with ESMTP id 834808D001D for ; Mon, 8 Mar 2021 14:25:48 -0500 (EST) Received: from smtpin02.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 3FB434435 for ; Mon, 8 Mar 2021 19:25:48 +0000 (UTC) X-FDA: 77897686776.02.7139E90 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by imf21.hostedemail.com (Postfix) with ESMTP id 411EBE0011F8 for ; Mon, 8 Mar 2021 19:25:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1615231547; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zhy88DaTlHV0ulu9qH4mRTxbA1BNIYKfudjB13qylLI=; b=YOX6t6XdGyJwUyOI5TVfYgDK1PKV3fWVgJivSrtwvX154MDzfW1+ZOfkbOILB6e0yTo5Na x7oyU+J48SYD42snF2JGKwOb7padW6h3VIOY0WI3ciLP6dH5NdeobnClVMVsCGPyhYb77a A4+wHvbrQ6UKV8VwS7/rd1YlwCFESjc= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-99-I8DUg0vKNymzknHgB2rQZw-1; Mon, 08 Mar 2021 14:25:43 -0500 X-MC-Unique: I8DUg0vKNymzknHgB2rQZw-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 00A4C19057AC; Mon, 8 Mar 2021 19:25:40 +0000 (UTC) Received: from [10.36.113.123] (ovpn-113-123.ams2.redhat.com [10.36.113.123]) by smtp.corp.redhat.com (Postfix) with ESMTP id 42BCC5D6D5; Mon, 8 Mar 2021 19:25:37 +0000 (UTC) Subject: Re: [PATCH v4 2/3] x86/vmemmap: Drop handling of 1GB vmemmap ranges To: Oscar Salvador , Dave Hansen Cc: Andrew Morton , Dave Hansen , Andy Lutomirski , Peter Zijlstra , Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, "H . Peter Anvin" , Michal Hocko , linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20210301083230.30924-1-osalvador@suse.de> <20210301083230.30924-3-osalvador@suse.de> <62c5b490-353a-ca3a-d2c8-f02189210c32@intel.com> <20210308184840.GC25767@linux> From: David Hildenbrand Organization: Red Hat GmbH Message-ID: <8cbaa17f-11fe-76eb-a53d-0eb17a7488de@redhat.com> Date: Mon, 8 Mar 2021 20:25:36 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 MIME-Version: 1.0 In-Reply-To: <20210308184840.GC25767@linux> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 411EBE0011F8 X-Stat-Signature: go9jp8rq9t685gq7t68o4qwaernf9c5f Received-SPF: none (redhat.com>: No applicable sender policy available) receiver=imf21; identity=mailfrom; envelope-from=""; helo=us-smtp-delivery-124.mimecast.com; client-ip=216.205.24.124 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1615231546-78738 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 08.03.21 19:48, Oscar Salvador wrote: > On Thu, Mar 04, 2021 at 10:42:59AM -0800, Dave Hansen wrote: >> On 3/1/21 12:32 AM, Oscar Salvador wrote: >>> We never get to allocate 1GB pages when mapping the vmemmap range. >>> Drop the dead code both for the aligned and unaligned cases and leave >>> only the direct map handling. >> >> Could you elaborate a bit on why 1GB pages are never used? It is just >> unlikely to have a 64GB contiguous area of memory that needs 1GB of >> contiguous vmemmap? Or, does the fact that sections are smaller than >> 64GB keeps this from happening? > > AFAIK, the biggest we populate vmemmap pages with is 2MB, plus the fact > that as you pointed out, memory sections on x86_64 are 128M, which is > way smaller than what would require to allocate a 1GB for vmemmap pages. > > Am I missing something? Right now, it is dead code that you are removing. Just like for 2MB vmemmap pages, we would proactively have populate 1G pages when adding individual sections. You can easily waste a lot of memory. Of course, one could also make a final pass over the tables to see where it makes sense forming 1GB pages. But then, we would need quite some logic when removing individual sections (e.g., a 128 MB DIMM) - and I remember there are corner cases where we might have to remove boot memory ... Long story short, I don't think 1G vmemmap pages are really worth the trouble. -- Thanks, David / dhildenb