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 28669C38142 for ; Mon, 23 Jan 2023 16:41:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233437AbjAWQlX (ORCPT ); Mon, 23 Jan 2023 11:41:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42184 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233376AbjAWQlE (ORCPT ); Mon, 23 Jan 2023 11:41:04 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1FE8C2CFD4 for ; Mon, 23 Jan 2023 08:39:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1674491935; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=F6M4p2Xue1wGBtqsFC7+lffkyWuM29QlWRyXf+rirlA=; b=aLJpqqWeBzlzi29M2vCpZNRAAOYJ+HfT395PnPxSgkKNS1rlVrSm/obJTqwAwJlur6ICO/ AB15IZXl0Q6rJuA7YCcZIuTSJ5cF2JiZCS+dGiCqy/ITwUP80gjC4iCFo9RVyt9nHpNP3Q G1Rwuruml37cIZhTFncUDxD1GZ1etKI= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-295-k-RZv03IPUWLE_Rw0xersg-1; Mon, 23 Jan 2023 11:38:50 -0500 X-MC-Unique: k-RZv03IPUWLE_Rw0xersg-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id ABC9B3806713; Mon, 23 Jan 2023 16:38:49 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.33.36.97]) by smtp.corp.redhat.com (Postfix) with ESMTP id 65D9C140EBF4; Mon, 23 Jan 2023 16:38:48 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: References: <20230120175556.3556978-1-dhowells@redhat.com> To: Matthew Wilcox Cc: dhowells@redhat.com, John Hubbard , Al Viro , Christoph Hellwig , Jens Axboe , Jan Kara , Jeff Layton , Logan Gunthorpe , linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v7 0/8] iov_iter: Improve page extraction (ref, pin or just list) MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <318137.1674491927.1@warthog.procyon.org.uk> Content-Transfer-Encoding: quoted-printable Date: Mon, 23 Jan 2023 16:38:47 +0000 Message-ID: <318138.1674491927@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Matthew Wilcox wrote: > Why do we want to track that information on a per-page basis? Wouldn't = it > be easier to have a VM_NOCOW flag in vma->vm_flags? Set it the first > time somebody does an O_DIRECT read or RDMA pin. That's it. Pages in > that VMA will now never be COWed, regardless of their refcount/mapcount. > And the whole "did we pin or get this page" problem goes away. Along > with folio->pincount. Wouldn't that potentially make someone's entire malloc() heap entirely NOC= OW if they did a single DIO to/from it. Also you only mention DIO read - but what about "start DIO write; fork(); = touch buffer" in the parent - now the write buffer belongs to the child and they= can affect the parent's write. David