Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2142848pxb; Thu, 4 Nov 2021 14:49:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyxFMIYm1MuOpOpx49rdZAycy9KM3iRfsD/cR3aZqO0c/P52pRCsGcdhgiCTJc4cNZErUzJ X-Received: by 2002:aa7:cb0a:: with SMTP id s10mr71340562edt.289.1636062545734; Thu, 04 Nov 2021 14:49:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1636062545; cv=none; d=google.com; s=arc-20160816; b=oFtcS5B8NHyPhw+l+1AW5CAqpx/VTozUkTzPCc8TG6bLF4QqrnwF7O3AX2VuxW8clp PbzNydxtqY9X6ofVmX/Qvml5UYfFyJ818igAOVkHf47YQPnh+ILYHt3jW+YrR3UvwaZG GMMuwsA/csY5BDi/i0tD+ugEzLwpSsciHNvGoke6n+Q1ZiImZPRuGVFDyKDcdAZSVq+b BKuRUztRbtfHrdZZeH7cZ7xDv4e+Lt7BlWSk9cpJJ+j0O6g4V9waObjv6UIrjyb4WqxH 2F5nDHwigS6C2+Nflf1WLkj4/VZ3f+qa8z1wTOyT3Sn/Cy8UiI69gTRqKK8GR70LuvXG tySg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=V7dGIIYSGvchOcSQ228Cu6R76JroYlbMnP6WdbmEBow=; b=HnkAsLQJIMxiS8iWLbdNVgtZMVd2kLtsHYsmBhPtk19y1JwquUdve7dH40Q0EYcdil KOdUUlGKfET/ZzydzfdVdl8mx/kjKBIWmU0euqKXWVUs03TL2wWEl+8aiQ076efMXMgm ECilbhHbuquXByeIK9AoY0ZC8A6Cbn24jr+I3YUHb/p02Qb7/ecNz5yRFWWheJxBQEzm pbkh8EtFaN7mrBx5yZNV/11WGyogwEcGUIJ4SAJU90dWns+coQZfeXZOgAlNlPD4Ntzy KgBLrbkAfggizIDyLjPorPQNMs6pDjD5eM8WzZZEyK0uxscrrL/aVHfiZW4NSFoNNrnb xCNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b="0/IS7Ns7"; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id oz6si10040009ejc.398.2021.11.04.14.48.41; Thu, 04 Nov 2021 14:49:05 -0700 (PDT) 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=@linux-foundation.org header.s=korg header.b="0/IS7Ns7"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232040AbhKDVhY (ORCPT + 99 others); Thu, 4 Nov 2021 17:37:24 -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.