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 702FCCA9EA0 for ; Tue, 22 Oct 2019 21:02:05 +0000 (UTC) Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (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 3EF5820B7C for ; Tue, 22 Oct 2019 21:02:05 +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="YHbp1u4y" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3EF5820B7C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=driverdev-devel-bounces@linuxdriverproject.org Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 0EBD986B2B; Tue, 22 Oct 2019 21:02:05 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id HANviKsJNieS; Tue, 22 Oct 2019 21:02:03 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 9F31A8475D; Tue, 22 Oct 2019 21:02:03 +0000 (UTC) Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id D08CC1BF41E for ; Tue, 22 Oct 2019 21:02:01 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id C803F8475D for ; Tue, 22 Oct 2019 21:02:01 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id oPd6AwBYyaRB for ; Tue, 22 Oct 2019 21:02:00 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by whitealder.osuosl.org (Postfix) with ESMTPS id 5904781F17 for ; Tue, 22 Oct 2019 21:02:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571778119; 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=YHbp1u4ysqfD0tjck2+6YiEtSZ2R5k9wyS+/FWZf3hG6HFgb66fFDdhxfeye5SkumvxejE HQzcwyhCtyxr9Qm91UMgpA81LT2fxMMLIUHpQ/zgmvWClCt8WYqP5GaEMBGnLa/z6v/MDD 1OdoypBGVIqbFRPIdlLDx9pWieHkhLU= 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" 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 X-BeenThere: driverdev-devel@linuxdriverproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Driver Project Developer List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kate Stewart , Sasha Levin , "linux-hyperv@vger.kernel.org" , Michal Hocko , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , "kvm@vger.kernel.org" , Pavel Tatashin , KarimAllah Ahmed , Benjamin Herrenschmidt , Dave Hansen , Alexander Duyck , Michal Hocko , Paul Mackerras , "linux-mm@kvack.org" , Paul Mackerras , Michael Ellerman , "H. Peter Anvin" , Wanpeng Li , Alexander Duyck , Kees Cook , "devel@driverdev.osuosl.org" , Stefano Stabellini , Stephen Hemminger , "Aneesh Kumar K.V" , Joerg Roedel , "x86@kernel.org" , YueHaibing , Mike Rapoport , Madhumitha Prabakaran , Peter Zijlstra , Ingo Molnar , Vlastimil Babka , Nishka Dasgupta , Anthony Yznaga , Oscar Salvador , Dan Carpenter , "Isaac J. Manjarres" , Juergen Gross , Anshuman Khandual , Haiyang Zhang , =?UTF-8?Q?Simon_Sandstr=c3=b6m?= , Dan Williams , "kvm-ppc@vger.kernel.org" , Qian Cai , Alex Williamson , Mike Rapoport , Borislav Petkov , Nicholas Piggin , Andy Lutomirski , "xen-devel@lists.xenproject.org" , Boris Ostrovsky , Todd Poynor , Vitaly Kuznetsov , Allison Randal , Jim Mattson , Christophe Leroy , Vandana BN , Greg Kroah-Hartman , Cornelia Huck , Pavel Tatashin , Mel Gorman , Sean Christopherson , Rob Springer , Thomas Gleixner , Johannes Weiner , Paolo Bonzini , Andrew Morton , "linuxppc-dev@lists.ozlabs.org" Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: driverdev-devel-bounces@linuxdriverproject.org Sender: "devel" On 22.10.19 19:55, Matt Sickler wrote: >> Right now, ZONE_DEVICE memory is always set PG_reserved. We want to change 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. > > I'm not sure what ZONE_DEVICE pages are, but these pages are normal system RAM, typically HugePages (but not always). ZONE_DEVICE, a.k.a. devmem, are pages that bypass the pagecache (e.g., DAX) completely and will therefore never get swapped. These pages are not managed by any page allocator (especially not the buddy), they are rather "directly mapped device memory". E.g., a NVDIMM. It is mapped into the physical address space similar to ordinary RAM (a DIMM). Any write to such a PFN will directly end up on the target device. In contrast to a DIMM, the memory is persistent accross reboots. Now, if you mmap such an NVDIMM into a user space process, you will end up with ZONE_DEVICE pages as part of the user space mapping (VMA). get_user_pages_fast() on this memory will result in "struct pages" that 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 setting these ZONE_DEVICE pages PG_reserved. E.g., AFAIK, setting a 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 series I collect all places that *could* be affected. If that change is really needed has to be decided. I can see that the two staging drivers I have patches for might be able to just live with the change - but then we talked about it and are aware of the change. Thanks! -- Thanks, David / dhildenb _______________________________________________ devel mailing list devel@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel