Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp6045264imm; Mon, 23 Jul 2018 10:25:29 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcUmfeWmDXG5Czigidk/qjyiMUJf6orAi8PQdd34/CPYSwK+USsobiUm91MYDClzHcHY4bA X-Received: by 2002:a17:902:64c2:: with SMTP id y2-v6mr13658795pli.53.1532366729400; Mon, 23 Jul 2018 10:25:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532366729; cv=none; d=google.com; s=arc-20160816; b=iQhocrUbMKhs9ZPGwjzik6KuW0ESJDdXmbwff9PwTPSR/WOi5t0o4BMYS8Aj6Msy8u 4MM7mWId1zmD4IxclrJXl9unwF4dEy9dib5D0aygUYpXWTtfHMnb9f/v3GntzeI/g1vU Qdeqw0UmQM2bmM/6hrPI5CtP5QrLy5fITD5NaLfZ0GkApcnVz5JFv0r1/LK3RYhB9SZx tCAvc+gSQ3Aq+Z2T7m/QOQEKHDZ1Zx6V7FPCDTsfPK/IreOSNFFn5hAXPlsxlm+2SJAT a44OySEl8dHDDootHuMHNnrCeJnE+C20XIPG/7GueomcBxYOuq+S5GfUc5qcqIiKzKiJ 0PeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:openpgp:from:references:cc:to:subject :arc-authentication-results; bh=3Bmgo88PXopGSUvweCk9Y1Bf9Zg5M5nosLr/3Hj5X+E=; b=rlLWCzcB7HQTXLuH4mHqSFY6n5NLwhwQ/kzc02UPKuBbCKWMKzqiq62u9q1jg9rPWB 53GkRuFtLw0tsXiMznJpXsjOvNZGVuCvyywrd6XUCeNLvsfibXP9DCReoQRM3wZm5KMt kMy+kFRu3M9z0mXe5FncVEkQPwRfGebYLSZZRRCeFa5R7P/xevH9JIDpXxrrksucptfh YHmytHlUn81q8IrQpn2ZIzBmDTXhNfegaSspwA2mg+ava3RKrlQWCwIQqGAMOugrwO/t feJlNj2Sctgzny1EtbzlYAIzMRy1FjkrmDzQjiSRcCCAhHfudxUCpJa4Xi6DotFB6nk7 iy3w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u7-v6si9864735pfi.96.2018.07.23.10.25.15; Mon, 23 Jul 2018 10:25:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388480AbeGWROD (ORCPT + 99 others); Mon, 23 Jul 2018 13:14:03 -0400 Received: from mga04.intel.com ([192.55.52.120]:31587 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387970AbeGWROD (ORCPT ); Mon, 23 Jul 2018 13:14:03 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Jul 2018 09:12:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,393,1526367600"; d="scan'208";a="242587604" Received: from djiang5-desk3.ch.intel.com ([143.182.136.93]) by orsmga005.jf.intel.com with ESMTP; 23 Jul 2018 09:12:06 -0700 Subject: Re: [PATCH v6 06/13] mm, dev_pagemap: Do not clear ->mapping on final put To: =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= Cc: Dan Williams , linux-nvdimm@lists.01.org, Jan Kara , linux-kernel@vger.kernel.org, stable@vger.kernel.org, linux-mm@kvack.org, =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= , linux-fsdevel@vger.kernel.org, Andrew Morton , hch@lst.de References: <153154376846.34503.15480221419473501643.stgit@dwillia2-desk3.amr.corp.intel.com> <153154380137.34503.3754023882460956800.stgit@dwillia2-desk3.amr.corp.intel.com> From: Dave Jiang Openpgp: preference=signencrypt Autocrypt: addr=dave.jiang@intel.com; prefer-encrypt=mutual; keydata= xsPuBE6TbysRDACKOBHZT4ez/3/idMBVQP+cMIJAWfTTLqbHVYLdHMHh4h6IXWLqWgc9AYTx /ajdOrBVGSK9kMuvqRi0iRO1QLOMUAIc2n/44vh/3Fe54QYfgbndeXhHZi7YEwjiTCbpQ336 pS0rS2qQaA8GzFwu96OslLI05j9Ygaqy73qmuk3wxomIYiu9a97aN3oVv1RyTp6gJK1NWT3J On17P1yWUYPvY3KJtpVqnRLkLZeOIiOahgf9+qiYqPhKQI1Ycx4YhbqkNmDG1VqdMtEWREZO DpTti6oecydN37MW1Y+YSzWYDVLWfoLUr2tBveGCRLf/U2n+Tm2PlJR0IZq+BhtuIUVcRLQW vI+XenR8j3vHVNHs9UXW/FPB8Xb5fwY2bJniZ+B4G67nwelhMNWe7H9IcEaI7Eo32fZk+9fo x6GDAhdT0pEetwuhkmI0YYD7cQj1mEx1oEbzX2p/HRW9sHTSv0V2zKbkPvii3qgvCoDb1uLd 4661UoSG0CYaAx8TwBxUqjsBAO9FXDhLHZJadyHmWp64xQGnNgBathuqoSsIWgQWBpfhDACA OYftX52Wp4qc3ZT06NPzGTV35xr4DVftxxUHiwzB/bzARfK8tdoW4A44gN3P03DAu+UqLoqm UP/e8gSLEjoaebjMu8c2iuOhk1ayHkDPc2gugTgLLBWPkhvIE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5V0QpqkU8DhZDgEAoStRa/a6Mtq3Ri1H B84kFIqSQ9ME5049k6k1K7wdXcvOwE0ETpNvKxAEANGHLx0q/R99wzbVdnRthIZttNQ6M4R8 AAtEypE9JG3PLrEd9MUB5wf0fB/2Jypec3x935mRW3Zt1i+TrzjQDzMV5RyTtpWI7PwIh5IZ 0h4OV2yQHFVViHi6lubCRypQYiMzTmEKua3LeBGvUR9vVmpPJZ/UP6VajKqywjPHYBwLAAMF A/9B/PdGc1sZHno0ezuwZO2J9BOsvASNUzamO9to5P9VHTA6UqRvyfXJpNxLF1HjT4ax7Xn4 wGr6V1DCG3JYBmwIZjfinrLINKEK43L+sLbVVi8Mypc32HhNx/cPewROY2vPb4U7y3jhPBtt lt0ZMb75Lh7zY3TnGLOx1AEzmqwZSMJhBBgRCAAJBQJOk28rAhsMAAoJEGQVxPFmo7k+qiUB AKH0QWC+BBBn3pa9tzOz5hTrup+GIzf5TcuCsiAjISEqAPkBTGk5iiGrrHkxsz8VulDVpNxk o6nmKbYpUAltQObU2w== Message-ID: <3fcb3c8a-2a41-7c78-edde-066c10110d34@intel.com> Date: Mon, 23 Jul 2018 09:12:06 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <153154380137.34503.3754023882460956800.stgit@dwillia2-desk3.amr.corp.intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Jerome, Is it possible to get an ack for this? Thanks! On 07/13/2018 09:50 PM, Dan Williams wrote: > MEMORY_DEVICE_FS_DAX relies on typical page semantics whereby ->mapping > is only ever cleared by truncation, not final put. > > Without this fix dax pages may forget their mapping association at the > end of every page pin event. > > Move this atypical behavior that HMM wants into the HMM ->page_free() > callback. > > Cc: > Cc: Jan Kara > Cc: Jérôme Glisse > Cc: Andrew Morton > Cc: Ross Zwisler > Fixes: d2c997c0f145 ("fs, dax: use page->mapping...") > Signed-off-by: Dan Williams > --- > kernel/memremap.c | 1 - > mm/hmm.c | 2 ++ > 2 files changed, 2 insertions(+), 1 deletion(-) > > diff --git a/kernel/memremap.c b/kernel/memremap.c > index 5857267a4af5..62603634a1d2 100644 > --- a/kernel/memremap.c > +++ b/kernel/memremap.c > @@ -339,7 +339,6 @@ void __put_devmap_managed_page(struct page *page) > __ClearPageActive(page); > __ClearPageWaiters(page); > > - page->mapping = NULL; > mem_cgroup_uncharge(page); > > page->pgmap->page_free(page, page->pgmap->data); > diff --git a/mm/hmm.c b/mm/hmm.c > index de7b6bf77201..f9d1d89dec4d 100644 > --- a/mm/hmm.c > +++ b/mm/hmm.c > @@ -963,6 +963,8 @@ static void hmm_devmem_free(struct page *page, void *data) > { > struct hmm_devmem *devmem = data; > > + page->mapping = NULL; > + > devmem->ops->free(devmem, page); > } > > > _______________________________________________ > Linux-nvdimm mailing list > Linux-nvdimm@lists.01.org > https://lists.01.org/mailman/listinfo/linux-nvdimm >