Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp891893pxb; Wed, 27 Oct 2021 14:35:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxrOGaO4mZKYTpA2I2WFBOX0xL19M229Qo6N8XsGrQH4J10ZK36MwuydS1nGkYMXNL+S4Kf X-Received: by 2002:a17:90a:c85:: with SMTP id v5mr8552763pja.47.1635370504286; Wed, 27 Oct 2021 14:35:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635370504; cv=none; d=google.com; s=arc-20160816; b=JZWRjBvfZU1wSRxdE7FE8mfd8BEC81jP/dsMqAzBpuuphBrsGLxc7rMdtZ7CW0+nPe BmvKM3cf16F7ADFlCSz3yhxcdw3SE7ZjHK9lxPwjRuDFb8FX9cADZCfDfm8cDLESekMP m2vD8wRLsHgnv0JSwDJyCtXgQ/uCPnCx1Rn9OQFCzLKLXJPRSRhkFXQhI+30mxn3BDy/ fOCC5HjKyMvRWqMloc8XjaAV9E8NvJL4byd3+WybjjV53yd2FeC/YFZqL0IaDMd5TMr+ SQKuzRVG2CD1qIRxY/Bw2NX9bp7Fdlq2DkgtheSwm10LCoPQJ0Y9R4mebhA+fUKkK/0S WPJA== 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=hiXmABk2yLJcTBwV/OV64LUSAMHnd37fHZz79FC6JvU=; b=K6L/paF8yAJZLSj2t/OiGTyWB6H3MLbWAaFv/m09D8rfDpOH4DVM8LPn6HhIkaytjw mFCXB1NO0GZa0nD4E0qbJNBqoZm/KBeJM4lIe5US5uWI/I3ybC1/4oyDEMlivJZO5cbH 0KtaFLdRRu2HdXsCMWATSCyDaw2IvpYUVo2uBhPxYXV9CrhGQPXZbavvYjd7clRt+B/f R8LbnDw8xHc0vO4ildNVEw9/1o0XAvs6QAAqlLr64v1VIpBazgtSnuDvPe2q7wvN9rDf N7tq0GPmBFEfZu1AM62oQHEbBjC0tEM+Z+WJyCTmAgbnHRJevhIlsUfE0JH45t8NYE2q cSFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=ZWNMOoSk; 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 k34si1722643pgi.580.2021.10.27.14.34.52; Wed, 27 Oct 2021 14:35:04 -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=ZWNMOoSk; 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 S244211AbhJ0VRi (ORCPT + 97 others); Wed, 27 Oct 2021 17:17:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53034 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240846AbhJ0VRd (ORCPT ); Wed, 27 Oct 2021 17:17:33 -0400 Received: from mail-lj1-x232.google.com (mail-lj1-x232.google.com [IPv6:2a00:1450:4864:20::232]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E1A19C061570 for ; Wed, 27 Oct 2021 14:15:07 -0700 (PDT) Received: by mail-lj1-x232.google.com with SMTP id d23so5625179ljj.10 for ; Wed, 27 Oct 2021 14:15:07 -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=hiXmABk2yLJcTBwV/OV64LUSAMHnd37fHZz79FC6JvU=; b=ZWNMOoSkuRaQ/lv8qizXhk55H0ec5K7RYuCkQOMY0yln4tyxGOGFp3Gs+/CZY7p6bT 3CZlT/Neco4TP12/d9wLKcFuseqO24iEpPL6jwtGtY8MUiJAI9mKP12Z7SKjitGg++uj lH3CUAw1rGdqhKUixiRRtsMf0iuWhbOzVZTJw= 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=hiXmABk2yLJcTBwV/OV64LUSAMHnd37fHZz79FC6JvU=; b=eGT8kfrSp5X/fv7CAGde4Oq7i6d9f0F4B/OoiYiAaIBkh1338gitnhxy/isWF48dES iL1LbbwWn1fcif/YFUGStH+KoOa8Avyoju0AEnJl0Ktp+wfuhkZyJMgPwXah3kPsqRJQ JR+iqjiom3DrxT6CTJSPeZfCML3CpKlP1rJ2BqKkqlQuBz0dKsJRBWwdH+LgeYXEO3jh lpPbnT2z686uEcteecNiCXzfbUEn0WcuKnMB0GF6f0wz3XY4FmPKfIhrqoiQ5rWnFJ2I 9lhHXUN79q4QBvSdcNVmnHgXQHB+348MG04VrdA00ph0CnaGRwY3iVOv+HMc3ROYAunu iLtQ== X-Gm-Message-State: AOAM530j06qS6+ye5v6YopxOCnOwhe+MJUl7lAv2W7RCJEcZngfF5Ccy Lkm0EB/uHCqPFJhLgNLGNT67xJKDZHFACJh6 X-Received: by 2002:a2e:9acf:: with SMTP id p15mr279272ljj.377.1635369306002; Wed, 27 Oct 2021 14:15:06 -0700 (PDT) Received: from mail-lf1-f48.google.com (mail-lf1-f48.google.com. [209.85.167.48]) by smtp.gmail.com with ESMTPSA id i6sm103952lfr.163.2021.10.27.14.15.04 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 27 Oct 2021 14:15:05 -0700 (PDT) Received: by mail-lf1-f48.google.com with SMTP id bp15so8999672lfb.4 for ; Wed, 27 Oct 2021 14:15:04 -0700 (PDT) X-Received: by 2002:a19:f619:: with SMTP id x25mr90493lfe.141.1635369304547; Wed, 27 Oct 2021 14:15:04 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Linus Torvalds Date: Wed, 27 Oct 2021 14:14:48 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v8 00/17] gfs2: Fix mmap + page fault deadlocks To: Catalin Marinas Cc: Andreas Gruenbacher , Paul Mackerras , Alexander Viro , Christoph Hellwig , "Darrick J. Wong" , Jan Kara , Matthew Wilcox , cluster-devel , linux-fsdevel , Linux Kernel Mailing List , ocfs2-devel@oss.oracle.com, kvm-ppc@vger.kernel.org, linux-btrfs Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 27, 2021 at 12:13 PM Catalin Marinas wrote: > > As an alternative, you mentioned earlier that a per-thread fault status > was not feasible on x86 due to races. Was this only for the hw poison > case? I think the uaccess is slightly different. It's not x86-specific, it's very generic. If we set some flag in the per-thread status, we'll need to be careful about not overwriting it if we then have a subsequent NMI that _also_ takes a (completely unrelated) page fault - before we then read the per-thread flag. Think 'perf' and fetching backtraces etc. Note that the NMI page fault can easily also be a pointer coloring fault on arm64, for exactly the same reason that whatever original copy_from_user() code was. So this is not a "oh, pointer coloring faults are different". They have the same re-entrancy issue. And both the "pagefault_disable" and "fault happens in interrupt context" cases are also the exact same 'faulthandler_disabled()' thing. So even at fault time they look very similar. So we'd have to have some way to separate out only the one we care about. Linus