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 2595FC433EF for ; Thu, 4 Nov 2021 21:34:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 04F0E6120F for ; Thu, 4 Nov 2021 21:34:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232087AbhKDVh3 (ORCPT ); Thu, 4 Nov 2021 17:37:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:46170 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231142AbhKDVhW (ORCPT ); Thu, 4 Nov 2021 17:37:22 -0400 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.