From patchwork Tue Sep 6 17:20:47 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 9317709 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D62DE607D3 for ; Tue, 6 Sep 2016 17:21:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CB4C128B68 for ; Tue, 6 Sep 2016 17:21:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BDCB028E07; Tue, 6 Sep 2016 17:21:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_NONE, RDNS_NONE, T_DKIM_INVALID autolearn=no version=3.3.1 Received: from ml01.01.org (unknown [198.145.21.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2BC5E28B68 for ; Tue, 6 Sep 2016 17:21:11 +0000 (UTC) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 161091A1DFB; Tue, 6 Sep 2016 10:20:51 -0700 (PDT) X-Original-To: linux-nvdimm@lists.01.org Delivered-To: linux-nvdimm@lists.01.org Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0700.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe41::700]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 125EA1A1DFB for ; Tue, 6 Sep 2016 10:20:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=TcXpq0gzJt40QkZ9S6LB0/DZpYFtH2Ft1nzY8JJ3rcY=; b=Wap9O9y3f81E03wCj6SPNB3lDl8MBUlU2DmCG3psfCvph6ro8ZAY5BMqRVxn4jeStD5/fl3dtxF64Jtvc8Frganiu41S47sTb2g3A25Y49QqhFa73Csq13iCHzWlmfaLhlEWZ90M3G1DceteX5fcW/ulYZI4pVgHmJMOnHseM9Y= Received: from DM2PR21MB0089.namprd21.prod.outlook.com (10.161.141.13) by DM2PR21MB0091.namprd21.prod.outlook.com (10.161.141.14) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.619.0; Tue, 6 Sep 2016 17:20:47 +0000 Received: from DM2PR21MB0089.namprd21.prod.outlook.com ([10.161.141.13]) by DM2PR21MB0089.namprd21.prod.outlook.com ([10.161.141.13]) with mapi id 15.01.0619.007; Tue, 6 Sep 2016 17:20:47 +0000 From: Matthew Wilcox To: Dan Williams , "linux-nvdimm@lists.01.org" Subject: RE: [PATCH 4/5] mm: fix cache mode of dax pmd mappings Thread-Topic: [PATCH 4/5] mm: fix cache mode of dax pmd mappings Thread-Index: AQHSCF8XF1RgGrV/mkW0crfZWp8EQaBstKLA Date: Tue, 6 Sep 2016 17:20:47 +0000 Message-ID: References: <147318056046.30325.5100892122988191500.stgit@dwillia2-desk3.amr.corp.intel.com> <147318058165.30325.16762406881120129093.stgit@dwillia2-desk3.amr.corp.intel.com> In-Reply-To: <147318058165.30325.16762406881120129093.stgit@dwillia2-desk3.amr.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=mawilcox@microsoft.com; x-originating-ip: [206.248.170.10] x-ms-office365-filtering-correlation-id: 0722d2f8-f8a3-452e-0a45-08d3d67a249f x-microsoft-exchange-diagnostics: 1; DM2PR21MB0091; 6:E3KX4I7y6S9kfW8aOsYk7rSdOy7vUM6qu/ixHj+xZkhEyfL9iaY1irc7fvCbOyoKLgrZUoMb32oeJ/W1BWNOIHb/U3bUgiE3aI+YK1Ah8I90cb1Ach8Iz7I8bF2l4aaTXqnavceseaul/N5swtkq10xHFWtpzSmYl38miVi8Z5Iuy1Gttdsfy/30bHiKpMGkxM+LR20Wyw/9wwb20pWVM/4rNAymhEUhTWJMTTh14HONAsRv59k1Jv/3nA+OY8LdiH8ImlNmipONcZcMWKxuQFebvxK0YdzDL2tHoTGjwsqyyD76kKP7MqFm6oFBgKef6egB12MlEloHtonFik/Rrw==; 5:PSF/Pdj5XpXNwGPFF/QkE8YhkZJxll6JfI5YawOR5AvpNHtt2PyX6x8vqGWmTY1ewFYck6Cz7+9Kmt6PIxtVL7icQm492rSEzu3FvQrbIK8krVWp/ujV4qQWsgmX9xrriV+HFyk0fedEwopQzKTcQA==; 24:CVpjfZP4lXRkGGiX+QT2MRqGSs1wn8Ijt9pQoGRdjW93CrfXZDXqK2hC3A+l+GQ4UPnH4YK4FBVmedITySmnhGdkNWCo/jZs8/ztY0SynBk=; 7:y157VciCOE4DI04JNburPNh6bHYPtxlzDDM0Yh9FjQOqzkDV5PGQge/nYt/xoKqpNitIpz1QDoQqJDXb0uway5N9pcJK6ZLeSpFfaW7iM3fpakEX4A/MR0akwxaWsgC/IJDbszdSC77uFU2M66LmdbeUzWK15f6ExsezO94tgs/ZX4WpnVtd1xKuVoOQK6+Cxuf2Oqwv7lym5pjimUVHIUCGXCjEsSQ6aX8X/xa14VXq7OTQInc6Hso+pSJGICCZ x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM2PR21MB0091; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(190756311086443)(227479698468861)(20558992708506)(9452136761055)(162533806227266)(146099531331640)(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(61425038)(6040176)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6055026)(61426038)(61427038); SRVR:DM2PR21MB0091; BCL:0; PCL:0; RULEID:; SRVR:DM2PR21MB0091; x-forefront-prvs: 0057EE387C x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(6009001)(7916002)(199003)(13464003)(189002)(377454003)(9686002)(2906002)(586003)(2501003)(81156014)(4326007)(86362001)(106356001)(99286002)(105586002)(3280700002)(106116001)(8676002)(7416002)(2950100001)(2900100001)(76176999)(97736004)(189998001)(68736007)(5001770100001)(8936002)(5660300001)(6116002)(3846002)(102836003)(92566002)(3660700001)(50986999)(122556002)(11100500001)(19580395003)(33656002)(5002640100001)(19580405001)(54356999)(76576001)(74316002)(305945005)(86612001)(7736002)(66066001)(7846002)(81166006)(101416001)(10400500002)(10290500002)(10090500001)(5005710100001)(8990500004)(7696003)(77096005)(87936001); DIR:OUT; SFP:1102; SCL:1; SRVR:DM2PR21MB0091; H:DM2PR21MB0089.namprd21.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Sep 2016 17:20:47.4705 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR21MB0091 X-BeenThere: linux-nvdimm@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Linux-nvdimm developer list." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Nilesh Choudhury , "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" , "linux-mm@kvack.org" , "akpm@linux-foundation.org" , "Kirill A. Shutemov" , Kai Zhang Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" X-Virus-Scanned: ClamAV using ClamSMTP I have no objection to this patch going in for now. Longer term, surely we want to track what mode the PFNs are mapped in? There are various bizarre suppositions out there about how persistent memory should be mapped, and it's probably better if the kernel ignores what the user specifies and keeps everything sane. I've read the dire warnings in the Intel architecture manual and I have no desire to deal with the inevitable bug reports on some hardware I don't own and requires twenty weeks of operation in order to observe the bug. -----Original Message----- From: Dan Williams [mailto:dan.j.williams@intel.com] Sent: Tuesday, September 6, 2016 12:50 PM To: linux-nvdimm@lists.01.org Cc: Toshi Kani ; Matthew Wilcox ; Nilesh Choudhury ; linux-kernel@vger.kernel.org; stable@vger.kernel.org; linux-mm@kvack.org; akpm@linux-foundation.org; Ross Zwisler ; Kirill A. Shutemov ; Kai Zhang Subject: [PATCH 4/5] mm: fix cache mode of dax pmd mappings track_pfn_insert() is marking dax mappings as uncacheable. It is used to keep mappings attributes consistent across a remapped range. However, since dax regions are never registered via track_pfn_remap(), the caching mode lookup for dax pfns always returns _PAGE_CACHE_MODE_UC. We do not use track_pfn_insert() in the dax-pte path, and we always want to use the pgprot of the vma itself, so drop this call. Cc: Ross Zwisler Cc: Matthew Wilcox Cc: Kirill A. Shutemov Cc: Andrew Morton Cc: Nilesh Choudhury Reported-by: Kai Zhang Reported-by: Toshi Kani Cc: Signed-off-by: Dan Williams --- mm/huge_memory.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/mm/huge_memory.c b/mm/huge_memory.c index a6abd76baa72..338eff05c77a 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -676,8 +676,6 @@ int vmf_insert_pfn_pmd(struct vm_area_struct *vma, unsigned long addr, if (addr < vma->vm_start || addr >= vma->vm_end) return VM_FAULT_SIGBUS; - if (track_pfn_insert(vma, &pgprot, pfn)) - return VM_FAULT_SIGBUS; insert_pfn_pmd(vma, addr, pmd, pfn, pgprot, write); return VM_FAULT_NOPAGE; }