Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp2114175pxb; Sun, 24 Apr 2022 05:11:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxnPqCIR1aLQN60KAHZEJygVhFYIvnbV5ziWGrJojN7ivKYOHKXYs/CIF/7NcnOA0s/VJ6H X-Received: by 2002:a50:c3c6:0:b0:416:293f:1f42 with SMTP id i6-20020a50c3c6000000b00416293f1f42mr13693927edf.187.1650802277312; Sun, 24 Apr 2022 05:11:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650802277; cv=none; d=google.com; s=arc-20160816; b=p2hdjvMXUfbMh8dIoQdwJCQ7SJeFmhwl24Qz63+ib9/G/0CyDt3rHGjT1vXok4bLSx 9jCmXWykuydAw9FJkdwWPuLHns0gwl0GZgmIUK8zodyS6uRk2G79kT+fSAJ/BfjFP1J+ Fz1i7Xa+c3VFjM8rGz4/50DNoEZ9XrZ6fPYaGIGvTZPiR6QUmFxfdydyvsjshjwmFu79 pwpDdUSZlkWVIhGw6h75CvMIdvsT4YBncipyPImCcNYJ8imgY2WNNlePMKFIhhttLbTG CEVMFGv2MyJBWiMTsIzVUFP+asOyMGoGWQhqy9r7bOs5sqibfniYz3MfZt9AesANhlJK /6dA== 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; bh=vxILhvd6K6GSv0NJ2xiCERXOsEx7Ke+/ngSpgNuCi8E=; b=L1Ao5WvGHCwDUvDIwbLGVQcbWj0JXPyIO0RcLUH93kGx0cobYswdNBvESFreX/deuM 7nVG2Zdj/d9xKZRXdfM3J1ORST34HObL/6u7dE2AWV3xz7togpg8gGV6nXnSaOFp0jdI tlbJEJBA6XeWrGZzUgfoAhA200jxua4SxNDpVpiejPm1JVIEIZUAOT0U0EpbaDWboPDG H90rqk/jmLn6buvxun7DERt4kguwy4jbNLLyZv2Cf1XHUhP4IrNPvvTQgtVe2FaSrHji rv3sx6KPgw0P/rhSiBL9B2T/hwVNFJNJhDIgxrZiageajx8mWWXhAaOl8flm+Peu66JH XVbQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l21-20020a056402125500b00418c2b5bf6csi10176026edw.590.2022.04.24.05.10.42; Sun, 24 Apr 2022 05:11:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236751AbiDWSnt (ORCPT + 99 others); Sat, 23 Apr 2022 14:43:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51166 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236723AbiDWSnr (ORCPT ); Sat, 23 Apr 2022 14:43:47 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D4423473BC; Sat, 23 Apr 2022 11:40:49 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id C663BB80CC7; Sat, 23 Apr 2022 18:40:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 66F7DC385A0; Sat, 23 Apr 2022 18:40:44 +0000 (UTC) Date: Sat, 23 Apr 2022 19:40:40 +0100 From: Catalin Marinas To: Linus Torvalds Cc: Andrew Morton , Andreas Gruenbacher , Josef Bacik , Al Viro , Chris Mason , David Sterba , Will Deacon , linux-fsdevel , Linux ARM , linux-btrfs , Linux Kernel Mailing List Subject: Re: [PATCH v4 0/3] Avoid live-lock in btrfs fault-in+uaccess loop Message-ID: References: <20220423100751.1870771-1-catalin.marinas@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Apr 23, 2022 at 09:35:42AM -0700, Linus Torvalds wrote: > On Sat, Apr 23, 2022 at 3:07 AM Catalin Marinas wrote: > > > > The series introduces fault_in_subpage_writeable() together with the > > arm64 probing counterpart and the btrfs fix. > > Looks fine to me - and I think it can probably go through the arm64 > tree since you'd be the only one really testing it anyway. I'll queue it via arm64 then. > I assume you checked that btrfs is the only one that uses > fault_in_writeable() in this way? Everybody else updates to the right > byte boundary and retries (or returns immediately)? I couldn't find any other places (by inspection or testing). The buffered file I/O can already make progress in current fault_in_*() + copy_*_user() loops. O_DIRECT either goes via GUP (and memcpy() doesn't fault) or, if the user buffer is not PAGE aligned, it may fall back to buffered I/O. That's why I simplified the series, AFAICT it's only btrfs search_ioctl() with this problem. -- Catalin