Received: by 2002:a05:6a10:5594:0:0:0:0 with SMTP id ee20csp521480pxb; Mon, 25 Apr 2022 15:29:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwL2v9pkimC2oBm7XgUUaZ1Rt0Nzop4sgDHP6bQPyoS/tuqQs8tdKLJ39sxLKP9sGhrRM/v X-Received: by 2002:a17:903:32c8:b0:15d:3359:ca53 with SMTP id i8-20020a17090332c800b0015d3359ca53mr1093293plr.173.1650925782494; Mon, 25 Apr 2022 15:29:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650925782; cv=none; d=google.com; s=arc-20160816; b=sezs+CaZrzDnUm/1aQVTRDP1G0L6JgG4E/6lbl36JzqmUooW8fNl/odRJlVooBsgKr ESN9LR2V1zVRh89vTozJwq91sF0PA5YdzcIUXvYH5eG4ZeUhX/fRMx1dEK3cGt7rBKeq BR/W/QbUoJ/rr9L+1dO33GuCCfwJFMd0nkr6pK6x0Ysp0REhrN+YwTCer9RKdjdW4+I/ 0+8ctPPRlwmPoBt253RHqbJUCdFTuGKs1ynPbF3mCeQGXow31n0oqB5tZP6r6LrrFHyo Y5pQheDsF42V+ODNeFpFNlGtzzCLCiUMd/qLWRY12eyHFFWAiiTfiLwA0PSmyagJPRY1 FR9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=mVcdSe0PHoJRh6aQ4K1v60KgaaEyFYrz6ExO46haELU=; b=b0b0e7ZQKYRvObDAS+EXZKonS/qqXQNjWk5FkJHwZYTCBrdqjvlq/9BrGTgt/vgDjs gNgaCe45tXNrmrvMxqrkTv/WXUC8XnIyT5NiUeGKrRdj2VzvssVc8Gs7vqPHHhdQ9OHH XTAmhJ5wVOzonvLHzXZANBF2RhJ8FjMNhzW8i9sI3fnCvQ3JC2B/UNZicAvJCBn5iuhT pMnz75m1er7gEwhdEKYNmffRObzU1147LAtF0Ehs5unTk59VaQcZb8RgrF49kqn72nPO 3wb6aDqc+9n8aIPLLJ+VlkYl8bho2WhlBUH3hTg9Cak4CsWv+YFQKndFdMxcgLlCG87p F8PQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=M7pL3mS8; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mr23-20020a17090b239700b001cb7af1047esi506116pjb.100.2022.04.25.15.29.26; Mon, 25 Apr 2022 15:29:42 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=M7pL3mS8; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238050AbiDYLME (ORCPT + 99 others); Mon, 25 Apr 2022 07:12:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34142 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233499AbiDYLLz (ORCPT ); Mon, 25 Apr 2022 07:11:55 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 50D46FEC for ; Mon, 25 Apr 2022 04:08:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650884927; 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=mVcdSe0PHoJRh6aQ4K1v60KgaaEyFYrz6ExO46haELU=; b=M7pL3mS8y26sSEkiuvyJSdqzQr82toKMH0NVZesYpDZHmw7z7/d0hFCHx0RTskLNNJ/8GT jTlKopZ5+ZNRbkBoviq7gtntfBP03j3kvstecrQs6nN7OujXcNhq6PnfBxrlxgX1wzb5yZ CbD5UlSYE95lowJeuJ/5SrGQiHGXhzM= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-317-CZA0cUpZMiuejMZeGY4p9w-1; Mon, 25 Apr 2022 07:08:44 -0400 X-MC-Unique: CZA0cUpZMiuejMZeGY4p9w-1 Received: by mail-wm1-f70.google.com with SMTP id bh11-20020a05600c3d0b00b003928fe7ba07so7023015wmb.6 for ; Mon, 25 Apr 2022 04:08:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=mVcdSe0PHoJRh6aQ4K1v60KgaaEyFYrz6ExO46haELU=; b=SZ/RAYzUILvA51iVFdwRyvuQ8Yjh5bZFVgvdMBWHlL8WlsA1ATCshpe+aafUbJ6l0z s8jwReuIGZHJQLcYbb0/NtRHiuvDGc4YgAkVWXU/MhTMA/2x7g4wELn7ljL43LrfvK6k 6ijgFWmknm14l5L0YsSubpg7IoIBVnWcPZCty/tTqiVj9MT4+DJWQgwwjYaJ4oCmjJA7 sofU2r7i5eiGTeJfRZkZkQhB7csjPLa5LlFZq0kqRyZQfCmuf+g3OyI/dBUxP2gtogQD 3QtWboz4qw6L3en5qU+kfkxTK24I6WmcGIpee/z2FzBmtSvUmPD5GLPUD7RAN42PeqFw Geeg== X-Gm-Message-State: AOAM531JfDFdasj7GVqj407JCTEKvLzsDZN+b+KXb+axXHbI3UkImu4J UtC41mbF/SojL1m7HqscjRahiQpbD2q5W+iBZ/gFovTLDGSPVDVje3xohRH6xcC+2iV2EskpPvo cRqlm46Jwd+Iy4SuTVuIxv+tRuL6246wuNKZxZDHw X-Received: by 2002:a7b:c190:0:b0:38e:7e47:744a with SMTP id y16-20020a7bc190000000b0038e7e47744amr15998332wmi.38.1650884923342; Mon, 25 Apr 2022 04:08:43 -0700 (PDT) X-Received: by 2002:a7b:c190:0:b0:38e:7e47:744a with SMTP id y16-20020a7bc190000000b0038e7e47744amr15998315wmi.38.1650884923163; Mon, 25 Apr 2022 04:08:43 -0700 (PDT) MIME-Version: 1.0 References: <20220423100751.1870771-1-catalin.marinas@arm.com> In-Reply-To: From: Andreas Gruenbacher Date: Mon, 25 Apr 2022 13:08:32 +0200 Message-ID: Subject: Re: [PATCH v4 0/3] Avoid live-lock in btrfs fault-in+uaccess loop To: Catalin Marinas Cc: Linus Torvalds , Andrew Morton , Josef Bacik , Al Viro , Chris Mason , David Sterba , Will Deacon , linux-fsdevel , Linux ARM , linux-btrfs , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE 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 Hi Catalin, On Sat, Apr 23, 2022 at 8:40 PM Catalin Marinas wrote: > 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. sounds good to me, thank you. > > 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. This started working correctly with commit bc1bb416bbb9 ("generic_perform_write()/iomap_write_actor(): saner logics for short copy") by Al from last May. > 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. Thanks, Andreas