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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C41D1C433F5 for ; Fri, 5 Nov 2021 01:01:46 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 56C1961245 for ; Fri, 5 Nov 2021 01:01:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 56C1961245 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id AE711940007; Thu, 4 Nov 2021 21:01:45 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A6F396B0071; Thu, 4 Nov 2021 21:01:45 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 90FC0940007; Thu, 4 Nov 2021 21:01:45 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0036.hostedemail.com [216.40.44.36]) by kanga.kvack.org (Postfix) with ESMTP id 7AFAC6B006C for ; Thu, 4 Nov 2021 21:01:45 -0400 (EDT) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 3A8EF2DEA3 for ; Fri, 5 Nov 2021 01:01:45 +0000 (UTC) X-FDA: 78773074170.07.3DE7671 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf14.hostedemail.com (Postfix) with ESMTP id 54F9660019B4 for ; Fri, 5 Nov 2021 01:01:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1636074104; 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=6G9HPQ/emv9d7E8DEdmRVOijMc6XntyMaOnJpQd0Rb4=; b=YDbOzcpAY/Rl3zKwN6rrsSp8zp2oPARrGMFqcm33lrJTsZdew8ZwW5llAsHWR7/WkV6JmL 0fXsxGubcDmNbAxhfMBFS/AD3q8VlL1jc0W+F1+dMRY6PBmD0hUQnuagKWIf4r1Wzh+V3U Z/LXWecq8wiFtcu/K58u3yN5YXGDW9s= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-150-YMJbvRkCNyOjIX5iSN374g-1; Thu, 04 Nov 2021 21:01:43 -0400 X-MC-Unique: YMJbvRkCNyOjIX5iSN374g-1 Received: by mail-wr1-f71.google.com with SMTP id y4-20020adfd084000000b00186b16950f3so1649638wrh.14 for ; Thu, 04 Nov 2021 18:01:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=6G9HPQ/emv9d7E8DEdmRVOijMc6XntyMaOnJpQd0Rb4=; b=2WZTOV7AHopEvOO73cZseEhi9+denHAhx3WYs309kunfW+c+bNLnzc03qBTUlge1ie xIZdRWnLis5KLhjQHD/EEPGk7eAdUeYIZTl0H6oS0ht9CWNEW3vzs4+X/F1LH0wuOlKh PmYovWn/SKtwj2L37Hgg/d5q/gDagdN/GuTsnKYGPDNMaYvexJtfWaM5jcVSftJMjTa/ j4E1gmU/m65Bgk2CiFeXC6OcJj3fJLsD/+51vzbHDfiIcKm00jf66/UBTzbDJ6YZN/J3 CBQHkly7rUuRGTaz5NJrP/wiZGHCHBmmJjMOokjU3ntqBoy1v2dgkqWjIK05pHw685t6 BZzw== X-Gm-Message-State: AOAM532Zdwsy5fBKeSQ//4NEbklIdpZ48g9VeOB/1cnB6/c9hSQ6TcXG x2mLRagURvnbqMA8OmNNZyfV2zXwVbqRjhnMJ7lflpqimNwy3fDRdONSRYvkO4/4QfmDokwqUud 9X5S+4UBk5Lk= X-Received: by 2002:adf:9bcd:: with SMTP id e13mr26466758wrc.165.1636074101893; Thu, 04 Nov 2021 18:01:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzS2XA17KQfu/AZsL6oOpqh0ZJcGrolZ6YsKssmQ5RJJXoY/6fp3PHwH2dABd2spdsFUBLIEw== X-Received: by 2002:adf:9bcd:: with SMTP id e13mr26466717wrc.165.1636074101595; Thu, 04 Nov 2021 18:01:41 -0700 (PDT) Received: from xz-m1.local ([85.203.46.190]) by smtp.gmail.com with ESMTPSA id j19sm6402891wra.5.2021.11.04.18.01.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Nov 2021 18:01:41 -0700 (PDT) Date: Fri, 5 Nov 2021 09:01:32 +0800 From: Peter Xu To: Andrew Morton Cc: Hugh Dickins , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrea Arcangeli , Liam Howlett , Mike Rapoport , Yang Shi , David Hildenbrand , "Kirill A . Shutemov" , Jerome Glisse , Alistair Popple , Miaohe Lin , Matthew Wilcox , Axel Rasmussen Subject: Re: [PATCH v4 1/4] mm/shmem: Unconditionally set pte dirty in mfill_atomic_install_pte Message-ID: References: <20210915181456.10739-1-peterx@redhat.com> <20210915181456.10739-2-peterx@redhat.com> <49fddb9a-4a52-1df-8b7c-dde2a89330bf@google.com> <256c72c4-ac99-94fb-d76-fab08e5cf5f4@google.com> <20211104143440.d0056137ee07d3e96d6b56ec@linux-foundation.org> MIME-Version: 1.0 In-Reply-To: <20211104143440.d0056137ee07d3e96d6b56ec@linux-foundation.org> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 54F9660019B4 X-Stat-Signature: yy8i1k773wfghrj9jk8bxpftuafqpq8i Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=YDbOzcpA; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf14.hostedemail.com: domain of peterx@redhat.com has no SPF policy when checking 170.10.133.124) smtp.mailfrom=peterx@redhat.com X-HE-Tag: 1636074105-130894 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, Nov 04, 2021 at 02:34:40PM -0700, Andrew Morton wrote: > On Tue, 28 Sep 2021 17:37:31 -0400 Peter Xu wrote: > > > > How about a compromise (if you really want to continue with this patch): > > > you leave the SetPageDirty(page) in shmem_mfill_atomic_pte(), where I > > > feel a responsibility for it; but you do whatever works for you with > > > pte_mkdirty() at the mm/userfaultfd.c end? > > > > Sure. Duplicating dirty bit is definitely fine to me as it achieves the same > > goal as I hoped - we're still 100% clear we won't free a uffd page without > > being noticed, then that's enough to me for the goal of this patch. I won't > > initiate that NACK myself since I still think duplicating is unnecessary no > > matter it resides in shmem or uffd code, but please go ahead doing that and > > I'll be fine with it, just in case Andrew didn't follow the details. > > I think Hugh was asking you to implement this... > > I guess I'll send this patch upstream. But it does sound like Hugh > would prefer a followon patch for this kernel release which makes the > above change, please. Thanks Andrew for helping. But as I mentioned I still think that's odd to set dirty in both places. That's why I don't want to draft the patch because I am not very willing to sign-off.. If Hugh agrees, I can post the patch with Hugh's sign-off, adding the PageDirty back too. I am during a holiday so I cannot follow up the whole thing today, but if it's easier for you to drop that patch or even drop the whole series, please feel free to do. I can rework everything too, then I'll try to get Hugh's ack again on every single patch, as long as Hugh will have time to look at it in the future. Thanks, -- Peter Xu