Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp25666pxb; Mon, 8 Feb 2021 14:06:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJwP6z3ki85vZlzoQJRUipAmk+6InYsmXcUdpRPEcL3J5rlAFI6aEwaTnWyGlmntMPbebyo/ X-Received: by 2002:ac2:4c25:: with SMTP id u5mr4152439lfq.160.1612822012126; Mon, 08 Feb 2021 14:06:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612822012; cv=none; d=google.com; s=arc-20160816; b=TPm8ytGKtwD2bsR3t7fsRePafWMUQvN6GlI3YdoKzyFDSYpSuCP/XDKW5ID4s0ctfj XLYBnZO296m/xzLScC1mfFJEOPXAI6FEK85bY5ZrdwcTo9TONMtIkzzTrUQh3K2Krci5 ilNI882q8335GgkN9MNmzC8D+hRiH7OW+eu+LYd6CdR3eJAAqiq/dE754esXWKSTWr/F vDq7oxNTxG9SvPzNbT68TWnaLYBlZ/ZgrCquy++A83nH0aLMTmxxzmJvf3JwismnT01p i05GENaQtHDDBHRMxzqrJV64g4W547mAROwrfVZtc9BcKMdQt6pPq1eN9RE2ryXgK7Xa 7CRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=lTX0pF9nf8RNJQU7qZz8qZTgTzfq7MWAZYxVYVxWqa8=; b=j4wLxl7ytAnu2oiQXL/cfnlJ6Es1TOpNjDeLPi+N0j3e17oZR0WuF9x9mKfkcz6OHd PUNjBSLnsC+0ESGv6wUrFpyFFW4StyoOhMfvTZIIuRhc1opLJnJdiygYILWwlG66f/I1 AQAtUPwftutR39uyrmxtoSAA76piKmDLfHO2IbsljTc39E9y83z4xshH9h07ACn2KszB TazoheUlRr7co3ormKkqZzrQ525oQlmroELs1ZyBTZnLXEbwySOBdCNKPKIjdKBJlRdk c6uwToYiyQFmLWNNKPp8GYQn7YZEN0TirgxW5oFEo3uvdeDv7de4bcUlDGLV95iPs7XB JNvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=bY3sFMy3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h12si12825763eds.288.2021.02.08.14.06.17; Mon, 08 Feb 2021 14:06:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=bY3sFMy3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230059AbhBHWEf (ORCPT + 99 others); Mon, 8 Feb 2021 17:04:35 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:39657 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229691AbhBHWEc (ORCPT ); Mon, 8 Feb 2021 17:04:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612821786; 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: in-reply-to:in-reply-to:references:references; bh=lTX0pF9nf8RNJQU7qZz8qZTgTzfq7MWAZYxVYVxWqa8=; b=bY3sFMy3NOaD6WNQ4AzVLfSgaiTMS0yCqGKyor08in4jZb8fF5bFmCbaCacJd1CVefPovE mr+s/DMqsLRk7U9rJZjrUNXoFOpdwqB3LCR/kI9Fk1bF2uSmcbzuxIRWzrp5arkbbN2Qo8 rTNM3VWaLrKe41hUMiGwZNR64AP5f2Q= Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-474-uGSrIz9BMY6aFMIMV5g0rg-1; Mon, 08 Feb 2021 17:03:04 -0500 X-MC-Unique: uGSrIz9BMY6aFMIMV5g0rg-1 Received: by mail-qk1-f197.google.com with SMTP id f16so14116447qkk.20 for ; Mon, 08 Feb 2021 14:03:03 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=lTX0pF9nf8RNJQU7qZz8qZTgTzfq7MWAZYxVYVxWqa8=; b=AayZe4o1Xa1lBMlsiajVojn8n+LkTYRuAoKn+gWVUmZRfWxn57shyhXnqYNGp5DIZP 6jsmuhtZMsRGE98dY2z20gDwwlkzlXqLgoMZcmrVuxtQ2xRSuoZlehuMdmOmYXqDmV0o q/66IfX71sprjufG64/cDy8qcy8cSMPsL9jqq7kt5x8npYYAuHC3ml/02TJvcyDNJZH2 6FHm3qZYUrn3ZKGBC9X2O6ILhmfRJaIKihN7rtEw2kqDCnsx11/HsWlTvUe5dqv/1NGf e+HoQrZfw3PJXMEiLaAT1zRJPfcfP0thiTPYsiYw8gmsmR4Wts99HW5X6aJRB49UZ985 obOw== X-Gm-Message-State: AOAM533V8Yr8OJmlBpYecKxf4ubpt6noTzKgasp7zJBmVLC7elZRK2Ru +GifjZPneoqMeAsH7TCq/p6+CK+VFwjjHvBGzmVvGtCliTWnsVpEl0K0fVH0A+6I82R4dmPweYO DwV5+SjQ1pu0gZfksZj5dIf52 X-Received: by 2002:ac8:1283:: with SMTP id y3mr16782058qti.328.1612821783546; Mon, 08 Feb 2021 14:03:03 -0800 (PST) X-Received: by 2002:ac8:1283:: with SMTP id y3mr16781975qti.328.1612821782460; Mon, 08 Feb 2021 14:03:02 -0800 (PST) Received: from xz-x1 (bras-vprn-toroon474qw-lp130-20-174-93-89-182.dsl.bell.ca. [174.93.89.182]) by smtp.gmail.com with ESMTPSA id 199sm18235920qkm.126.2021.02.08.14.03.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Feb 2021 14:03:01 -0800 (PST) Date: Mon, 8 Feb 2021 17:02:59 -0500 From: Peter Xu To: Jason Gunthorpe Cc: dan.j.williams@intel.com, Paolo Bonzini , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, linux-mm@kvack.org, Andrew Morton Subject: Re: [PATCH 0/2] KVM: do not assume PTE is writable after follow_pfn Message-ID: <20210208220259.GA71523@xz-x1> References: <20210205103259.42866-1-pbonzini@redhat.com> <20210205181411.GB3195@xz-x1> <20210208185133.GW4718@ziepe.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210208185133.GW4718@ziepe.ca> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 08, 2021 at 02:51:33PM -0400, Jason Gunthorpe wrote: > On Fri, Feb 05, 2021 at 01:14:11PM -0500, Peter Xu wrote: > > > But I do have a question on why dax as the only user needs to pass in the > > notifier to follow_pte() for initialization. > > Not sure either, why does DAX opencode something very much like > page_mkclean() with dax_entry_mkclean()? > > Also it looks like DAX uses the wrong notifier, it calls > MMU_NOTIFY_CLEAR but page_mkclean_one() uses > MMU_NOTIFY_PROTECTION_PAGE for the same PTE modification sequence?? > > page_mkclean() has some technique to make the notifier have the right > size without becoming entangled in the PTL locks.. Right. I guess it's because dax doesn't have "struct page*" on the back, so it can't directly use page_mkclean(). However the whole logic does look very similar, so maybe they can be merged in some way. Thanks, -- Peter Xu