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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DE400C433EF for ; Wed, 22 Dec 2021 12:44:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236858AbhLVMoZ (ORCPT ); Wed, 22 Dec 2021 07:44:25 -0500 Received: from smtp-out1.suse.de ([195.135.220.28]:44782 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231523AbhLVMoX (ORCPT ); Wed, 22 Dec 2021 07:44:23 -0500 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 80D5E2112B; Wed, 22 Dec 2021 12:44:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1640177061; h=from:from:reply-to: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=qy9gFIp2QxGl6WSv0UolBUI85R2Q8lLoLh2lTwoavFk=; b=gPSZWtxqFRZZ4KYSXRQOlHU1Vtzaz1MVqqA9I2kvB7ngleLRUnJ0pKIZFbByHTkRhNAhhf JsB3sZtNH4drYNDmMY53AP59YzK0mOQRF9rNJZdPIdY/Lz8ty0td2+IHTTZ3GzrJKbsr5u 7S7EVOkAIeUr0UbGMWRmmlw8KcNhjas= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1640177061; h=from:from:reply-to: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=qy9gFIp2QxGl6WSv0UolBUI85R2Q8lLoLh2lTwoavFk=; b=0GCk4fJ1+0SXjygAjwsjRaLC7Mu6dmG1KrJSOe+cpupyUT24+CFPMoDzHQkFsNRVH+mSIS IgVCteXCYXE8/0Ag== Received: from quack2.suse.cz (unknown [10.163.28.18]) by relay2.suse.de (Postfix) with ESMTP id 66E23A3B83; Wed, 22 Dec 2021 12:44:21 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 4517C1F2CEF; Wed, 22 Dec 2021 13:44:21 +0100 (CET) Date: Wed, 22 Dec 2021 13:44:21 +0100 From: Jan Kara To: Jason Gunthorpe Cc: David Hildenbrand , Linus Torvalds , Nadav Amit , Linux Kernel Mailing List , Andrew Morton , Hugh Dickins , David Rientjes , Shakeel Butt , John Hubbard , Mike Kravetz , Mike Rapoport , Yang Shi , "Kirill A . Shutemov" , Matthew Wilcox , Vlastimil Babka , Jann Horn , Michal Hocko , Rik van Riel , Roman Gushchin , Andrea Arcangeli , Peter Xu , Donald Dutile , Christoph Hellwig , Oleg Nesterov , Jan Kara , Linux-MM , "open list:KERNEL SELFTEST FRAMEWORK" , "open list:DOCUMENTATION" Subject: Re: [PATCH v1 06/11] mm: support GUP-triggered unsharing via FAULT_FLAG_UNSHARE (!hugetlb) Message-ID: <20211222124421.GB685@quack2.suse.cz> References: <5A7D771C-FF95-465E-95F6-CD249FE28381@vmware.com> <20211221010312.GC1432915@nvidia.com> <900b7d4a-a5dc-5c7b-a374-c4a8cc149232@redhat.com> <20211221235916.GI1432915@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211221235916.GI1432915@nvidia.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 21-12-21 19:59:16, Jason Gunthorpe wrote: > On Tue, Dec 21, 2021 at 06:40:30PM +0100, David Hildenbrand wrote: > > > What adds complexity to correctly maintain the "exclusive" state are at > > least: > > * KSM (might be harder, have to think about it) > > I know little about it, but isn't KSM like fork where it is trying to > WP pages with the intention of copying them? Shouldn't KSM completely > reject WP'ing a page that is under any kind of writable GUP? I know little about KSM as well but I think fundamentally it has similar requirements for anon pages as filesystems have for page cache pages e.g. when doing block deduplication or data checksumming... I.e., it needs to make sure data in the page is stable and nobody can modify it. Honza -- Jan Kara SUSE Labs, CR