Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1075614pxu; Thu, 17 Dec 2020 01:18:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJzQebWfv10fODWLlHIOMqk9fWnQTxhoyRqnbrbwin4DPlQs+QvTHhGq22hZ8z1+LcTseVg5 X-Received: by 2002:a17:906:8152:: with SMTP id z18mr35264913ejw.317.1608196690271; Thu, 17 Dec 2020 01:18:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608196690; cv=none; d=google.com; s=arc-20160816; b=NYutM/HSbWQFlVXkmD9y+sxVBOusNPwCR1KBUHDJvv8335jpCPAFML7Iw2c5bxcMGu i4aobqtxvKniJ/libIbZFAY5HUcUSyZ2RtdwC+nDj5aJhxQG+scEHGIJc+zwzbPh9+Da /Q0hy9CJyJ52PaJ2HjP1Sy72rr7b4ZvNsmDYyqLjBT9DmECzZQfpjVILysRDKuYqBlRN 51gKXvKXCmlIILXlkID0VcAE5WQnECc011rT/cyG9EuuoNl4ghzNI6H2OhDNUNmo+N4s eKmEvhQ5q+VZUwPf1b/cIo0DBcPPt+jekwJhKL6OO7sbXONLDej7tOOqm92cHQPTCPIg uJPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:dkim-signature:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=R8d+cbbN++Nu/JZ/Spif9ERgIOOHw66AVM7XM2f2jHA=; b=idsYh+pMse7p1D/oCcbNo6HbRY8zVSPPG5wVSnoAXXChAEIGsPKYNoT0OFq4Hua9w1 xs1sg7AFp9K7XsYaCYOMqx7c/1AbSB6WJYOXM97rdc+bnAYlzNaR7GiJbIOabGwZog2f fa8IFy1X0SwQcpdCWrQUwVOTmqbx7YBS0FDvTKyDC07Av1en+csrU62G0ko7m/oljy6Q eQOqGqfAB4mUkJjrCwj503IZH5uVfZmCw6/rnyett12chzytyCv+7E3h56250OsIo+3a Ywv5n/pGexA9pOKlXefACBcQi8mr3nH3X9g2LqPRbyvVOkh5XfFkeSsh3ZlaJeW4xY1k KCkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=J69MPPJW; 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=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cq5si3931103edb.200.2020.12.17.01.17.47; Thu, 17 Dec 2020 01:18:10 -0800 (PST) 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=@nvidia.com header.s=n1 header.b=J69MPPJW; 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=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726773AbgLQJPw (ORCPT + 99 others); Thu, 17 Dec 2020 04:15:52 -0500 Received: from hqnvemgate24.nvidia.com ([216.228.121.143]:17656 "EHLO hqnvemgate24.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725871AbgLQJPv (ORCPT ); Thu, 17 Dec 2020 04:15:51 -0500 Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate24.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Thu, 17 Dec 2020 01:15:11 -0800 Received: from [10.2.61.104] (172.20.145.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Thu, 17 Dec 2020 09:15:11 +0000 Subject: Re: [PATCH 18/25] btrfs: Use readahead_batch_length To: "Matthew Wilcox (Oracle)" , , CC: References: <20201216182335.27227-1-willy@infradead.org> <20201216182335.27227-19-willy@infradead.org> From: John Hubbard Message-ID: Date: Thu, 17 Dec 2020 01:15:10 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:84.0) Gecko/20100101 Thunderbird/84.0 MIME-Version: 1.0 In-Reply-To: <20201216182335.27227-19-willy@infradead.org> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [172.20.145.6] X-ClientProxiedBy: HQMAIL111.nvidia.com (172.20.187.18) To HQMAIL107.nvidia.com (172.20.187.13) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1608196511; bh=R8d+cbbN++Nu/JZ/Spif9ERgIOOHw66AVM7XM2f2jHA=; h=Subject:To:CC:References:From:Message-ID:Date:User-Agent: MIME-Version:In-Reply-To:Content-Type:Content-Language: Content-Transfer-Encoding:X-Originating-IP:X-ClientProxiedBy; b=J69MPPJWk8j7pB65gpW8AA5TpJ/a788fkD4dUvEE72a6NPnSq4BlCvo70SCDdPXBl FEuy3YBxdv7OBPHkVdMjiWVHRCsuY8svj9NIs+/u6A+0IwyR2omdysyQ1/yWoDjLM5 cSQtmxfpLEDYN/AKdaYy1KqUuGriJhXmJqiFdoU2Rd7vHVgJBduKeyRClj/8zOIGBe 8y9PcBdazubCwir8jCdmxFYhflsG6IgwkvQYr23J/xB/T0tGWlpFcitEneNqCoOXK/ 2Cw2majMmD6ZT/ahUy9+7mn4hhqb74gg8w8JBLllaA7jDyHZOtZyGdbxNsZHFtJN3z +ThHTRn5nXDRA== Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/16/20 10:23 AM, Matthew Wilcox (Oracle) wrote: > Implement readahead_batch_length() to determine the number of bytes in > the current batch of readahead pages and use it in btrfs. > > Signed-off-by: Matthew Wilcox (Oracle) > --- > fs/btrfs/extent_io.c | 6 ++---- > include/linux/pagemap.h | 9 +++++++++ > 2 files changed, 11 insertions(+), 4 deletions(-) > > diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c > index 6e3b72e63e42..42936a83a91b 100644 > --- a/fs/btrfs/extent_io.c > +++ b/fs/btrfs/extent_io.c > @@ -4436,10 +4436,8 @@ void extent_readahead(struct readahead_control *rac) > int nr; > > while ((nr = readahead_page_batch(rac, pagepool))) { > - u64 contig_start = page_offset(pagepool[0]); > - u64 contig_end = page_offset(pagepool[nr - 1]) + PAGE_SIZE - 1; > - > - ASSERT(contig_start + nr * PAGE_SIZE - 1 == contig_end); > + u64 contig_start = readahead_pos(rac); > + u64 contig_end = contig_start + readahead_batch_length(rac); Something in this tiny change is breaking btrfs: it hangs my Fedora 33 test system (which changed over to btrfs) on boot. I haven't quite figured out what's really wrong, but git bisect lands here, *and* turning the whole extent_readahead() function into a no-op (on top of the whole series) allows everything to work once again. Sorry for not actually solving the root cause, but I figured you'd be able to jump straight to the answer, with the above information, so I'm sending it out early. thanks, -- John Hubbard NVIDIA