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.1 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, 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 51C14CA9ECF for ; Fri, 1 Nov 2019 21:07:00 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E185B21897 for ; Fri, 1 Nov 2019 21:06:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="hDrqjZRs" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E185B21897 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 474ZWP5P6pzF55R for ; Sat, 2 Nov 2019 08:06:57 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=redhat.com (client-ip=207.211.31.81; helo=us-smtp-delivery-1.mimecast.com; envelope-from=david@redhat.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="hDrqjZRs"; dkim-atps=neutral Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 474XGk3ykWzF761 for ; Sat, 2 Nov 2019 06:25:49 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1572636346; 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=hDrqjZRskOEpHOV2LA5kveI03177TyfzmHbUXtfRBT4GpD7UGodxUkTsG0p6XgchjjaEor 7bSXNwVgvY9UyBaDwxAHSGlj6wzXctVMBz4W6PimhAqC1t87OpsuAEXu+AyeFgkH9xCY0o KvLRnjgkACKRlmlUdrTfL51neFFrRAg= 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 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-Mailman-Approved-At: Sat, 02 Nov 2019 08:00:22 +1100 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-hyperv@vger.kernel.org, Michal Hocko , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , kvm@vger.kernel.org, Pavel Tatashin , KarimAllah Ahmed , Dave Hansen , Alexander Duyck , Michal Hocko , linux-mm@kvack.org, "H. Peter Anvin" , Wanpeng Li , Alexander Duyck , "K. Y. Srinivasan" , Dan Williams , Kees Cook , devel@driverdev.osuosl.org, Stefano Stabellini , Stephen Hemminger , "Aneesh Kumar K.V" , Joerg Roedel , x86@kernel.org, YueHaibing , "Matthew Wilcox \(Oracle\)" , Mike Rapoport , Peter Zijlstra , Jeff Moyer , Ingo Molnar , Vlastimil Babka , Anthony Yznaga , Oscar Salvador , "Isaac J. Manjarres" , Matt Sickler , Juergen Gross , Anshuman Khandual , Haiyang Zhang , Sasha Levin , kvm-ppc@vger.kernel.org, Qian Cai , Alex Williamson , Mike Rapoport , Borislav Petkov , Nicholas Piggin , Andy Lutomirski , xen-devel@lists.xenproject.org, Boris Ostrovsky , Vitaly Kuznetsov , Allison Randal , Jim Mattson , Mel Gorman , Cornelia Huck , Pavel Tatashin , Sean Christopherson , Thomas Gleixner , Johannes Weiner , Paolo Bonzini , Andrew Morton , linuxppc-dev@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" 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