Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1363682ybv; Thu, 20 Feb 2020 18:49:06 -0800 (PST) X-Google-Smtp-Source: APXvYqzIDIuGQTz8r/MMgmmyJN7meblmd7YJ9cQ7yrrqHNTvEJoqjwWqlmoxqiKdift99yvypKkm X-Received: by 2002:aca:cf12:: with SMTP id f18mr200878oig.81.1582253346105; Thu, 20 Feb 2020 18:49:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582253346; cv=none; d=google.com; s=arc-20160816; b=GtvkSyRtwn/g4CwouvDYPBYy9mCQMQhgTGDOLnNkRdeTd8apJdGcqJa0FSYxNxDyJa szp9yhQV3AhST+zzOHtP3G/Ndrk4fe8K1gP44eFPVI74DMx3m81ZHPBS90WUmdRs8opE XlNeNyZzUstmr9yDIo4Prkt9U1DJBxD0CBsdSVeEaiBO3HJpkZ1cWccHPQ/foKZ14krN kseOS6TdW+zYlbXp0sGOe3qkHk9voEen3Xb888dLPk20PowOvv3kI7zsgEZEb4Z5s2WL C78INE5jPCUMfB7aO2rKu4gAlLRXLoNMn6x+V27xHZoxufA/6By6HBEn6twgf6/cFXpH OrJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=gmfdyhcpJt+pBNU3bTcP5EePBtsYdA7QQljwhD15aZ8=; b=ucfQRovAEIVpbP82S5zvz+xY6u9rlcOEBaFsq79pveXMHHAtI+7xNodxX68wuJNuk5 r1NjHnL/T1hQ6i94HbeY/FIQQlvGLUegLVdnEJCbIgBQ+cPvvsJeSSPn0Vfhuj8bhDpO WYhIULV0PInXET4nN469k6/4Ljlb90o2Mm3yilrPwrt7y+wD8A5MKvc6gw0+J2R0yAgZ 16fNtjiA7PVSO+HcbVhO5+wbERH4dEmHVNiyPZzzk5GF7o6rFMUntU93RDiQnDCYe9WU YMtbqdhcn47HvfJk6mMLNK/O3rtVFZZ7iZLqNh4azP2PKzSPOahHjukAmmbK4jRNTAR6 AYBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=lGad9Ixy; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id w135si126035oiw.44.2020.02.20.18.48.53; Thu, 20 Feb 2020 18:49:06 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=lGad9Ixy; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1729602AbgBUCsr (ORCPT + 99 others); Thu, 20 Feb 2020 21:48:47 -0500 Received: from hqnvemgate25.nvidia.com ([216.228.121.64]:9369 "EHLO hqnvemgate25.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729259AbgBUCsr (ORCPT ); Thu, 20 Feb 2020 21:48:47 -0500 Received: from hqpgpgate102.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate25.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Thu, 20 Feb 2020 18:48:13 -0800 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate102.nvidia.com (PGP Universal service); Thu, 20 Feb 2020 18:48:46 -0800 X-PGP-Universal: processed; by hqpgpgate102.nvidia.com on Thu, 20 Feb 2020 18:48:46 -0800 Received: from [10.110.48.28] (10.124.1.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Fri, 21 Feb 2020 02:48:46 +0000 Subject: Re: [PATCH v7 08/24] mm: Remove 'page_offset' from readahead loop To: Matthew Wilcox , CC: , , , , , , , , References: <20200219210103.32400-1-willy@infradead.org> <20200219210103.32400-9-willy@infradead.org> X-Nvconfidentiality: public From: John Hubbard Message-ID: Date: Thu, 20 Feb 2020 18:48:45 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: <20200219210103.32400-9-willy@infradead.org> X-Originating-IP: [10.124.1.5] X-ClientProxiedBy: HQMAIL111.nvidia.com (172.20.187.18) To HQMAIL107.nvidia.com (172.20.187.13) Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1582253293; bh=gmfdyhcpJt+pBNU3bTcP5EePBtsYdA7QQljwhD15aZ8=; h=X-PGP-Universal:Subject:To:CC:References:X-Nvconfidentiality:From: Message-ID:Date:User-Agent:MIME-Version:In-Reply-To: X-Originating-IP:X-ClientProxiedBy:Content-Type:Content-Language: Content-Transfer-Encoding; b=lGad9Ixy041U0MYecQt0DfT6SncKVN2EOLZ29mYRvVDtt2aq6TqrxPJR8TMuJSaad Sf0lEeaQzvox+v3yW0OUuzvdFwxSDyG9lbjTxWRUsSvRhWgXl4PGmx8w1zH0v3/Anz 7OGjxiCcNgwAqYNikq07yTd+FWj7rotnm2RxO6BeKmwoAyu72NsTjt/Aws/jl1+VDb gidPLdBL3rFobDzVrAM0BRsGLnZvwIVNpIFkbSxWq3GXQUnGvaG5/Oa4b3gvDJqRV4 dhZygTiRiM9cZ/T8pikRs94s6xAWpKSZwdHCDaH9VF4Fk4VBE06sR4tyTxoAMcKxEH 57AfR8UVRKKKA== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/19/20 1:00 PM, Matthew Wilcox wrote: > From: "Matthew Wilcox (Oracle)" > > Replace the page_offset variable with 'index + i'. > > Signed-off-by: Matthew Wilcox (Oracle) > --- > mm/readahead.c | 8 +++----- > 1 file changed, 3 insertions(+), 5 deletions(-) > > diff --git a/mm/readahead.c b/mm/readahead.c > index 8a25fc7e2bf2..83df5c061d33 100644 > --- a/mm/readahead.c > +++ b/mm/readahead.c > @@ -181,12 +181,10 @@ void __do_page_cache_readahead(struct address_space *mapping, > * Preallocate as many pages as we will need. > */ > for (i = 0; i < nr_to_read; i++) { > - pgoff_t page_offset = index + i; ha, the naming mismatch I complained about in an earlier patch gets deleted here, so we're good after all. :) Looks good, Reviewed-by: John Hubbard thanks, -- John Hubbard NVIDIA > - > - if (page_offset > end_index) > + if (index + i > end_index) > break; > > - page = xa_load(&mapping->i_pages, page_offset); > + page = xa_load(&mapping->i_pages, index + i); > if (page && !xa_is_value(page)) { > /* > * Page already present? Kick off the current batch of > @@ -200,7 +198,7 @@ void __do_page_cache_readahead(struct address_space *mapping, > page = __page_cache_alloc(gfp_mask); > if (!page) > break; > - page->index = page_offset; > + page->index = index + i; > list_add(&page->lru, &page_pool); > if (i == nr_to_read - lookahead_size) > SetPageReadahead(page); >