Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1108786pxv; Thu, 1 Jul 2021 17:42:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwixoTxk6WdsUBa6vKCzDnsVRAEWSUBVbKxxO4n1QTNq94N/yNtNWTRSmpHVvOvWo2avaZG X-Received: by 2002:a17:906:3386:: with SMTP id v6mr2589396eja.434.1625186562083; Thu, 01 Jul 2021 17:42:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625186562; cv=none; d=google.com; s=arc-20160816; b=hMpyG+wbgPhJxDZg2bbhXwfWXOYFrwW0uNu2Fd9cXua2kFAyBO4xcju7lec5aITE5D zuURX2547mXm5qB4vyRZ4V9ua5tTRvBx1QR5MCqeLKl5AU66SXJNaQaOnpZaGNOlQReW bxMqAC19qUfNdbbBmDQiqypLnKWPAeeevf0kA6KQE4PiKOiF1vsjUw7dHFoLf6bzFsM1 c0KgeeYwsnhTSn3MLiUmO5TIr7UObzgfQOtU8zk/d8i6BBd6QAetPOF7M6KC9EfGH3+L q71e9gWQLJSKW3pAWQMNl3CnlBopBX3f8Wn1SKH1DZqO0U8INNuzQLSqkFZEzHghgPK/ 0YTQ== 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=bJvQk/Alftrz3YVUjbu29T6DoGupesSg/dDRXRbYPhA=; b=ycx5OUunMMy3nr0pFLV9RwNA7rI5baNYuvkI6f9ydihNM8h16apdQVHOkCunKbyP4W WbOMAVmU41BCAYAU6iEENvtV+I9AKIwPDzNa1XspydQDtHgcCwI8+aGjOLCN67+ltXMw j8jA6aFkfrpd+gN5kEH3fYy/9bExd6FogdeUUbkgBR2UQP2TYsvYqyyKDno0CGVkXwKK ii4wxAqCf168ASuI4S4iji83I1M5KgW35a5/rGtAblDMEYNRczdpL88kQxddekGOuWmY b4HXWlT92zd/WzA3rcfn9hN4OgjTLeIt40Geyt3DS7co6jAuGRtrN6T93skSJRIidrKh hmoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=SVvtIYIA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h14si1411148edq.364.2021.07.01.17.42.15; Thu, 01 Jul 2021 17:42:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=SVvtIYIA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234445AbhGBAdT (ORCPT + 99 others); Thu, 1 Jul 2021 20:33:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54144 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230415AbhGBAdT (ORCPT ); Thu, 1 Jul 2021 20:33:19 -0400 Received: from mail-lj1-x22a.google.com (mail-lj1-x22a.google.com [IPv6:2a00:1450:4864:20::22a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6AD5CC061762 for ; Thu, 1 Jul 2021 17:30:47 -0700 (PDT) Received: by mail-lj1-x22a.google.com with SMTP id k21so10985180ljh.2 for ; Thu, 01 Jul 2021 17:30:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=bJvQk/Alftrz3YVUjbu29T6DoGupesSg/dDRXRbYPhA=; b=SVvtIYIAvKTDQpKRfVjOwCnujyR61TBG4yZhipigFvuTp/YCXE7jq5gzL82D5wXtaR oKMWIB/FCXm9SO0cNEVgkmR+UUPX/6lGNbi3IB6xg4QgUjXFrN1WXgqfM9F9sFMs8Ugs 6LvKysEba7oWQnlYRe7QpDHGvX47PEmkHCEXA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=bJvQk/Alftrz3YVUjbu29T6DoGupesSg/dDRXRbYPhA=; b=qqFetWXOffh86NwI5GwmJVxA5fhoAcW4yfwMbdDwyVyv+3wwkOCw3RXth9nt4bVfQV NAuoBTlslqPfa45Uz7yNJtDBnFqV7piC70h1fT1UyHwhN/E9Eau+zNFEAUrkI6cN1pXY rTaQ7zgNDepz0ep9aX2QWSf4k8uouQHxszKGXO9EuBjIrBtzFRvGIrX0szPv3WorQKzF GDzXOtmu2w5UFgUciUJMGwH1Uirqg6z/gS2/RhI/KJTB62etAovieQz7rDB6RuFa8lXm +n2S1kl4HgKbEAQnhy2BvdvX19O/f4U7SPxTIndvc+yDGVZY/RWQq1ZP1RZyR21En8Hi 1ztA== X-Gm-Message-State: AOAM533xJOu7YiZXP0Cqm6pImbxGi8W01kHwXiaN3SHJdzHAIOflXEaD ios4DQrRfbo5+GgsfBfenzwP/YijlD/HkNfLY90= X-Received: by 2002:a2e:8248:: with SMTP id j8mr1659040ljh.300.1625185845491; Thu, 01 Jul 2021 17:30:45 -0700 (PDT) Received: from mail-lf1-f42.google.com (mail-lf1-f42.google.com. [209.85.167.42]) by smtp.gmail.com with ESMTPSA id l20sm168997ljb.139.2021.07.01.17.30.44 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 01 Jul 2021 17:30:44 -0700 (PDT) Received: by mail-lf1-f42.google.com with SMTP id bq39so2417468lfb.12 for ; Thu, 01 Jul 2021 17:30:44 -0700 (PDT) X-Received: by 2002:ac2:4903:: with SMTP id n3mr551418lfi.487.1625185844416; Thu, 01 Jul 2021 17:30:44 -0700 (PDT) MIME-Version: 1.0 References: <20210701204246.2037142-1-agruenba@redhat.com> In-Reply-To: From: Linus Torvalds Date: Thu, 1 Jul 2021 17:30:28 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] gfs2: Fix mmap + page fault deadlocks To: Andreas Gruenbacher Cc: Alexander Viro , cluster-devel , Linux Kernel Mailing List , Jan Kara , Matthew Wilcox Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 1, 2021 at 5:20 PM Andreas Gruenbacher wrote: > > On Thu, Jul 1, 2021 at 11:41 PM Linus Torvalds > wrote: > > Also, I have to say that I think the direct-IO code is fundamentally > > mis-designed. Why it is doing the page lookup _during_ the IO is a > > complete mystery to me. Why wasn't that done ahead of time before the > > filesystem took the locks it needed? > > That would be inconvenient for reads, when the number of bytes read is > much smaller than the buffer size and we won't need to page in the > entire buffer. What? A file read will READ THE WHOLE BUFFER. We're not talking pipes or ttys here. If you ask for X bytes, you'll get X bytes. Of course, if you ask for more data than the file has, that's another thing, but who really does that with direct-IO? And if they do, why should we care about their silly behavior? Face it, right now direct-IO is *BUGGY* because of this, and you can deadlock filesystems with it. So tell me again how it's "inconvenient" to fix this bug, and fix the bad direct-IO design? Linus