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 1ED12CA9EA0 for ; Tue, 22 Oct 2019 21:02:01 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 988BF20B7C for ; Tue, 22 Oct 2019 21:02:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="S2DdU7dH" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 988BF20B7C 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 0C3256B0003; Tue, 22 Oct 2019 17:02:00 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 073AC6B0006; Tue, 22 Oct 2019 17:02:00 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EA3B76B0007; Tue, 22 Oct 2019 17:01:59 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id C986C6B0003 for ; Tue, 22 Oct 2019 17:01:59 -0400 (EDT) Received: from smtpin04.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with SMTP id 648C081C1 for ; Tue, 22 Oct 2019 21:01:59 +0000 (UTC) X-FDA: 76072642758.04.cent99_114fbb2c2050c X-HE-Tag: cent99_114fbb2c2050c X-Filterd-Recvd-Size: 7426 Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by imf14.hostedemail.com (Postfix) with ESMTP for ; Tue, 22 Oct 2019 21:01:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571778118; 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=lDluS1kFGuVOpDajeFMqVqWUjgUNxTiQB+IGh/4U/Fc=; b=S2DdU7dHVRxLEEaKpRC3aFNuzeVB8k1rMSZqral4CM1B2ousC59Plmlwmp/teqSakB3mrA SeHqxGZSwYbP6aSnJCX8xYa7Kx8ooOIXQyBGQuebWS253SGd6e0nX/d0v2vUxSA1hYDz0k J2NOjN/SRUUsuifjYkSMCkW29bByozk= 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-72-nU6b3-OQN5ap8UXZu4oVWg-1; Tue, 22 Oct 2019 17:01:55 -0400 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 3AB3E1005500; Tue, 22 Oct 2019 21:01:50 +0000 (UTC) Received: from [10.36.116.48] (ovpn-116-48.ams2.redhat.com [10.36.116.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id DB2D860872; Tue, 22 Oct 2019 21:01:24 +0000 (UTC) Subject: Re: [PATCH RFC v1 07/12] staging: kpc2000: Prepare transfer_complete_cb() for PG_reserved changes To: Matt Sickler , "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 , Ben Chan , Benjamin Herrenschmidt , Borislav Petkov , Boris Ostrovsky , Christophe Leroy , Cornelia Huck , Dan Carpenter , Dan Williams , Dave Hansen , Fabio Estevam , Greg Kroah-Hartman , Haiyang Zhang , "H. Peter Anvin" , Ingo Molnar , "Isaac J. Manjarres" , Jeremy Sowden , Jim Mattson , Joerg Roedel , Johannes Weiner , Juergen Gross , KarimAllah Ahmed , Kate Stewart , Kees Cook , "K. Y. Srinivasan" , Madhumitha Prabakaran , Mel Gorman , Michael Ellerman , Michal Hocko , Mike Rapoport , Mike Rapoport , Nicholas Piggin , Nishka Dasgupta , Oscar Salvador , Paolo Bonzini , Paul Mackerras , Paul Mackerras , Pavel Tatashin , Pavel Tatashin , Peter Zijlstra , Qian Cai , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , Rob Springer , Sasha Levin , Sean Christopherson , =?UTF-8?Q?Simon_Sandstr=c3=b6m?= , Stefano Stabellini , Stephen Hemminger , Thomas Gleixner , Todd Poynor , Vandana BN , Vitaly Kuznetsov , Vlastimil Babka , Wanpeng Li , YueHaibing References: <20191022171239.21487-1-david@redhat.com> <20191022171239.21487-8-david@redhat.com> From: David Hildenbrand Organization: Red Hat GmbH Message-ID: <20b91026-a685-8c49-4abe-a9d0339113cb@redhat.com> Date: Tue, 22 Oct 2019 23:01:23 +0200 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: Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-MC-Unique: nU6b3-OQN5ap8UXZu4oVWg-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 22.10.19 19:55, Matt Sickler wrote: >> Right now, ZONE_DEVICE memory is always set PG_reserved. We want to chan= ge that. >> >> The pages are obtained via get_user_pages_fast(). I assume, these could = be ZONE_DEVICE pages. Let's just exclude them as well explicitly. >=20 > I'm not sure what ZONE_DEVICE pages are, but these pages are normal syste= m RAM, typically HugePages (but not always). ZONE_DEVICE, a.k.a. devmem, are pages that bypass the pagecache (e.g.,=20 DAX) completely and will therefore never get swapped. These pages are=20 not managed by any page allocator (especially not the buddy), they are=20 rather "directly mapped device memory". E.g., a NVDIMM. It is mapped into the physical address space similar to=20 ordinary RAM (a DIMM). Any write to such a PFN will directly end up on=20 the target device. In contrast to a DIMM, the memory is persistent=20 accross reboots. Now, if you mmap such an NVDIMM into a user space process, you will end=20 up with ZONE_DEVICE pages as part of the user space mapping (VMA).=20 get_user_pages_fast() on this memory will result in "struct pages" that=20 belong to ZONE_DEVICE. This is where this patch comes into play. This patch makes sure that there is absolutely no change once we stop=20 setting these ZONE_DEVICE pages PG_reserved. E.g., AFAIK, setting a=20 ZONE_DEVICE page dirty does not make too much sense (never swapped). Yes, it might not be a likely setup, however, it is possible. In this=20 series I collect all places that *could* be affected. If that change is=20 really needed has to be decided. I can see that the two staging drivers=20 I have patches for might be able to just live with the change - but then=20 we talked about it and are aware of the change. Thanks! --=20 Thanks, David / dhildenb