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=-7.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 B486BC433ED for ; Wed, 7 Apr 2021 18:47:31 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 491B861168 for ; Wed, 7 Apr 2021 18:47:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 491B861168 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id CAF2F6B0073; Wed, 7 Apr 2021 14:47:30 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C860D6B0078; Wed, 7 Apr 2021 14:47:30 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B26216B007D; Wed, 7 Apr 2021 14:47:30 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0229.hostedemail.com [216.40.44.229]) by kanga.kvack.org (Postfix) with ESMTP id 96A416B0073 for ; Wed, 7 Apr 2021 14:47:30 -0400 (EDT) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 470A11801C364 for ; Wed, 7 Apr 2021 18:47:30 +0000 (UTC) X-FDA: 78006454260.26.D02F54B Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by imf05.hostedemail.com (Postfix) with ESMTP id F0C64E000108 for ; Wed, 7 Apr 2021 18:47:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617821248; 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: in-reply-to:in-reply-to:references:references; bh=dVEk/1fEkTxDG5RFyJGsfUGGYX5/1CX7VyVlrXRHqbo=; b=hEKhljThC2/rCrdX5j+hk/xO30S+bn+9EoyrrUFFtoWLfZe5rwgEwGvr7k4lpHqo07IdGW 4EErVk5KvLU6kQP7xA28mbFQJuRAzH8Re4gdyHufoozjNGaSzQUoPAwyOdRM2vEx0op83c v17aikJf0iCT5aOZkkr5nJE6fO5eOPw= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-7-X8AAo0wFO4amFynrr9khVQ-1; Wed, 07 Apr 2021 14:47:26 -0400 X-MC-Unique: X8AAo0wFO4amFynrr9khVQ-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E327193D; Wed, 7 Apr 2021 18:47:24 +0000 (UTC) Received: from file01.intranet.prod.int.rdu2.redhat.com (file01.intranet.prod.int.rdu2.redhat.com [10.11.5.7]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9B01C7094A; Wed, 7 Apr 2021 18:47:15 +0000 (UTC) Received: from file01.intranet.prod.int.rdu2.redhat.com (localhost [127.0.0.1]) by file01.intranet.prod.int.rdu2.redhat.com (8.14.4/8.14.4) with ESMTP id 137IlEvK007320; Wed, 7 Apr 2021 14:47:14 -0400 Received: from localhost (mpatocka@localhost) by file01.intranet.prod.int.rdu2.redhat.com (8.14.4/8.14.4/Submit) with ESMTP id 137IlEnf007316; Wed, 7 Apr 2021 14:47:14 -0400 X-Authentication-Warning: file01.intranet.prod.int.rdu2.redhat.com: mpatocka owned process doing -bs Date: Wed, 7 Apr 2021 14:47:14 -0400 (EDT) From: Mikulas Patocka X-X-Sender: mpatocka@file01.intranet.prod.int.rdu2.redhat.com To: Linus Torvalds cc: Suren Baghdasaryan , Vlastimil Babka , Peter Xu , stable , Greg Kroah-Hartman , Jann Horn , Kirill Tkhai , Shaohua Li , Nadav Amit , Linux-MM , Linux Kernel Mailing List , Android Kernel Team , Andrea Arcangeli , David Hildenbrand , Jason Gunthorpe Subject: Re: [PATCH 0/5] 4.14 backports of fixes for "CoW after fork() issue" In-Reply-To: Message-ID: References: <20210401181741.168763-1-surenb@google.com> User-Agent: Alpine 2.02 (LRH 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Rspamd-Queue-Id: F0C64E000108 X-Stat-Signature: wjkyurmzoee3sxoyo35odgge73hk177c X-Rspamd-Server: rspam02 Received-SPF: none (redhat.com>: No applicable sender policy available) receiver=imf05; identity=mailfrom; envelope-from=""; helo=us-smtp-delivery-124.mimecast.com; client-ip=216.205.24.124 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1617821248-421958 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 Wed, 7 Apr 2021, Linus Torvalds wrote: > On Wed, Apr 7, 2021 at 9:33 AM Suren Baghdasaryan wrote: > > > > Trying my hand at backporting the patchsets Peter mentioned proved > > this to be far from easy with many dependencies. Let me look into > > Vlastimil's suggestion to backport only 17839856fd58 and it sounds > > like 5.4 already followed that path. > > Well, in many ways 17839856fd58 was the "simple and obvious" fix, and > I do think it's easily backportable. > > But it *did* cause problems too. Those problems may not be issues on > those old kernels, though. > > In particular, commit 17839856fd58 caused uffd-wp to stop working > right, and it caused some issues with debugging (I forget the exact > details, but I think it was strace accessing PROT_NONE or write-only > pages or something like that, and COW failed). > > But yes, in many ways that commit is a much simpler and more > straightforward one (which is why I tried it once - we ended up with > the much more subtle and far-reaching fixes after the UFFD issues > crept up). > > The issues that 17839856fd58 caused may be entire non-events in old > kernels. In fact, the uffd writeprotect API was added fairly recently > (see commit 63b2d4174c4a that made it into v5.7), so the uffd-wp issue > that was triggered probably cannot happen in the old kernels. > > The strace issue might not be relevant either, but I forget what the > details were. Mikilas should know. > > See > > https://lore.kernel.org/lkml/alpine.LRH.2.02.2009031328040.6929@file01.intranet.prod.int.rdu2.redhat.com/ > > for Mikulas report. I never looked into it in detail, because by then > the uffd-wp issue had already come up, so it was juat another nail in > the coffin for that simpler approach. > > Mikulas, do you remember? > > Linus Hi I think that we never found a root cause for this bug. I was testing if the whole system can run from persistent memory and found out that strace didn't work. I bisected it, reported it and when I received Peter Xu's patches (which fixed it), I stopped bothering about it. So, we fixed it, but we don't know why. Peter Xu's patchset that fixed it is here: https://lore.kernel.org/lkml/20200821234958.7896-1-peterx@redhat.com/ Mikulas