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=-17.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham 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 06966C4361B for ; Thu, 17 Dec 2020 09:15:16 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 559A12389E for ; Thu, 17 Dec 2020 09:15:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 559A12389E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nvidia.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 7788C6B0036; Thu, 17 Dec 2020 04:15:14 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7275C6B005D; Thu, 17 Dec 2020 04:15:14 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 63D5A6B0068; Thu, 17 Dec 2020 04:15:14 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0210.hostedemail.com [216.40.44.210]) by kanga.kvack.org (Postfix) with ESMTP id 4CA296B0036 for ; Thu, 17 Dec 2020 04:15:14 -0500 (EST) Received: from smtpin04.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 0AC90181AEF15 for ; Thu, 17 Dec 2020 09:15:14 +0000 (UTC) X-FDA: 77602215348.04.smile26_2d136bd27433 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin04.hostedemail.com (Postfix) with ESMTP id D362D80137EB for ; Thu, 17 Dec 2020 09:15:13 +0000 (UTC) X-HE-Tag: smile26_2d136bd27433 X-Filterd-Recvd-Size: 3726 Received: from hqnvemgate24.nvidia.com (hqnvemgate24.nvidia.com [216.228.121.143]) by imf37.hostedemail.com (Postfix) with ESMTP for ; Thu, 17 Dec 2020 09:15:13 +0000 (UTC) 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== 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: 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