Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2644488yba; Fri, 10 May 2019 15:51:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqxqPJFTjfMX4juPM7Sk52YCnPR/Cc2iz7hYI7YjHTVZoi/1Bhq+1CoUFPH0fp6oHYeWhmiA X-Received: by 2002:a17:902:e40f:: with SMTP id ci15mr16623703plb.280.1557528694669; Fri, 10 May 2019 15:51:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557528694; cv=none; d=google.com; s=arc-20160816; b=v8LX2Kgw8cZFDBZo0TKyaNPbDwQtX7o4+dJ8WiaQ902gErf5xEqyVOVqg/fLssEwvt D5uHoqZPIHshP0kKWW+cH5PkJv3j4fq0ABomcH4xy+GuNXW2u2jyj7qr/3P8wiXCqo4A CxqdoHPz5khv5W//UWUq8jeYZEDYYUitewVW7az4Ri9TcUQ92gvjMcdw4VN3GcFsN+r6 fxsKuQCug8jxZUonlNRgW8Nm0iCNS8po3QY4zRjlhFP3PG/XkfPt4B3TiQOxOft+Ep69 2RKKRNck/TH5xqrLwU4GhJzw8HVrVNrb7DM3eyzhVVWuEw2gwv2Ragatpf8kKqavWL3C HTcQ== 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:from:references:cc:to:subject:dkim-signature; bh=bf8P4q788pObPSRhE2yikT3tYYSQpmCfY0xoTw+mRbc=; b=zRfAOtvrNCHFIRgmDneYPxb7ELA8qPva5B+rrG4BS2Rpz9PcFvtxNMOvfzXXy8Qyyb 7q+AQd/h2YGmv+SfYI8cPSr9/2Xrdi1FEDzzNp1UbfuHeLHjO6jpzI+/JHi2DD0EFjZa n5FAB9u9dUGQg43O9lBWzMvBOfYCMhuyzD/zTW2m/xd9ziV0kvI+q13AHUIfekp3uzzs zDD2z5axE/OgYT+bievWelmkU7GoR9bJeSaUclTEqhwK7DWbGCTY6ZQHhYUnNJwblEEG Hfm3xAsFAaj/kDD8rqFp+Op3kPahE3zS0toStmQXACOPylE8/M1iS4JBZFPaVPkeH0lV 6aaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=tJDg3KFb; 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=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y3si8232785plt.133.2019.05.10.15.51.17; Fri, 10 May 2019 15:51:34 -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; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=tJDg3KFb; 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=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728169AbfEJWpd (ORCPT + 99 others); Fri, 10 May 2019 18:45:33 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:46930 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727917AbfEJWpd (ORCPT ); Fri, 10 May 2019 18:45:33 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x4AMiYvu139156; Fri, 10 May 2019 22:45:12 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=bf8P4q788pObPSRhE2yikT3tYYSQpmCfY0xoTw+mRbc=; b=tJDg3KFbDYIWEVqN4zRx/qTj/SM3kNWXyLq8DekKk43DPTy4EJHOJoil4dQOslSkD0Fq 8iunHzoBxOxSlelf6JLFmdzQj8nXkCwduTFP+mohuZ+4V+/7WVXDuCxhJrPY1cft9uTr VA5djX2Z2BfHHiFh2M0+dgE6PGwYX3rNP04HmZlOrNHmOWNZXxfBJumAOJDD5eVF04g6 XPVd8mPBJD+Ad9RnRpO5yydcWexPYUKDqDWwZvF7uDkbGFCegZTnQpN+9FxA5Ch0syFd ikPpnIjYazDAUp4v/QAMiW7CUYHo9JQkntMVr4FFPQkiTysvRcYATetsKTdoJc9xBSWY Xg== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by userp2130.oracle.com with ESMTP id 2s94bgkuj5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 10 May 2019 22:45:12 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x4AMhSbp190646; Fri, 10 May 2019 22:45:12 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userp3020.oracle.com with ESMTP id 2s94ahm8f7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 10 May 2019 22:45:11 +0000 Received: from abhmp0017.oracle.com (abhmp0017.oracle.com [141.146.116.23]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x4AMj5kX031257; Fri, 10 May 2019 22:45:05 GMT Received: from [192.168.1.222] (/71.63.128.209) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 10 May 2019 15:45:05 -0700 Subject: Re: [PATCH, RFC 2/2] Implement sharing/unsharing of PMDs for FS/DAX To: Larry Bassel , Matthew Wilcox Cc: dan.j.williams@intel.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-nvdimm@lists.01.org References: <1557417933-15701-1-git-send-email-larry.bassel@oracle.com> <1557417933-15701-3-git-send-email-larry.bassel@oracle.com> <20190509164914.GA3862@bombadil.infradead.org> <20190510161607.GB27674@ubuette> From: Mike Kravetz Message-ID: Date: Fri, 10 May 2019 15:45:04 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190510161607.GB27674@ubuette> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9253 signatures=668686 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1905100144 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9253 signatures=668686 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1905100144 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/10/19 9:16 AM, Larry Bassel wrote: > On 09 May 19 09:49, Matthew Wilcox wrote: >> On Thu, May 09, 2019 at 09:05:33AM -0700, Larry Bassel wrote: >>> This is based on (but somewhat different from) what hugetlbfs >>> does to share/unshare page tables. >> >> Wow, that worked out far more cleanly than I was expecting to see. > > Yes, I was pleasantly surprised. As I've mentioned already, I > think this is at least partially due to the nature of DAX. I have not looked in detail to make sure this is indeed all the places you need to hook and special case for sharing/unsharing. Since this scheme is somewhat like that used for hugetlb, I just wanted to point out some nasty bugs related to hugetlb PMD sharing that were fixed last year. 5e41540c8a0f hugetlbfs: fix kernel BUG at fs/hugetlbfs/inode.c:444! dff11abe280b hugetlb: take PMD sharing into account when flushing tlb/caches 017b1660df89 mm: migration: fix migration of huge PMD shared pages The common issue in these is that when unmapping a page with a shared PMD mapping you need to flush the entire shared range and not just the unmapped page. The above changes were hugetlb specific. I do not know if any of this applies in the case of DAX. -- Mike Kravetz