Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1127819pxv; Thu, 1 Jul 2021 18:15:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwddjmYeb2GpATDBIMUdvVVnOfYRKxUWEaxb1oTBC99HE/s/OySK3PTlOifcOQsmgNmltBs X-Received: by 2002:a92:de10:: with SMTP id x16mr1516695ilm.235.1625188530122; Thu, 01 Jul 2021 18:15:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625188530; cv=none; d=google.com; s=arc-20160816; b=vntx12am0EA3uOpQHTFFzVkS46YGNQepGt1VhEmscpK843ojioao09Mpa+t5pUtDsy +jh/1nI7AVucOhVDJb6jpeMrolQOQI8QkQbruUR0OGt9A1y8hzpm/cnfnHBakOFLXer6 e6yZMZPpG1tCd9j9mJ1wLVJRiKoZXcT2ozJk97gbg5fV+eXNASW86yPRJONpPDLCHqF3 ZbkCh3Kx9XoV9mQLF3nTcUIl5GUkP0uryTEYAZBC0jLA6bsBUGRSHMygWGCBQIgYYKdJ 90DKcANrRRAFnCE9kbu4yKN2KvhSPJwEfSZLG6xyq81azUWNIV8P9ox91j1VOOdOXxFx Pj/w== 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=F6q+d+OSdqVyGZpPkY0K+9RZhaSmWq15QL3d6lDBiig=; b=DB9Mp38TnAccw8gWjd4GM/uxAneUQ4Ye+/BdKmWjcbpg+A+YhTgABvzNYR9c4BDRaa 7VcFcvLeLY3c5ymcdDh7CuaSToPd+VaSl//sB5YhXjKqg3SyO2/IlabFMwkEBwkiMOp9 Ko1a7F32IaA/el+Xl4dOszov2p0N9h1Jf7CVcp9uy2xG4RKUfGnXtvLGp/ZCnQxV+CpT hafy6EfZn4MShCtfWnxWrvQvuhiSWCIwZXQFgswcMCMeQeis3xG+7resUt1czHVj1L0Q gAxfMNXjMbtb3y0ROKsqinaOU+VA5HHJSMwBlxi6DXkIpQw/kuxHK04J42yJo45hvn5O Hizw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=b4KSksce; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n1si1456664ilm.39.2021.07.01.18.15.17; Thu, 01 Jul 2021 18:15:30 -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=@gmail.com header.s=20161025 header.b=b4KSksce; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234485AbhGBBRP (ORCPT + 99 others); Thu, 1 Jul 2021 21:17:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230404AbhGBBRO (ORCPT ); Thu, 1 Jul 2021 21:17:14 -0400 Received: from mail-il1-x131.google.com (mail-il1-x131.google.com [IPv6:2607:f8b0:4864:20::131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B6B5C061762 for ; Thu, 1 Jul 2021 18:14:43 -0700 (PDT) Received: by mail-il1-x131.google.com with SMTP id g3so8286175ilj.7 for ; Thu, 01 Jul 2021 18:14:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=F6q+d+OSdqVyGZpPkY0K+9RZhaSmWq15QL3d6lDBiig=; b=b4KSksceqlL1Ymhgf0eJbzBnqOuotNfgFAu60oXn/fwfIxcnppIFg8t3yrMUtgEqFh OMfan0zuHGaK9PJ1iXGxdrD3nLRQMnUe2eX4l+KIMUzoZvvfHq7rSr61P0lEHo9cQl3f EvvU8LsGd17/dhrDgNFu+3fLVyZw6DYKYSLtT1tqh2w1M520AHNAvRTVxwjkdsaOoYha E8LAD31fv4mi+6696D5JpuiDUU3uQe7XNutds3Z6jzbS0ovXSVTEl2qW4U/mCnS+/gJF BDCeTucAoD57zGJkiLMXX3W+IpDE++EqD96ZdVst/RTCkFZnQ38bSBioNE+iS2pURPl9 Pf1Q== 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=F6q+d+OSdqVyGZpPkY0K+9RZhaSmWq15QL3d6lDBiig=; b=LGwuQ998vZA2yYt8uFipCpHAiznlzAPHraPG6mGOUukKY1d6wvGyrTkM+xX2JbPD5q ya3D4WutKyB52UlNoe44Cap5mpNcezu2qmm9ssSADSgnlmqpOjFXwVyMVJTTHOb3RIJx /RE9zba9e7aRHWPVk5My7sloO6m3YXCqMiyd15IJQ06CSwwLI0uvwjNG6bWQsbc9CTzv dy/mJvPk5UofOkSfIAI1d/g+RvZwJkATjcQYTzDMeAZg0QiWUnza2I8la1HvrpMXrRcc 4Ol1IVNX1kmYK+fe/5tZO3Dut0J4VSJhstrx9wZ44vIrbW93YrOF3HtBy8TSyEIJoTbq xQkA== X-Gm-Message-State: AOAM531azUPSReuy6FZTxkS1pUM15yAvEYTPPt4qkK6m003LtkATo6kK 9Yl2AM/aXHDfBM2RL8Vs/GqqZOwGWXczGgwIeww= X-Received: by 2002:a05:6e02:114e:: with SMTP id o14mr1543607ill.201.1625188481988; Thu, 01 Jul 2021 18:14:41 -0700 (PDT) MIME-Version: 1.0 References: <20210701204246.2037142-1-agruenba@redhat.com> In-Reply-To: From: =?UTF-8?Q?Andreas_Gr=C3=BCnbacher?= Date: Fri, 2 Jul 2021 03:14:30 +0200 Message-ID: Subject: Re: [PATCH] gfs2: Fix mmap + page fault deadlocks To: Linus Torvalds Cc: Andreas Gruenbacher , 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 Am Fr., 2. Juli 2021 um 02:48 Uhr schrieb Linus Torvalds : > On Thu, Jul 1, 2021 at 5:30 PM Linus Torvalds wrote: > > 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? > > Now, if the issue is that people do IO for bigger areas than you have > memory for, then I think that's a chunking issue. I don't think the > ITER_IOVEC necessarily needs to be converted to an ITER_BVEC in one > single go. That would indeed be painful if somebody tries to do some > huge direct-IO when they just don't have the memory for it. > > But the fact is, direct-IO has been an incredible pain-point for > decades, because it's (a) unusual, (b) buggy and (c) has very little > overall design and common code. > > The three issues are likely intimately tied together. > > The iomap code at least has tried to make for much more common code, > but I really think some direct-IO people should seriously reconsider > how they are doing things when there are fundamental deadlocks in the > design. > > And I do think that a ITER_IOVEC -> ITER_BVEC conversion function > might be a really really good idea to solve this problem. I've tried to explain above how keeping the user-space pages referenced will just lead to different kinds of deadlocks. That is the problem with this approach. > There's even > a very natural chunking algorithm: try to do as much as possible with > get_user_pages_fast() - so that if you already *have* the memory, you > can do the full IO (or at least a big part of it). > > And if get_user_pages_fast() only gives you a small area - or nothing > at all - you chunk it down aggressively, and realize that "oh, doing > direct-IO when user space is paged out might not be the most optimal > case". > > Linus Thanks, Andreas