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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7969AC54EE9 for ; Fri, 2 Sep 2022 06:49:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235525AbiIBGt2 (ORCPT ); Fri, 2 Sep 2022 02:49:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51816 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235351AbiIBGtZ (ORCPT ); Fri, 2 Sep 2022 02:49:25 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 577CCBCC08 for ; Thu, 1 Sep 2022 23:49:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1662101363; 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=Gn1/pFkVAm17ZLauzUxMQF2RNXwPzrIq/JD90gpJ8rE=; b=gpCQsZWBfsMo8GGn9ORFk6PaW7FVk9j/+Q9JF5dfOb1CenXW7naTckuCSwgJ3XdUnHltzk jkIKItc15OFhgRpapz+6N1AVvEkpK8VkasFMP6Bf3/aK2yQlygBw0bF+sm5RIeTr+DI3mf tXGtEuIH7fEKiyepkXJjtt5qDj3pTB8= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-500-MaXFBhZ8PlWh_OmAS3UQhw-1; Fri, 02 Sep 2022 02:49:22 -0400 X-MC-Unique: MaXFBhZ8PlWh_OmAS3UQhw-1 Received: by mail-wr1-f71.google.com with SMTP id h3-20020adfa4c3000000b002266f5ef273so99049wrb.14 for ; Thu, 01 Sep 2022 23:49:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:subject:organization:from :references:cc:to:content-language:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date; bh=Gn1/pFkVAm17ZLauzUxMQF2RNXwPzrIq/JD90gpJ8rE=; b=0bZ+sJceBACwywxKdEWGtZPP7C2Lhy4tTiaYuUAMKl0iseYnxG82FvgySCCa0Z7AdJ pvdz4lO6MQDg9lZ4BYFV6LKeolU2n3aunlvxurJdCAIYZH8E+wafnei4FsmqCTV5iPSl u61K4jXkek57BuN2FwsrGGe47k6PqHnFCYOM7ok5oBKTauL3d3NnLeRfm1WWloIX/32s GQbuLdxq+fl0bVW3PRa6Dtj+B2rtOPXuvYAPfghOPu5ESznSwredVVZHe6gz2ASy26ct 7MWet+IBs9AIdGAcc6tcaZDK9P8fpj4DtQjgoNuRO1GGD+yyW+qL1hNHn4ZbLr9AYKPa BUEQ== X-Gm-Message-State: ACgBeo0OqVtGQ44/BM4HaHXmJBEN2Lfm6InVbYcBehac+RaLRgoaB1Tq +vKExhXqI0zysmc6deCVz+UH1HBWot+36sH9FXsqkJx08Fdcp18WcvK5f9JlIJhdDWstKywNBDN RKwDeEMtJMscF0fJc8EGoPG/k X-Received: by 2002:a05:6000:817:b0:226:3d89:ebb4 with SMTP id bt23-20020a056000081700b002263d89ebb4mr17030585wrb.699.1662101361045; Thu, 01 Sep 2022 23:49:21 -0700 (PDT) X-Google-Smtp-Source: AA6agR6On1hWE9c9E9R4xYZDbPw8MSd6lWCiA5BI3pDap4N3u8UFtfr1D4s/X8k/SOFVxoKi18Qhbg== X-Received: by 2002:a05:6000:817:b0:226:3d89:ebb4 with SMTP id bt23-20020a056000081700b002263d89ebb4mr17030567wrb.699.1662101360797; Thu, 01 Sep 2022 23:49:20 -0700 (PDT) Received: from ?IPV6:2003:cb:c714:4800:2077:1bf6:40e7:2833? (p200300cbc714480020771bf640e72833.dip0.t-ipconnect.de. [2003:cb:c714:4800:2077:1bf6:40e7:2833]) by smtp.gmail.com with ESMTPSA id g13-20020a05600c4ecd00b003a4c6e67f01sm9088534wmq.6.2022.09.01.23.49.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 01 Sep 2022 23:49:20 -0700 (PDT) Message-ID: <093bae05-419d-737d-73f0-6de59b39b34a@redhat.com> Date: Fri, 2 Sep 2022 08:49:19 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0 Content-Language: en-US To: Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, stable@vger.kernel.org, Jason Gunthorpe , John Hubbard , Andrea Arcangeli , Hugh Dickins , Peter Xu , Alistair Popple , Nadav Amit , Yang Shi , Vlastimil Babka , Michal Hocko , Mike Kravetz , Andrea Parri , Will Deacon , Peter Zijlstra , "Paul E. McKenney" , Christoph von Recklinghausen , Don Dutile References: <20220901083559.67446-1-david@redhat.com> <20220901153512.a59e9e584fb00a350788f56e@linux-foundation.org> From: David Hildenbrand Organization: Red Hat Subject: Re: [PATCH v1] mm: fix PageAnonExclusive clearing racing with concurrent RCU GUP-fast In-Reply-To: <20220901153512.a59e9e584fb00a350788f56e@linux-foundation.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02.09.22 00:35, Andrew Morton wrote: > On Thu, 1 Sep 2022 10:35:59 +0200 David Hildenbrand wrote: > >> The possible issues due to reordering are of theoretical nature so far >> and attempts to reproduce the race failed. >> >> Especially the "no PTE change" case isn't the common case, because we'd >> need an exclusive anonymous page that's mapped R/O and the PTE is clean >> in KSM code -- and using KSM with page pinning isn't extremely common. >> Further, the clear+TLB flush we used for now implies a memory barrier. >> So the problematic missing part should be the missing memory barrier >> after pinning but before checking if the PTE changed. > > Obscure bug, large and tricky patch. Is a -stable backport really > justifiable? Fair question, was asking myself the same. As you're wondering about the same, I don't think so. Let's drop it. Out of the CONFIG_HAVE_FAST_GUP supporting architectures primarily only the 32bit architectures can even lose the PageAnonExclusive during swapout (until we make them all preserve it in the swp PTE), the other ones already support preserve it. So unless fork() would be involved at the wrong time as well, x86-64, s390x, aarch64, ppc64 book3s ... wouldn't even have a real issue with this race. (note that the actual code changes are small -- but yes, I think linux-stable rules always consider the full patch LOC) -- Thanks, David / dhildenb