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 79AB4C433F5 for ; Thu, 4 Nov 2021 21:34:46 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id F365361215 for ; Thu, 4 Nov 2021 21:34:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org F365361215 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 78A2B6B0071; Thu, 4 Nov 2021 17:34:45 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 739DA6B0072; Thu, 4 Nov 2021 17:34:45 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 62867940007; Thu, 4 Nov 2021 17:34:45 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0097.hostedemail.com [216.40.44.97]) by kanga.kvack.org (Postfix) with ESMTP id 50B836B0071 for ; Thu, 4 Nov 2021 17:34:45 -0400 (EDT) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 11C7C5CBA0 for ; Thu, 4 Nov 2021 21:34:45 +0000 (UTC) X-FDA: 78772552530.22.07D592B Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf11.hostedemail.com (Postfix) with ESMTP id A631FF000205 for ; Thu, 4 Nov 2021 21:34:44 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 4D9BD610A8; Thu, 4 Nov 2021 21:34:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1636061683; bh=b9ieur7aNNFpZIWaMvq8mLV6GoqPCShUcilWd5TLNdk=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=0/IS7Ns7MQ8Lr0cS26946mUA1I8PI2l+hMkC9rmDDysMrgINx3UlugGKpcIWJRQAb egjnOhSagwsxpVSgpCz2O0aahA9HQwNOIFc3pXFdWPfRwajh5lL6ALm+FAtiB1mjQL vgOsiLH9Jg35fJE5v2JckANwndIFLdIpEA9uYVok= Date: Thu, 4 Nov 2021 14:34:40 -0700 From: Andrew Morton To: Peter Xu 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: <20211104143440.d0056137ee07d3e96d6b56ec@linux-foundation.org> In-Reply-To: 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> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b="0/IS7Ns7"; dmarc=none; spf=pass (imf11.hostedemail.com: domain of akpm@linux-foundation.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: A631FF000205 X-Stat-Signature: eqyp7ecnu1nwtjeg8sxiptyezdzko8zj X-HE-Tag: 1636061684-723239 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 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.