Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1309374ybv; Thu, 13 Feb 2020 20:33:53 -0800 (PST) X-Google-Smtp-Source: APXvYqx7+QrUn3grfP6UiA/j+eXqGLH/gWIMi6kuaMeJHFQ9g11ID0PlmAkhR9K6S2alj1cRchsC X-Received: by 2002:aca:b808:: with SMTP id i8mr647230oif.66.1581654833021; Thu, 13 Feb 2020 20:33:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581654833; cv=none; d=google.com; s=arc-20160816; b=ZJPT5qXSz+lMjBBwFmCsj4Q2zPxfdkCrXaN9k606j6r2nxlExASRwqI8VxmtpfUjgb AYpNz1SJ9MC+AN7k2Uf+GVS/zPgGM921k54hYyyJfHW8CeWDbeQE4HhwfPen4cLKSB2w 4KMM0ii0zYye2Ohjckf8+9Ia2lliXskNaDgE0zwdlbmD2amCqHcblEIuAoymZIZm6Zs0 i344ZFos4+47fO6wsfrxXVt1dZw5dGN5jUNSCvDYGWaN5lkfXmmlAWte7HCODoWYPZ64 OjcYOdP7hy5goOhpmDqW6FxvVK4Xlj99FGNSvR6H+vlM568ewbtLHiiS3vtzUlpOsLPD 59hw== 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=5Ey5GwVWyIBJt/+/393UO7Nx1GdweRJOgsCbjE7KjIY=; b=WL6QccJqK62+QA1cjiG1BtzYxTrZkKtrbzFyxNlDibAaG0guvss9Lu3lbyYj4kcu6z iGBmGtIp9F7wa2yspTobQNbSGVYfY4c+07PlCkJ8cYZSVAJKEBJgJHZhz171u0THo2Ng m13FcFlVuX8ae7BONK77uT6uoFTVNxu0ULdd/0L9H8tx8F3QUgQc8rDGJoOXi0FGfiYN xQbdgsPh2NKXDhoCVmCjV3C+AvaG8CqxiQkj5++mu3OSATuXKAPIgav4ztqURJcBh6Ki wSH7ZOC/5S06F8/LHn8yCpysrZaBVZJoVtPs6cVBbEvdvTUGdxyndGJ2gV/UqIjur9at twDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=NkFTEsbm; 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 w17si2028472oiw.127.2020.02.13.20.33.39; Thu, 13 Feb 2020 20:33:52 -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=NkFTEsbm; 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 S1728650AbgBNEdZ (ORCPT + 99 others); Thu, 13 Feb 2020 23:33:25 -0500 Received: from hqnvemgate25.nvidia.com ([216.228.121.64]:4698 "EHLO hqnvemgate25.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728239AbgBNEdZ (ORCPT ); Thu, 13 Feb 2020 23:33:25 -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, 13 Feb 2020 20:32:55 -0800 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate102.nvidia.com (PGP Universal service); Thu, 13 Feb 2020 20:33:24 -0800 X-PGP-Universal: processed; by hqpgpgate102.nvidia.com on Thu, 13 Feb 2020 20:33:24 -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 04:33:23 +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> <20200214042137.GX7778@bombadil.infradead.org> From: John Hubbard X-Nvconfidentiality: public Message-ID: Date: Thu, 13 Feb 2020 20:33:23 -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: <20200214042137.GX7778@bombadil.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=1581654775; bh=5Ey5GwVWyIBJt/+/393UO7Nx1GdweRJOgsCbjE7KjIY=; 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=NkFTEsbm+clHOSZCX0RL5RspOQeT9W3sLbBgRbLhccmBpDH8wbMqpmqavt71lE50T W0r4zoHadn/onXtCLtu33Jw1Lnyb1YLti6uKH/Lqwf3oKwHkMffvnhuXXDp4172iVb 4JyT1BsemqkZI0x+rarEzerLgE4K30Jj4Akyi8ysj6gTn3vHY411VUJmo07oEAtkVb F3culDDOf6MNtFaLukiw3rjiqUenq4Bmkyg4nv/QsS2hRa5xNWUMGZeZaUGVNkKf9z beXaG1Dega77Ip/IbGAbpMTTVOuKI2MlLNC56slZlFuJWg4VS8NUVScDIxpxkukqfs g+TKG5YT2eP6A== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/13/20 8:21 PM, Matthew Wilcox wrote: > On Thu, Feb 13, 2020 at 07:19:53PM -0800, John Hubbard wrote: >> On 2/10/20 5:03 PM, Matthew Wilcox wrote: >>> @@ -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... :) > > Nah, this is just a type used internally to the function. Getting the > API right for the callers is the important part. > Agreed that the real point of this is to match up the API, but why not finish the job by going all the way through? It's certainly not something we need to lose sleep over, but it does seem like you don't want to have code like this: for (page_idx = 0; page_idx < nr_to_read; page_idx++) { ...with the ability, technically, to overflow page_idx due to it being an int, while nr_to_read is an unsigned long. (And the new sanitizers and checkers are apt to complain about it, btw.) (Apologies if there is some kernel coding idiom that I still haven't learned, about this sort of thing.) thanks, -- John Hubbard NVIDIA