From patchwork Tue Jun 19 17:16:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 10475137 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 73BC260383 for ; Tue, 19 Jun 2018 17:16:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 57D3328AA0 for ; Tue, 19 Jun 2018 17:16:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 49F9228D9B; Tue, 19 Jun 2018 17:16:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9E7CC28AA0 for ; Tue, 19 Jun 2018 17:16:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9C1076B0005; Tue, 19 Jun 2018 13:16:43 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 949636B0006; Tue, 19 Jun 2018 13:16:43 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7EB596B0007; Tue, 19 Jun 2018 13:16:43 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pf0-f199.google.com (mail-pf0-f199.google.com [209.85.192.199]) by kanga.kvack.org (Postfix) with ESMTP id 3972C6B0005 for ; Tue, 19 Jun 2018 13:16:43 -0400 (EDT) Received: by mail-pf0-f199.google.com with SMTP id p16-v6so161717pfn.7 for ; Tue, 19 Jun 2018 10:16:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:date:from:to:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=6emQNh++UzDOqYRQb8xqC6h5z80Dp8EyRhTHtuzZYpw=; b=Gi9nxckqeNpnsYWUC0mRPaypCYktVTlMQ292jdWzUx/fhzyI989454lufL5aAng7fq B1gAdVu32Xbl1D8+yp4fr5euOeDRfCZ4IjPxmMM/9qzeJiX6qC+6NSMRRL5rbIec9TeZ OXJDF+UifgFJ/s5rIF7v0Y0DYfElnkg7F7bHD3peuUvAjpF+hRr53b6d2pfJRgUDA8PP V2G3b3qQ8G+2TRb79QUQ5dQm/nZCEk/BYRUKWkDANNjruGJhOn0OTs0NIM9MHo60YTXP FCyjsZrDZXAPaRUzKtPQrt4i2qxf95VTV7EVuXpPxJCd11WYPRRYxGmThfYMm14bzTew 4mmg== X-Gm-Message-State: APt69E0Wy6wDsOcqwpuNZMfXiZasuM0PrDJwhp5YsZSFM80mcI2l7ZoH 9UslQyEFNycBznedDgnuPPwyO+ZJ67d4TafvrdPN8njSVwWJvcahtRWxZMRQGOps64igP8c8J3A 1xT3OaP1k5C1UGrPTH36O9qK09fUewXqK78jUkQvOq2NisP7A9a94k2v4GUXcR1cygw== X-Received: by 2002:a62:c296:: with SMTP id w22-v6mr18985191pfk.92.1529428602857; Tue, 19 Jun 2018 10:16:42 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLDuz8vfFxZCqOFesdcUB/QwLLHuBGTm6MCvVLqThvArSFcAq6bTCMbxhS7pnRn+29ecB+n X-Received: by 2002:a62:c296:: with SMTP id w22-v6mr18985098pfk.92.1529428601523; Tue, 19 Jun 2018 10:16:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529428601; cv=none; d=google.com; s=arc-20160816; b=nu2lHwwqTqBiLELIWA4K1P7jq8nmQ9w937QXsnTrj7DxSYrhljoWQCzMtEzPDBXdnF U51D3OJRV8YrhTvPs9SJn3Rc1ag/Ja15l6xmPOHfDxq3/mDIKMaIKsxIekNZIxuR/pkH p4/4mIz4SvhaMqpDPUHqf8+TLLPTY3Lisp+h3ew1hxhwbyVPJ89w8mX+dTiTwORXmNaS XZ+Of1imexKdaVUXx7LhayjLqtS2sNvjIG2EDxEg+/upIFfJ/P+IT875x8yVanMQ8qNy 3HA2LmVFgUsxkGnTzhRpx+eZ9oD+94ZhT6/POQFJ7QfQYJbLpk4TOWeroUywoG3Hanh8 C8gw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:to:from:date:dkim-signature :arc-authentication-results; bh=6emQNh++UzDOqYRQb8xqC6h5z80Dp8EyRhTHtuzZYpw=; b=GQUGpB1+JCPMhrX+xx7WngK4UQmtf5oS/ugsb3rGbFZjeepbGBqbiFhNOqt5BNmKYt CxAjNhcqwyDQrKMonkvgV3R8Mr1c+8VqnmjHKee8ZXnLnBwJ2G0Qe9aWa0KWhKyO5LsA U5L+PpFjOEGE1XG0JxOGUW4S/+GMwksLUgC/5aGEriIXpxixvX47qUCTQ2+giwIXDK1F mmx+1wLM0jFGe3lsy/Im+D1LPuSh3/icxh2AwUS5o0TSiDpkl6iXjhHXKaDrtISyzNNM EMcaqUwzJEn+j2k00v8nDsqLJFSq69PMXd1HyZYZmcxcsy9j57dmgvWtcpCwtT3aojiO BvAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20170209 header.b=JafN8s6S; spf=pass (google.com: best guess record for domain of willy@infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom=willy@infradead.org Received: from bombadil.infradead.org (bombadil.infradead.org. [2607:7c80:54:e::133]) by mx.google.com with ESMTPS id f4-v6si156254pgs.244.2018.06.19.10.16.41 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Jun 2018 10:16:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of willy@infradead.org designates 2607:7c80:54:e::133 as permitted sender) client-ip=2607:7c80:54:e::133; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20170209 header.b=JafN8s6S; spf=pass (google.com: best guess record for domain of willy@infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom=willy@infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:To:From:Date:Sender:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=6emQNh++UzDOqYRQb8xqC6h5z80Dp8EyRhTHtuzZYpw=; b=JafN8s6SgFSstt9kytRzxdumd KEXQHlRl26LRIqQHMyW8rjAaIn9xm5b3IfHq//YvR99NTZwvhnTw0zScmKr9zf0RMbZpyjzpW4yuf QYsyWKML/wnxoh6PJjP602C8r7aHW6sGVLC2+fMuNCpENsEAxqPyKvCUIxDlNg3H/DTcFyG1g74ZS g6t4HQm0mYWuhdnr3Y0e0vpecM9+KYlsrdLAtwSrJYntnP+4kT9v2zu6/PoFhfmWKFRbmuMmdYfvL 2jFN1zNoFXZWy50mffZVKJqz2dtPC099EdbGIUJ5hwNHmVcnwzIHBhtvEwTqxHnK0l72Drj0LXFCu egOmQQ94g==; Received: from willy by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1fVKFC-0004fS-Mp; Tue, 19 Jun 2018 17:16:38 +0000 Date: Tue, 19 Jun 2018 10:16:38 -0700 From: Matthew Wilcox To: Ross Zwisler , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Jan Kara , Jeff Layton , Lukas Czerner , Christoph Hellwig , Goldwyn Rodrigues , Nicholas Piggin , Ryusuke Konishi , linux-nilfs@vger.kernel.org, Jaegeuk Kim , Chao Yu , linux-f2fs-devel@lists.sourceforge.net Subject: Re: [PATCH v14 00/74] Convert page cache to XArray Message-ID: <20180619171638.GE1438@bombadil.infradead.org> References: <20180617020052.4759-1-willy@infradead.org> <20180619031257.GA12527@linux.intel.com> <20180619092230.GA1438@bombadil.infradead.org> <20180619164037.GA6679@linux.intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20180619164037.GA6679@linux.intel.com> User-Agent: Mutt/1.9.2 (2017-12-15) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP On Tue, Jun 19, 2018 at 10:40:37AM -0600, Ross Zwisler wrote: > On Tue, Jun 19, 2018 at 02:22:30AM -0700, Matthew Wilcox wrote: > > On Mon, Jun 18, 2018 at 09:12:57PM -0600, Ross Zwisler wrote: > > > Hit another deadlock. This one reproduces 100% of the time in my setup with > > > XFS + DAX + generic/340. It doesn't reproduce for me at all with > > > next-20180615. Here's the output from "echo w > /proc/sysrq-trigger": > > > > *sigh*. I wonder what the differences are between our setups ... > > > > > [ 92.849119] sysrq: SysRq : Show Blocked State > > > [ 92.850506] task PC stack pid father > > > [ 92.852299] holetest D 0 1651 1466 0x00000000 > > > [ 92.853912] Call Trace: > > > [ 92.854610] __schedule+0x2c5/0xad0 > > > [ 92.855612] schedule+0x36/0x90 > > > [ 92.856602] get_unlocked_entry+0xce/0x120 > > > [ 92.857756] ? dax_insert_entry+0x2b0/0x2b0 > > > [ 92.858931] grab_mapping_entry+0x19e/0x250 > > > [ 92.860119] dax_iomap_pte_fault+0x115/0x1140 > > > [ 92.860836] dax_iomap_fault+0x37/0x40 > > ... > > > This looks very similar to the one I reported last week with generic/269. > > > > Yeah, another missing wakeup, no doubt. Can you bisect this? That was > > how I found the last one; bisected it to a single patch and stared very > > hard at the patch until I saw it. I'm not going to be in a position to > > tinker with my DAX setup until the first week of July. > > It bisected to this commit: > > b4b4daa7e8fb0ad0fee35d3e28d00e97c849a6cb is the first bad commit > commit b4b4daa7e8fb0ad0fee35d3e28d00e97c849a6cb > Author: Matthew Wilcox > Date: Thu Mar 29 22:58:27 2018 -0400 > > dax: Convert page fault handlers to XArray > > This is the last part of DAX to be converted to the XArray so > remove all the old helper functions. > > Signed-off-by: Matthew Wilcox I think I see a bug. No idea if it's the one you're hitting ;-) I had been intending to not use the 'entry' to decide whether we were waiting on a 2MB or 4kB page, but rather the xas. I shelved that idea, but not before dropping the DAX_PMD flag being passed from the PMD pagefault caller. So if I put that back ... diff --git a/fs/dax.c b/fs/dax.c index 9919b6b545fb..75cc160d2f0b 100644 --- a/fs/dax.c +++ b/fs/dax.c @@ -367,13 +367,13 @@ static struct page *dax_busy_page(void *entry) * a VM_FAULT code, encoded as an xarray internal entry. The ERR_PTR values * overlap with xarray value entries. */ -static -void *grab_mapping_entry(struct xa_state *xas, struct address_space *mapping) +static void *grab_mapping_entry(struct xa_state *xas, + struct address_space *mapping, unsigned long size) { bool pmd_downgrade = false; /* splitting 2MiB entry into 4k entries? */ void *locked = dax_make_entry(pfn_to_pfn_t(0), - DAX_EMPTY | DAX_LOCKED); - void *unlocked = dax_make_entry(pfn_to_pfn_t(0), DAX_EMPTY); + size | DAX_EMPTY | DAX_LOCKED); + void *unlocked = dax_make_entry(pfn_to_pfn_t(0), size | DAX_EMPTY); void *entry; retry: @@ -1163,7 +1163,7 @@ static vm_fault_t dax_iomap_pte_fault(struct vm_fault *vmf, pfn_t *pfnp, if (write && !vmf->cow_page) flags |= IOMAP_WRITE; - entry = grab_mapping_entry(&xas, mapping); + entry = grab_mapping_entry(&xas, mapping, 0); if (xa_is_internal(entry)) { ret = xa_to_internal(entry); goto out; @@ -1396,7 +1396,7 @@ static vm_fault_t dax_iomap_pmd_fault(struct vm_fault *vmf, pfn_t *pfnp, * page is already in the tree, for instance), it will return * VM_FAULT_FALLBACK. */ - entry = grab_mapping_entry(&xas, mapping); + entry = grab_mapping_entry(&xas, mapping, DAX_PMD); if (xa_is_internal(entry)) { result = xa_to_internal(entry); goto fallback;