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=-2.4 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,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 53AFFCA9ECF for ; Fri, 1 Nov 2019 19:25:50 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 08DB921734 for ; Fri, 1 Nov 2019 19:25:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="JG+I9Jcz" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 08DB921734 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 A48BD6B0005; Fri, 1 Nov 2019 15:25:49 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9F9106B0006; Fri, 1 Nov 2019 15:25:49 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 90FE16B0007; Fri, 1 Nov 2019 15:25:49 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0096.hostedemail.com [216.40.44.96]) by kanga.kvack.org (Postfix) with ESMTP id 70C6A6B0005 for ; Fri, 1 Nov 2019 15:25:49 -0400 (EDT) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with SMTP id 0EB59180AD81A for ; Fri, 1 Nov 2019 19:25:49 +0000 (UTC) X-FDA: 76108688418.11.kick34_32b2669e39102 X-HE-Tag: kick34_32b2669e39102 X-Filterd-Recvd-Size: 7037 Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by imf49.hostedemail.com (Postfix) with ESMTP for ; Fri, 1 Nov 2019 19:25:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1572636347; 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=gjjm7Uw5loPShvkS5aQcZzMu+cIOGO3TF0cBurKv6Fo=; b=JG+I9Jczjzci0sdhG3YfzTvGyjcdvY2Jojk6gkYoq1LmxTdJwFd7Z6H9FrZQ5awTFZGtOr rULvjWhGIXQt0NBKaFlsTNQeeELHPQ41Den03+M1iRIGUYPWValLbb6+Bd/wQqyjz9MN1/ gPagkPmeTlOqdRZyaOPCg3ppeZbICpc= 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-227-GxUhE1sJOai6Nmi9ZYzjFA-1; Fri, 01 Nov 2019 15:25:37 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id EAC95111; Fri, 1 Nov 2019 19:25:30 +0000 (UTC) Received: from [10.36.116.26] (ovpn-116-26.ams2.redhat.com [10.36.116.26]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0D01719C58; Fri, 1 Nov 2019 19:24:44 +0000 (UTC) Subject: Re: [PATCH v1 00/10] mm: Don't mark hotplugged pages PG_reserved (including ZONE_DEVICE) To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, Michal Hocko , Andrew Morton , kvm-ppc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, kvm@vger.kernel.org, linux-hyperv@vger.kernel.org, devel@driverdev.osuosl.org, xen-devel@lists.xenproject.org, x86@kernel.org, Alexander Duyck , Alexander Duyck , Alex Williamson , Allison Randal , Andy Lutomirski , "Aneesh Kumar K.V" , Anshuman Khandual , Anthony Yznaga , Benjamin Herrenschmidt , Borislav Petkov , Boris Ostrovsky , Christophe Leroy , Cornelia Huck , Dan Williams , Dave Hansen , Haiyang Zhang , "H. Peter Anvin" , Ingo Molnar , "Isaac J. Manjarres" , Jim Mattson , Joerg Roedel , Johannes Weiner , Juergen Gross , KarimAllah Ahmed , Kees Cook , "K. Y. Srinivasan" , "Matthew Wilcox (Oracle)" , Matt Sickler , Mel Gorman , Michael Ellerman , Michal Hocko , Mike Rapoport , Mike Rapoport , Nicholas Piggin , Oscar Salvador , Paolo Bonzini , Paul Mackerras , Jeff Moyer , Pavel Tatashin , Pavel Tatashin , Peter Zijlstra , Qian Cai , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , Sasha Levin , Sean Christopherson , Stefano Stabellini , Stephen Hemminger , Thomas Gleixner , Vitaly Kuznetsov , Vlastimil Babka , Wanpeng Li , YueHaibing References: <20191024120938.11237-1-david@redhat.com> From: David Hildenbrand Organization: Red Hat GmbH Message-ID: <8564fdc7-9a82-6455-50a8-6943cfd6b885@redhat.com> Date: Fri, 1 Nov 2019 20:24:43 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.1 MIME-Version: 1.0 In-Reply-To: <20191024120938.11237-1-david@redhat.com> Content-Language: en-US X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-MC-Unique: GxUhE1sJOai6Nmi9ZYzjFA-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=UTF-8; format=flowed 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: On 24.10.19 14:09, David Hildenbrand wrote: > This is the result of a recent discussion with Michal ([1], [2]). Right > now we set all pages PG_reserved when initializing hotplugged memmaps. Th= is > includes ZONE_DEVICE memory. In case of system memory, PG_reserved is > cleared again when onlining the memory, in case of ZONE_DEVICE memory > never. >=20 > In ancient times, we needed PG_reserved, because there was no way to tell > whether the memmap was already properly initialized. We now have > SECTION_IS_ONLINE for that in the case of !ZONE_DEVICE memory. ZONE_DEVIC= E > memory is already initialized deferred, and there shouldn't be a visible > change in that regard. >=20 > One of the biggest fears were side effects. I went ahead and audited all > users of PageReserved(). The details can be found in "mm/memory_hotplug: > Don't mark pages PG_reserved when initializing the memmap". >=20 > This patch set adapts all relevant users of PageReserved() to keep the > existing behavior in respect to ZONE_DEVICE pages. The biggest part part > that needs changes is KVM, to keep the existing behavior (that's all I > care about in this series). >=20 > Note that this series is able to rely completely on pfn_to_online_page(). > No new is_zone_device_page() calles are introduced (as requested by Dan). > We are currently discussing a way to mark also ZONE_DEVICE memmaps as > active/initialized - pfn_active() - and lightweight locking to make sure > memmaps remain active (e.g., using RCU). We might later be able to conver= t > some suers of pfn_to_online_page() to pfn_active(). Details can be found > in [3], however, this represents yet another cleanup/fix we'll perform > on top of this cleanup. >=20 > I only gave it a quick test with DIMMs on x86-64, but didn't test the > ZONE_DEVICE part at all (any tips for a nice QEMU setup?). Also, I didn't > test the KVM parts (especially with ZONE_DEVICE pages or no memmap at all= ). > Compile-tested on x86-64 and PPC. >=20 Jeff Moyer ran some NVDIMM test cases for me (thanks!!!), including=20 xfstests, pmdk, and ndctl. No regressions found. I will run some KVM tests, especially NDIMM passthrough, but will have=20 to setup a test environment first. I would appreciate some review in the meantime. :) --=20 Thanks, David / dhildenb