Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1257681ybv; Thu, 13 Feb 2020 19:20:24 -0800 (PST) X-Google-Smtp-Source: APXvYqw7BJKzdqxFi5IMcH5jUjpE3B5t1VY5+5/97P/ycOPROZJErVI3o2vzZd40+5WKtxp/xW/c X-Received: by 2002:a9d:21c5:: with SMTP id s63mr590304otb.142.1581650424190; Thu, 13 Feb 2020 19:20:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581650424; cv=none; d=google.com; s=arc-20160816; b=IrgIBhzENE8KahrXkEkk8V2rT6bVPf/Xxo1LiVMuoeFpsBrDxv/dfShtUIpVzF36lB LWNpXLU8gAoI61Zm8cuMQq5crHM1pJH0m1LDK4uO25QKLDMpJUPP9kzdRWcrczvTnzZP btsr+H3tN1ZKxSif56o5kyiwCYKCjoJG8zV/D6NgkLb0Df5OnZdAiK7Z+5qSOl6yZxz6 3OHvYv1pGEOOo/WRLopgJafUJJM5z4F4rF6slHtiOQjexPOcO+woGjexO5t5FQUboFvF V7+3kNssD9Nuxez/+uGF7Prhyog+3wRQY/VKSdSgXfmw3UxSPmbqKtZl/+VY44bqNgXt YCLQ== 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=RNaZ4JfNFDU0NcYE8lJdvYhazrtkoisD3k8b6KMLtdc=; b=QUJL4AK9mRSlRdE0ZZ2J0+LXAiE4PI381WWUZvkOgily9nBP4RkFkdls7T4CH5J5Ko mjc2t+YDNoqCM+UzNp/RDnu0Wk+Mm4nvwZsI4+wP4V9C8KYyM0yG+gOd+l+h8Sj7LWtm Bze5cm+5CLxz4INdEUPegPrwCadR12W3m2IF5rWp7H9C5VZb4Fq16L+Mkx3oRoONDtUl PdXkPduDXLqu9tHk0Xw1xfCsD0wDesshAIlMIfv0kKzcczpZ4VWVogKqTwqfHFDJKgvz L5PihgBUxGyxhnXrQAiYXFhpIhuMvu+4UYD1hTC+O8itlEFsqIfDPBocCv9STQSIHqeW gVCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=sOVfkNWL; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-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 t9si2063331otp.57.2020.02.13.19.19.58; Thu, 13 Feb 2020 19:20:24 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-ext4-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=sOVfkNWL; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-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 S1728052AbgBNDTz (ORCPT + 99 others); Thu, 13 Feb 2020 22:19:55 -0500 Received: from hqnvemgate24.nvidia.com ([216.228.121.143]:15730 "EHLO hqnvemgate24.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728004AbgBNDTz (ORCPT ); Thu, 13 Feb 2020 22:19:55 -0500 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate24.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Thu, 13 Feb 2020 19:18:48 -0800 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Thu, 13 Feb 2020 19:19:54 -0800 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Thu, 13 Feb 2020 19:19:54 -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, 14 Feb 2020 03:19:53 +0000 Subject: Re: [PATCH v5 01/13] mm: Fix the return type of __do_page_cache_readahead To: Matthew Wilcox , CC: , , , , , , , , References: <20200211010348.6872-1-willy@infradead.org> <20200211010348.6872-2-willy@infradead.org> From: John Hubbard X-Nvconfidentiality: public Message-ID: Date: Thu, 13 Feb 2020 19:19:53 -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: <20200211010348.6872-2-willy@infradead.org> X-Originating-IP: [10.124.1.5] X-ClientProxiedBy: HQMAIL105.nvidia.com (172.20.187.12) 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=1581650328; bh=RNaZ4JfNFDU0NcYE8lJdvYhazrtkoisD3k8b6KMLtdc=; h=X-PGP-Universal:Subject:To:CC:References:From:X-Nvconfidentiality: Message-ID:Date:User-Agent:MIME-Version:In-Reply-To: X-Originating-IP:X-ClientProxiedBy:Content-Type:Content-Language: Content-Transfer-Encoding; b=sOVfkNWLLDt+JEZLsJm7PWpwNhbfMy7Zr3aDG23myvOrIan5N9yqRMjDlz3lXkn18 DOkKMeiS/Gc4FUCYcIhmYx6Gd7Wh3GI9SHQJ9/gKNMFblTwGjqwXR5Q5D4ZJTz5GCZ Xeql/aFHQc1P1nooQI57fQbl4K4t7T8vB35SNzfiqeD93s0O06ZnBUEgtoW1hZorwx QM5A4B35PxahBIULwNXu6XXsvZ+FCzpvOZA92INsgfO8+7HlzE56nLNgNW3zAzwSYq nJ58IKrrUjUsb0ZBJ3d45ZXUZUk1+JGN1AjIVhnbFLrQYKBelF3S+H6U7y1Rblwba5 U6Kkbjsxumihg== Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On 2/10/20 5:03 PM, Matthew Wilcox wrote: > From: "Matthew Wilcox (Oracle)" > > ra_submit() which is a wrapper around __do_page_cache_readahead() already > returns an unsigned long, and the 'nr_to_read' parameter is an unsigned > long, so fix __do_page_cache_readahead() to return an unsigned long, > even though I'm pretty sure we're not going to readahead more than 2^32 > pages ever. > > Signed-off-by: Matthew Wilcox (Oracle) > --- > mm/internal.h | 2 +- > mm/readahead.c | 4 ++-- > 2 files changed, 3 insertions(+), 3 deletions(-) > > diff --git a/mm/internal.h b/mm/internal.h > index 3cf20ab3ca01..41b93c4b3ab7 100644 > --- a/mm/internal.h > +++ b/mm/internal.h > @@ -49,7 +49,7 @@ void unmap_page_range(struct mmu_gather *tlb, > unsigned long addr, unsigned long end, > struct zap_details *details); > > -extern unsigned int __do_page_cache_readahead(struct address_space *mapping, > +extern unsigned long __do_page_cache_readahead(struct address_space *mapping, > struct file *filp, pgoff_t offset, unsigned long nr_to_read, > unsigned long lookahead_size); > > diff --git a/mm/readahead.c b/mm/readahead.c > index 2fe72cd29b47..6bf73ef33b7e 100644 > --- a/mm/readahead.c > +++ b/mm/readahead.c > @@ -152,7 +152,7 @@ static int read_pages(struct address_space *mapping, struct file *filp, > * > * Returns the number of pages requested, or the maximum amount of I/O allowed. > */ > -unsigned int __do_page_cache_readahead(struct address_space *mapping, > +unsigned long __do_page_cache_readahead(struct address_space *mapping, > struct file *filp, pgoff_t offset, unsigned long nr_to_read, > unsigned long lookahead_size) > { > @@ -161,7 +161,7 @@ unsigned int __do_page_cache_readahead(struct address_space *mapping, > unsigned long end_index; /* The last page we want to read */ > LIST_HEAD(page_pool); > int page_idx; What about page_idx, too? It should also have the same data type as nr_pages, as long as we're trying to be consistent on this point. Just want to ensure we're ready to handle those 2^33+ page readaheads... :) thanks, -- John Hubbard NVIDIA > - unsigned int nr_pages = 0; > + unsigned long nr_pages = 0; > loff_t isize = i_size_read(inode); > gfp_t gfp_mask = readahead_gfp_mask(mapping); > >