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 X-Spam-Level: X-Spam-Status: No, score=-3.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8546DC43464 for ; Mon, 21 Sep 2020 12:03:06 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id EDE6B216C4 for ; Mon, 21 Sep 2020 12:03:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="Abeh9hY1" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EDE6B216C4 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 402DF900053; Mon, 21 Sep 2020 08:03:05 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3B2796B00AE; Mon, 21 Sep 2020 08:03:05 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2C8C6900053; Mon, 21 Sep 2020 08:03:05 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0235.hostedemail.com [216.40.44.235]) by kanga.kvack.org (Postfix) with ESMTP id 185186B00AD for ; Mon, 21 Sep 2020 08:03:05 -0400 (EDT) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id C8B20362C for ; Mon, 21 Sep 2020 12:03:04 +0000 (UTC) X-FDA: 77286932688.24.fowl34_060ae5f27144 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin24.hostedemail.com (Postfix) with ESMTP id AF2F21A4A5 for ; Mon, 21 Sep 2020 12:03:04 +0000 (UTC) X-HE-Tag: fowl34_060ae5f27144 X-Filterd-Recvd-Size: 5453 Received: from mail-qk1-f194.google.com (mail-qk1-f194.google.com [209.85.222.194]) by imf28.hostedemail.com (Postfix) with ESMTP for ; Mon, 21 Sep 2020 12:03:04 +0000 (UTC) Received: by mail-qk1-f194.google.com with SMTP id 16so14610108qkf.4 for ; Mon, 21 Sep 2020 05:03:03 -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=IPFrsI6ofqyxWI7UylhH1SDvNsQvZjHYJt0L8inoflHC54T38+Ijhqz+O6WLdRdjnZ jGYQmHaXB78GRFjrsCi4RbfNIHqglHyxe+PA/zhEDAx0mOJRG0SkfuFgSiUO7G0Mltu5 gg6PJcZXAyWa+XqqSQSFfo6Eejbyxr2OsnfwnHHXHnOTKwWYbCrr5tSa303lWwJTlkyv fo1FpS6uw8Fy+s0q29a4FZRHAwni8NdSjJZTOZEgG88QNd76RjUbZwGX8ejCh1DNlgE6 zwlsfALUUrWGhkKmPX4Vo28cZ2fKelrlvEB006X1QhoRDxkSyBqrIhH+SphSi2xeMNTv Zr4Q== X-Gm-Message-State: AOAM532nhli8XMTMHaIIQgfziTQ5CbBeS/4WA3nCYb39yB5nuTCzd59y LEMnsYrB7u+9wA67meS0YgkEuw== X-Google-Smtp-Source: ABdhPJzxxdYt7396ODoa0fFeiNoyd3GAZ/6tK3YcBmZ4mWLGMfGNFMyjgRDaul4UGozJFwtmiLU5aQ== 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> X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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