Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3088594pxk; Mon, 21 Sep 2020 05:07:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzH+DjYJKJFrcSxD3kr3FRpM92E4H1QLb0QkxfxFwLcy7nX2lKKKQm5iAQ72zrpAwC6gyE5 X-Received: by 2002:a17:906:17c6:: with SMTP id u6mr50505179eje.95.1600690042548; Mon, 21 Sep 2020 05:07:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600690042; cv=none; d=google.com; s=arc-20160816; b=JthNNAOXOo8/qwaSN6oDfHPYUpfKSXlNfuEd79X5O76V13nmMC+QHByQ5Zl7W713mG rIr9/5f7347LWkAkAR1de90CZgr+oiMVsL7SCI2DjvK7Sl2zH5lDM2VK5xtHmoWA+8aa CLbwZKIZovW+QodDATkK55xsYc1wujkfCQ4IOtVzTgKUTwMMthDoD5NEgW7A2AthxLvc 7qQII10o3JwRh1GvBd/EafIbLKE2Iwkgy2wlTABu9Oslh4fc4SkG762uNjRPi+TWWlhN /9BRlPZsDfy2xajX8aEJQbbkUkfbLWmk8IUZHrE1VMPwgZBhy03fhcqhM4tgv69FwPUZ Sa6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=n8wdHOSqWX61vRwJu5wuprxjYIoUJUkiAYkQze1elTI=; b=gG2JkZJMq6ItSgv8UFfz+tjxS6+WYYDssTlI8RLmNTTElhRs8Cq2TGG4xhEpJMz1Bi zOKfAlAFiIbT5Aif4sSRRARg1r1V/Bcd/TJAZSQ1mruQnHd4rAgYUuRETnkohRkPT9KW yhJm30r67RmGV8P61hVNHj5gLsrfbA5lJeTr3ZBH7fj8bqGGmFXhNzMH6z2SYcMKFG8h JL/12pGxE5ooQqYpt50Dzr0T3GOric77GDZclrH6+AZ4CusUF9KbZbGKmCmpWrX8SbYJ CZI+Het80HJHVGHSm+2vrY+rFGbT5zOt/gTrVbog130kuoS8MDYIO1d4vcIq1hZ2YpJ5 AR+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=Abeh9hY1; 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 s23si7695308ejd.95.2020.09.21.05.06.59; Mon, 21 Sep 2020 05:07:22 -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=@ziepe.ca header.s=google header.b=Abeh9hY1; 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 S1726830AbgIUMDH (ORCPT + 99 others); Mon, 21 Sep 2020 08:03:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46760 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726413AbgIUMDE (ORCPT ); Mon, 21 Sep 2020 08:03:04 -0400 Received: from mail-qk1-x742.google.com (mail-qk1-x742.google.com [IPv6:2607:f8b0:4864:20::742]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F79DC061755 for ; Mon, 21 Sep 2020 05:03:04 -0700 (PDT) Received: by mail-qk1-x742.google.com with SMTP id c62so1412352qke.1 for ; Mon, 21 Sep 2020 05:03:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=n8wdHOSqWX61vRwJu5wuprxjYIoUJUkiAYkQze1elTI=; b=Abeh9hY13m5rcDf2R4a80dJzuu1Hee7Ih3j8Yks8xuSgit73vPIzQdanCSdIw4+0Jx b8U0FIKHH7P6i/m4hI7yUqj2zNJX7luPpS2tQcwn1/MG930FELuaFpn9JE15hbEWr3qx 5D5OlIBvua1SxZ2GAE1c5fIP18Rc2GC+9l1VLxgsh/1WG0So4jnOgA1/dymBfItFroZM qn7BY+C0WphAZp5muInIfPXxgVDk8z5ncjjOyKuX74nXveEjW34BOyCy5TVXzoPhvo0n lNxcnfrxwioFXE3ba5wxVcOn6IjcIe+pKiAVaKZb6vhwB+Vtgp5SHcPLstP16bTqhta0 BR9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=n8wdHOSqWX61vRwJu5wuprxjYIoUJUkiAYkQze1elTI=; b=oHMyC3pY71WO1CCaXpIviTqUp+K7GEPJHluXDUO7TIOu+e65brFp26BHBcoDWPs+Dt 2HkOrN09Dbf9BhnZdZNDC0a5Rs5SqDL/VvzbncLooQLkL9fy47MAe57H78D3LFKTT5z+ Fk5w8yGNIX8OcKr2ZWAkkdzdIdiBRMFiIu/LPECNk1oximkVqRPeCp4f497cqe7hRLRv QJtswC/UHsOhj5a3NZdLX61iLfIRtquKsJLUC2oE5BfWxyrmPMwrQHOMZJlEP+Q0fZ8j I13qAcjGtySXkQlhldvKlCuN/kOiIvHYX+iXoBiLjE2fz2YREHAuJVyrX/+xoNfCaaGQ X35g== X-Gm-Message-State: AOAM530sqMUP4FaFYRffZpGF+KSNa9WXRs4pHUZXtRmujoV9JTB9wR3H bgaq0odN96Jqmw1z1p8PZfoUKA== X-Received: by 2002:a05:620a:2118:: with SMTP id l24mr33949186qkl.298.1600689783454; Mon, 21 Sep 2020 05:03:03 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-156-34-48-30.dhcp-dynamic.fibreop.ns.bellaliant.net. [156.34.48.30]) by smtp.gmail.com with ESMTPSA id b28sm4962241qka.117.2020.09.21.05.03.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Sep 2020 05:03:02 -0700 (PDT) Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1kKKX7-002aiF-T0; Mon, 21 Sep 2020 09:03:01 -0300 Date: Mon, 21 Sep 2020 09:03:01 -0300 From: Jason Gunthorpe To: Jan Kara Cc: John Hubbard , Peter Xu , Linus Torvalds , Leon Romanovsky , Linux-MM , Linux Kernel Mailing List , "Maya B . Gokhale" , Yang Shi , Marty Mcfadden , Kirill Shutemov , Oleg Nesterov , Jann Horn , Kirill Tkhai , Andrea Arcangeli , Christoph Hellwig , Andrew Morton Subject: Re: [PATCH 1/4] mm: Trial do_wp_page() simplification Message-ID: <20200921120301.GD8409@ziepe.ca> References: <20200917112538.GD8409@ziepe.ca> <20200917193824.GL8409@ziepe.ca> <20200918164032.GA5962@xz-x1> <20200918173240.GY8409@ziepe.ca> <20200918204048.GC5962@xz-x1> <0af8c77e-ff60-cada-7d22-c7cfcf859b19@nvidia.com> <20200919000153.GZ8409@ziepe.ca> <20200921083505.GA5862@quack2.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200921083505.GA5862@quack2.suse.cz> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 21, 2020 at 10:35:05AM +0200, Jan Kara wrote: > > My thinking is to hit this issue you have to already be doing > > FOLL_LONGTERM, and if some driver hasn't been properly marked and > > regresses, the fix is to mark it. > > > > Remember, this use case requires the pin to extend after a system > > call, past another fork() system call, and still have data-coherence. > > > > IMHO that can only happen in the FOLL_LONGTERM case as it inhernetly > > means the lifetime of the pin is being controlled by userspace, not by > > the kernel. Otherwise userspace could not cause new DMA touches after > > fork. > > I agree that the new aggressive COW behavior is probably causing issues > only for FOLL_LONGTERM users. That being said it would be nice if even > ordinary threaded FOLL_PIN users would not have to be that careful about > fork(2) and possible data loss due to COW - we had certainly reports of > O_DIRECT IO loosing data due to fork(2) and COW exactly because it is very > subtle how it behaves... But as I wrote above this is not urgent since that > problematic behavior exists since the beginning of O_DIRECT IO in Linux. Yes, I agree - what I was thinking is to do this FOLL_LONGTERM for the rc and then a small patch to make it wider for the next cycle so it can test in linux-next for a responsible time period. Interesting to hear you confirm block has also seen subtle user problems with this as well. Jason