From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 59A39C433EF for ; Mon, 25 Oct 2021 19:01:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3ABC760230 for ; Mon, 25 Oct 2021 19:01:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233728AbhJYTDV (ORCPT ); Mon, 25 Oct 2021 15:03:21 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:43049 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232144AbhJYTDU (ORCPT ); Mon, 25 Oct 2021 15:03:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1635188457; 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=QkyoC/NexH1Nu0O2R4wJhF/62iz6WrFzKuF9woFeRsA=; b=UwnglEV32+L32U71gCflIg1S6qxdoFNON/cvvx79/vcGs+dC2ZTq2A6QuBx1fYB8mrzCX/ XveypilyjA86fAeNLqSoL04Gjmxxir39BkiJg57AwfJWWLhVCJL+TOJ7R5gN/kaOsc3/ra aSrxxHA/ztZCB1EH+gXTKjg4Vstxeas= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-265-SWxD0ydVPFeL9q8JjmdNKg-1; Mon, 25 Oct 2021 15:00:56 -0400 X-MC-Unique: SWxD0ydVPFeL9q8JjmdNKg-1 Received: by mail-wr1-f71.google.com with SMTP id x1-20020adfffc1000000b001679fc9c018so3430120wrs.18 for ; Mon, 25 Oct 2021 12:00:56 -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=QkyoC/NexH1Nu0O2R4wJhF/62iz6WrFzKuF9woFeRsA=; b=mqudI//u2/GWedbwGydWSFLCDntDICW7ET5QaM2z0ZiUV+TtNagACPz45ZEAPjDShu c+GRSO5nK0y6JOo1sdiDWIYrj0SAsizCtxYEtz1DAoWH++cmzedI69p0kE7BDEDHEpcb L8jZ4xAp5NOY2KCY9WV01szGYXeMiyiz7/tEpXT8tCiC/KpWEwbRw9QTzWeMspYHd4nC b+AiCrEj95i3ECVUkM+bqq1TsAQX2uNp34uF4uE5a0AAZaymF7UpJNuRdhgGoQiqX18e S+duzGTSkFBJ7bZerhw0xNVW8U6eKssFgBaHCe0SLGUQsfGGIBz9RGlrRcWV0ETkumgw /aMw== X-Gm-Message-State: AOAM530zBKCkq/qGfHXUs+R6BskvHwHz/WnL0QsD76h6NW+QalsGEVaa TXQw5PmsoQ767cfwUH/aSGAEYN4+w5Us8INoCaVMfBkru85fZ7ea6tS+9diiAG5EMzU3VGnD/hC poZ+PV8i5lzdvwNLoy7noVjQW/qJPEYP7mcH7zjs= X-Received: by 2002:a7b:c74f:: with SMTP id w15mr21890329wmk.186.1635188455463; Mon, 25 Oct 2021 12:00:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxzXLWqbHTas2L+Ep0jJ8Ym3FrcHaKtpcTPgh7nV35XP5aJDxyjNlJ4UaNmG9hWfJd1eun8dCJKnnE+XiZ6mmk= X-Received: by 2002:a7b:c74f:: with SMTP id w15mr21890297wmk.186.1635188455236; Mon, 25 Oct 2021 12:00:55 -0700 (PDT) MIME-Version: 1.0 References: <20211019134204.3382645-1-agruenba@redhat.com> In-Reply-To: From: Andreas Gruenbacher Date: Mon, 25 Oct 2021 21:00:43 +0200 Message-ID: Subject: Re: [PATCH v8 00/17] gfs2: Fix mmap + page fault deadlocks To: Linus Torvalds Cc: Catalin Marinas , 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-btrfs@vger.kernel.org On Fri, Oct 22, 2021 at 9:23 PM Linus Torvalds wrote: > On Fri, Oct 22, 2021 at 8:06 AM Catalin Marinas wrote: > > Probing only the first byte(s) in fault_in() would be ideal, no need to > > go through all filesystems and try to change the uaccess/probing order. > > Let's try that. Or rather: probing just the first page - since there > are users like that btrfs ioctl, and the direct-io path. For direct I/O, we actually only want to trigger page fault-in so that we can grab page references with bio_iov_iter_get_pages. Probing for sub-page error domains will only slow things down. If we hit -EFAULT during the actual copy-in or copy-out, we know that the error can't be page fault related. Similarly, in the buffered I/O case, we only really care about the next byte, so any probing beyond that is unnecessary. So maybe we should split the sub-page error domain probing off from the fault-in functions. Or at least add an argument to the fault-in functions that specifies the amount of memory to probe. Thanks, Andreas From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7A4C8C433EF for ; Mon, 25 Oct 2021 19:01:11 +0000 (UTC) Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 244046108B for ; Mon, 25 Oct 2021 19:01:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 244046108B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=oss.oracle.com Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 19PISE8T022613; Mon, 25 Oct 2021 19:01:10 GMT Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by mx0b-00069f02.pphosted.com with ESMTP id 3bx1vxr5cx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 25 Oct 2021 19:01:09 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 19PIxsOO170776; Mon, 25 Oct 2021 19:01:07 GMT Received: from oss.oracle.com (oss-old-reserved.oracle.com [137.254.22.2]) by userp3020.oracle.com with ESMTP id 3bvv5sj6k2-1 (version=TLSv1 cipher=AES256-SHA bits=256 verify=NO); Mon, 25 Oct 2021 19:01:07 +0000 Received: from localhost ([127.0.0.1] helo=lb-oss.oracle.com) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1mf5DW-00078R-Gk; Mon, 25 Oct 2021 12:01:06 -0700 Received: from aserp3020.oracle.com ([141.146.126.70]) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1mf5DT-00078B-Lk for ocfs2-devel@oss.oracle.com; Mon, 25 Oct 2021 12:01:03 -0700 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 19PItUmo154795 for ; Mon, 25 Oct 2021 19:01:03 GMT Received: from mx0a-00069f01.pphosted.com (mx0a-00069f01.pphosted.com [205.220.165.26]) by aserp3020.oracle.com with ESMTP id 3bva76xjve-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 25 Oct 2021 19:01:02 +0000 Received: from pps.filterd (m0246575.ppops.net [127.0.0.1]) by mx0b-00069f01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 19PIwkLu026735 for ; Mon, 25 Oct 2021 19:01:01 GMT Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx0b-00069f01.pphosted.com with ESMTP id 3bwytvt2da-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 25 Oct 2021 19:01:01 +0000 Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-562-iUKUSM-eMk2iOecezc1eFA-1; Mon, 25 Oct 2021 15:00:56 -0400 X-MC-Unique: iUKUSM-eMk2iOecezc1eFA-1 Received: by mail-wm1-f70.google.com with SMTP id r205-20020a1c44d6000000b0032cb058fe13so1937820wma.7 for ; Mon, 25 Oct 2021 12:00:56 -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=QkyoC/NexH1Nu0O2R4wJhF/62iz6WrFzKuF9woFeRsA=; b=MvMUBIaA552MMchqTHaoBv45nxWlxTOzYsr6YEHLmefFWqQY8t3aIzRQwj+CHvpGBZ W7nmPHiAID8zGWbwcGvWui02EWTnNlmOSwpd37IolhdI2kwMfuzkY5S+I5al4vWUChvU Q72D7jq5ye5F+TJaVAknxO6b/LNM7Z1EEbJiz1CfmboAEhE6Jbwb4KjwybextW+66lPK JKmJXb15oE5WxGO5PBD/EIKJuiItYfIzkvp7AGjNNx6v70c9ZBjff1D3JLCPR+1ZjnKf +rbYcPqUsgOxrJDNxe9dLohGPUyq3s+KBm96YpC4rZ4o/wW7B759+Y1sCminSRfuw8cn XRYg== X-Gm-Message-State: AOAM530s4Y9t6xfJ4628EuuocMPIWW21UKwf0JqkCmptDG/Wc0RWrN23 S3eoMC3etJ1V/eZGRqG9mVtANTpI0c//lqz6eTSp7Q0DYH7vXnr0kMeIUJGwKwdBJVGR818pD32 W2Omt9Du9LF5HHLbVEYi9yr/nQj9WeM7BxEzDzg== X-Received: by 2002:a7b:c74f:: with SMTP id w15mr21890328wmk.186.1635188455458; Mon, 25 Oct 2021 12:00:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxzXLWqbHTas2L+Ep0jJ8Ym3FrcHaKtpcTPgh7nV35XP5aJDxyjNlJ4UaNmG9hWfJd1eun8dCJKnnE+XiZ6mmk= X-Received: by 2002:a7b:c74f:: with SMTP id w15mr21890297wmk.186.1635188455236; Mon, 25 Oct 2021 12:00:55 -0700 (PDT) MIME-Version: 1.0 References: <20211019134204.3382645-1-agruenba@redhat.com> In-Reply-To: From: Andreas Gruenbacher Date: Mon, 25 Oct 2021 21:00:43 +0200 Message-ID: To: Linus Torvalds Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=agruenba@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Proofpoint-SPF-Result: pass X-Proofpoint-SPF-Record: v=spf1 ip4:103.23.64.2 ip4:103.23.65.2 ip4:103.23.66.26 ip4:103.23.67.26 ip4:107.21.15.141 ip4:108.177.8.0/21 ip4:128.17.0.0/20 ip4:128.17.128.0/20 ip4:128.17.192.0/20 ip4:128.17.64.0/20 ip4:128.245.0.0/20 ip4:128.245.64.0/20 ip4:13.110.208.0/21 ip4:13.110.216.0/22 ip4:13.110.224.0/20 ip4:13.111.0.0/16 ip4:136.147.128.0/20 include:spf1.redhat.com -all X-Proofpoint-SPF-VenPass: Allowed X-Source-IP: 170.10.133.124 X-ServerName: us-smtp-delivery-124.mimecast.com X-Proofpoint-SPF-Result: pass X-Proofpoint-SPF-Record: v=spf1 ip4:103.23.64.2 ip4:103.23.65.2 ip4:103.23.66.26 ip4:103.23.67.26 ip4:107.21.15.141 ip4:108.177.8.0/21 ip4:128.17.0.0/20 ip4:128.17.128.0/20 ip4:128.17.192.0/20 ip4:128.17.64.0/20 ip4:128.245.0.0/20 ip4:128.245.64.0/20 ip4:13.110.208.0/21 ip4:13.110.216.0/22 ip4:13.110.224.0/20 ip4:13.111.0.0/16 ip4:136.147.128.0/20 include:spf1.redhat.com -all X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10148 signatures=668683 X-Proofpoint-Spam-Reason: safe X-Spam: OrgSafeList X-SpamRule: orgsafelist Cc: kvm-ppc@vger.kernel.org, Christoph Hellwig , cluster-devel , Jan Kara , Catalin Marinas , Linux Kernel Mailing List , Paul Mackerras , Alexander Viro , linux-fsdevel , linux-btrfs , ocfs2-devel@oss.oracle.com Subject: Re: [Ocfs2-devel] [PATCH v8 00/17] gfs2: Fix mmap + page fault deadlocks X-BeenThere: ocfs2-devel@oss.oracle.com X-Mailman-Version: 2.1.9 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: ocfs2-devel-bounces@oss.oracle.com Errors-To: ocfs2-devel-bounces@oss.oracle.com X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10148 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 mlxscore=0 spamscore=0 phishscore=0 suspectscore=0 malwarescore=0 adultscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2109230001 definitions=main-2110250111 X-Proofpoint-ORIG-GUID: lj-DtveEIeHkic3WF6_cB_MZFkRCAS6X X-Proofpoint-GUID: lj-DtveEIeHkic3WF6_cB_MZFkRCAS6X On Fri, Oct 22, 2021 at 9:23 PM Linus Torvalds wrote: > On Fri, Oct 22, 2021 at 8:06 AM Catalin Marinas wrote: > > Probing only the first byte(s) in fault_in() would be ideal, no need to > > go through all filesystems and try to change the uaccess/probing order. > > Let's try that. Or rather: probing just the first page - since there > are users like that btrfs ioctl, and the direct-io path. For direct I/O, we actually only want to trigger page fault-in so that we can grab page references with bio_iov_iter_get_pages. Probing for sub-page error domains will only slow things down. If we hit -EFAULT during the actual copy-in or copy-out, we know that the error can't be page fault related. Similarly, in the buffered I/O case, we only really care about the next byte, so any probing beyond that is unnecessary. So maybe we should split the sub-page error domain probing off from the fault-in functions. Or at least add an argument to the fault-in functions that specifies the amount of memory to probe. Thanks, Andreas _______________________________________________ Ocfs2-devel mailing list Ocfs2-devel@oss.oracle.com https://oss.oracle.com/mailman/listinfo/ocfs2-devel From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andreas Gruenbacher Date: Mon, 25 Oct 2021 21:00:43 +0200 Subject: [Cluster-devel] [PATCH v8 00/17] gfs2: Fix mmap + page fault deadlocks In-Reply-To: References: <20211019134204.3382645-1-agruenba@redhat.com> Message-ID: List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On Fri, Oct 22, 2021 at 9:23 PM Linus Torvalds wrote: > On Fri, Oct 22, 2021 at 8:06 AM Catalin Marinas wrote: > > Probing only the first byte(s) in fault_in() would be ideal, no need to > > go through all filesystems and try to change the uaccess/probing order. > > Let's try that. Or rather: probing just the first page - since there > are users like that btrfs ioctl, and the direct-io path. For direct I/O, we actually only want to trigger page fault-in so that we can grab page references with bio_iov_iter_get_pages. Probing for sub-page error domains will only slow things down. If we hit -EFAULT during the actual copy-in or copy-out, we know that the error can't be page fault related. Similarly, in the buffered I/O case, we only really care about the next byte, so any probing beyond that is unnecessary. So maybe we should split the sub-page error domain probing off from the fault-in functions. Or at least add an argument to the fault-in functions that specifies the amount of memory to probe. Thanks, Andreas From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andreas Gruenbacher Date: Mon, 25 Oct 2021 18:59:58 +0000 Subject: Re: [PATCH v8 00/17] gfs2: Fix mmap + page fault deadlocks Message-Id: List-Id: References: <20211019134204.3382645-1-agruenba@redhat.com> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Linus Torvalds Cc: Catalin Marinas , 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 On Fri, Oct 22, 2021 at 9:23 PM Linus Torvalds wrote: > On Fri, Oct 22, 2021 at 8:06 AM Catalin Marinas wrote: > > Probing only the first byte(s) in fault_in() would be ideal, no need to > > go through all filesystems and try to change the uaccess/probing order. > > Let's try that. Or rather: probing just the first page - since there > are users like that btrfs ioctl, and the direct-io path. For direct I/O, we actually only want to trigger page fault-in so that we can grab page references with bio_iov_iter_get_pages. Probing for sub-page error domains will only slow things down. If we hit -EFAULT during the actual copy-in or copy-out, we know that the error can't be page fault related. Similarly, in the buffered I/O case, we only really care about the next byte, so any probing beyond that is unnecessary. So maybe we should split the sub-page error domain probing off from the fault-in functions. Or at least add an argument to the fault-in functions that specifies the amount of memory to probe. Thanks, Andreas