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=-10.2 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham 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 3C47AC433E0 for ; Tue, 2 Feb 2021 13:29:24 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id CC99864DBD for ; Tue, 2 Feb 2021 13:29:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CC99864DBD 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 4F52A6B006C; Tue, 2 Feb 2021 08:29:23 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 4A60C6B0070; Tue, 2 Feb 2021 08:29:23 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3BB896B0071; Tue, 2 Feb 2021 08:29:23 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0097.hostedemail.com [216.40.44.97]) by kanga.kvack.org (Postfix) with ESMTP id 22B316B006C for ; Tue, 2 Feb 2021 08:29:23 -0500 (EST) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id E11D98249980 for ; Tue, 2 Feb 2021 13:29:22 +0000 (UTC) X-FDA: 77773409364.18.fear51_2d0497b275cb Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin18.hostedemail.com (Postfix) with ESMTP id AC88D100ED3C2 for ; Tue, 2 Feb 2021 13:29:22 +0000 (UTC) X-HE-Tag: fear51_2d0497b275cb X-Filterd-Recvd-Size: 3544 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by imf36.hostedemail.com (Postfix) with ESMTP for ; Tue, 2 Feb 2021 13:29:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612272561; 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=XvwRtVP5vp80IXVInMVRsjcG2OB+pyvOocXOW5/K1lg=; b=PenMMhzh5DV+Mwm5WudHGfimfYX5lIE2nm9W/FOoGnDWW3d8k9u4Vf5gMZ5Z1E8Np6+MDF MFGjvvfHZay6ZzxHL5zF/wB+G69GRfzXtCEWWxMTWnDYV9iVdYh17KZrIWbKn36xn+f/Co z22tbEqOQjULFe95cEK8N69jXKJOjp0= 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-27-RfqjVO5yMKuZ1F_Ryx1DAw-1; Tue, 02 Feb 2021 08:29:16 -0500 X-MC-Unique: RfqjVO5yMKuZ1F_Ryx1DAw-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8652B195D560; Tue, 2 Feb 2021 13:29:14 +0000 (UTC) Received: from [10.36.114.148] (ovpn-114-148.ams2.redhat.com [10.36.114.148]) by smtp.corp.redhat.com (Postfix) with ESMTP id D8E9B36FA; Tue, 2 Feb 2021 13:29:11 +0000 (UTC) To: Oscar Salvador , Andrew Morton Cc: 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: <20210202112450.11932-1-osalvador@suse.de> <20210202112450.11932-3-osalvador@suse.de> From: David Hildenbrand Organization: Red Hat GmbH Subject: Re: [PATCH 2/2] x86/vmemmap: Handle unpopulated sub-pmd ranges Message-ID: Date: Tue, 2 Feb 2021 14:29:11 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: <20210202112450.11932-3-osalvador@suse.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Content-Transfer-Encoding: quoted-printable 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: > @@ -1088,10 +1150,10 @@ remove_pud_table(pud_t *pud_start, unsigned lon= g addr, unsigned long end, > pages++; > } else { > /* If here, we are freeing vmemmap pages. */ > - memset((void *)addr, PAGE_INUSE, next - addr); > + memset((void *)addr, PAGE_UNUSED, next - addr); > =20 > page_addr =3D page_address(pud_page(*pud)); > - if (!memchr_inv(page_addr, PAGE_INUSE, > + if (!memchr_inv(page_addr, PAGE_UNUSED, > PUD_SIZE)) { > free_pagetable(pud_page(*pud), > get_order(PUD_SIZE)); I'm sorry to bother you again, but isn't that dead code as well? How do we ever end up using 1GB pages for the vmemmap? At least not via=20 vmemmap_populate() - so I guess never? There are not many occurrences of=20 "PUD_SIZE" in the file after all ... I think we can simplify that code. --=20 Thanks, David / dhildenb