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=-6.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 2BC5AC433E0 for ; Mon, 8 Feb 2021 22:04:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D10EF64E66 for ; Mon, 8 Feb 2021 22:04:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230229AbhBHWEu (ORCPT ); Mon, 8 Feb 2021 17:04:50 -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-Google-Smtp-Source: ABdhPJxcP//hjTyuOLVPNFX+cbxbejOsxicI0aDwcP+30/uSNwdFb2okin6reP+9lxD9CelvjcyuBg== 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