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 X-Spam-Level: X-Spam-Status: No, score=-0.5 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3C904C433E0 for ; Tue, 16 Jun 2020 22:36:55 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (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 DA37D2085B for ; Tue, 16 Jun 2020 22:36:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="cGmxIWLF"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="cGmxIWLF" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DA37D2085B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linux-erofs-bounces+linux-erofs=archiver.kernel.org@lists.ozlabs.org Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 49mjjw5ZljzDqxs for ; Wed, 17 Jun 2020 08:36:52 +1000 (AEST) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=redhat.com (client-ip=205.139.110.61; helo=us-smtp-delivery-1.mimecast.com; envelope-from=agruenba@redhat.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=cGmxIWLF; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=cGmxIWLF; dkim-atps=neutral Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 49mjjb46SQzDqvh for ; Wed, 17 Jun 2020 08:36:31 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592346987; 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=pjA7zgwqv80y4xmAR3IWOMUOAyE53XKax4l1DtqqEck=; b=cGmxIWLFerDvmbXx9wGIMeV5qMwmY3+Vdf3tc8EjWZawWwMkXzWRwUX2wIM+hUs+ubjH9r JbpnGLG9iGe8fL6LRrD9HPxPCIXKXVSMkNvTKSv3KYw+hKuxH565kv4Omy8lEWJn7ZZHyl Rk2uAlwgeRwCQ2AYEdLUaShoAbHpLig= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592346987; 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=pjA7zgwqv80y4xmAR3IWOMUOAyE53XKax4l1DtqqEck=; b=cGmxIWLFerDvmbXx9wGIMeV5qMwmY3+Vdf3tc8EjWZawWwMkXzWRwUX2wIM+hUs+ubjH9r JbpnGLG9iGe8fL6LRrD9HPxPCIXKXVSMkNvTKSv3KYw+hKuxH565kv4Omy8lEWJn7ZZHyl Rk2uAlwgeRwCQ2AYEdLUaShoAbHpLig= Received: from mail-oo1-f72.google.com (mail-oo1-f72.google.com [209.85.161.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-262-XKuEGf01PEaByeLBR_zrIQ-1; Tue, 16 Jun 2020 18:36:25 -0400 X-MC-Unique: XKuEGf01PEaByeLBR_zrIQ-1 Received: by mail-oo1-f72.google.com with SMTP id g13so23634oou.11 for ; Tue, 16 Jun 2020 15:36:25 -0700 (PDT) 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=pjA7zgwqv80y4xmAR3IWOMUOAyE53XKax4l1DtqqEck=; b=SMN17zWNWMtGv8MU/ERkKEoo7z5fcFUs+5FkUkB6sn+FtViZLBssDWlo6mrS8ucHhs nd+pdDRuu4pLLZd6ieA0Mn8ZsJ1ZrU0DoKvlns09JItQuLzsSSG44kqy6JA535q09ZTw gHeTBs9n0u5JRwqBbIfC2USzUoWLNk/3eDTh3WtWRNVwC+jP4bBMmQ5fX46Lvsg8vDpC 6mqrxuHMVw1BCM7mq1+6s5d+1CB0jXS32yRsfHNpbDF4lb91QshzLiIyMvSltisyBdQD vGRKlpv5yXcG8R/4QcuFn5WUidXukKNOOSckUKBEA/1Y+ycWTC2oYXDDSWM0OvrfbMsN ekng== X-Gm-Message-State: AOAM533rGNyIYTuexSOa5ugvfT+jQscozXVv0zM8Hxwxh5to4QJieQv5 uJsbLOXCODH3ts0kkTMGQQzYlRf5Jk0FGBICjNn0xwYsl7F9xcvBRKypUtxIqQaBvpzVAQy/2zN xUaIbn7drvY+ZgCfM9Q6mAplErldLTQKzJgKkRQYx X-Received: by 2002:a9d:6e96:: with SMTP id a22mr4427249otr.58.1592346984856; Tue, 16 Jun 2020 15:36:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyoYNEk859HKJnIJ4XSJZ0fYGYB8IyuHx9XmftKrB9TO1HP0sg3cpUFv1zd47ilgV+zJ3II6JUZaM7vtE9AC3A= X-Received: by 2002:a9d:6e96:: with SMTP id a22mr4427227otr.58.1592346984642; Tue, 16 Jun 2020 15:36:24 -0700 (PDT) MIME-Version: 1.0 References: <20200414150233.24495-1-willy@infradead.org> <20200414150233.24495-17-willy@infradead.org> In-Reply-To: <20200414150233.24495-17-willy@infradead.org> From: Andreas Gruenbacher Date: Wed, 17 Jun 2020 00:36:13 +0200 Message-ID: Subject: Re: [Cluster-devel] [PATCH v11 16/25] fs: Convert mpage_readpages to mpage_readahead To: Matthew Wilcox X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" X-BeenThere: linux-erofs@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development of Linux EROFS file system List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: cluster-devel , linux-ext4 , Joseph Qi , John Hubbard , Steven Whitehouse , LKML , Junxiao Bi , linux-xfs@vger.kernel.org, William Kucharski , Christoph Hellwig , linux-btrfs@vger.kernel.org, linux-fsdevel , Andrew Morton , linux-f2fs-devel@lists.sourceforge.net, linux-erofs@lists.ozlabs.org, Linux-MM , ocfs2-devel@oss.oracle.com, Bob Peterson Errors-To: linux-erofs-bounces+linux-erofs=archiver.kernel.org@lists.ozlabs.org Sender: "Linux-erofs" Am Mi., 15. Apr. 2020 um 23:39 Uhr schrieb Matthew Wilcox : > From: "Matthew Wilcox (Oracle)" > > Implement the new readahead aop and convert all callers (block_dev, > exfat, ext2, fat, gfs2, hpfs, isofs, jfs, nilfs2, ocfs2, omfs, qnx6, > reiserfs & udf). The callers are all trivial except for GFS2 & OCFS2. This patch leads to an ABBA deadlock in xfstest generic/095 on gfs2. Our lock hierarchy is such that the inode cluster lock ("inode glock") for an inode needs to be taken before any page locks in that inode's address space. However, the readahead address space operation is called with the pages already locked. When we try to grab the inode glock inside gfs2_readahead, we'll deadlock with processes that are holding that inode glock and trying to lock one of those same pages. One possible solution is to use a trylock on the glock in gfs2_readahead, and to give up the readahead in case of a locking conflict. I have no idea how this is going to affect performance. Any other ideas? Thanks, Andreas