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=-0.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no 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 5BE0FC2BB86 for ; Sat, 11 Apr 2020 21:48:22 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E795520CC7 for ; Sat, 11 Apr 2020 21:48:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="SINfAoTU" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E795520CC7 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 3E8688E00B1; Sat, 11 Apr 2020 17:48:21 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 399FB8E0007; Sat, 11 Apr 2020 17:48:21 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2AECA8E00B1; Sat, 11 Apr 2020 17:48:21 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0068.hostedemail.com [216.40.44.68]) by kanga.kvack.org (Postfix) with ESMTP id 114F38E0007 for ; Sat, 11 Apr 2020 17:48:21 -0400 (EDT) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id C9D1BA8EA for ; Sat, 11 Apr 2020 21:48:20 +0000 (UTC) X-FDA: 76696913160.18.month09_65f2b238fb613 X-HE-Tag: month09_65f2b238fb613 X-Filterd-Recvd-Size: 3617 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf46.hostedemail.com (Postfix) with ESMTP for ; Sat, 11 Apr 2020 21:48:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=6ZNCz+B4KIIk9p9ZumerQ70SmmhJHlat7P94bUwDWh8=; b=SINfAoTU4O24ytUDtYf1j82q+Z A1I3Ar8BrxWzvcxSg5gnFiUsb9qYKWvPSQR8YklWS0mUivQrwrgYFVzZeMfJAro6cscJhv312rb9q rebxadfwUUQudNav98lFPeHlzsOLnHymVfcahAaAz291r6PvfK80krtUtUGyKQ5L3FyxZE2Hy3bOE vAA99nQjABglrww54wXf5XYkdqPHUIg99xvICtZES0NxrPFdDTP1DRQZb5R4xmsVOcJOKuBzpsHZJ FkxE8iXkaeNsgLXTmMiAhN6ZXjxCYTlCJKAZnCIHDeofv+vO31n6+y+e3jVtQyQOR+siiz8hHwyJ1 r5YgqHmQ==; Received: from willy by bombadil.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jNNz8-0004lD-Ct; Sat, 11 Apr 2020 21:48:18 +0000 Date: Sat, 11 Apr 2020 14:48:18 -0700 From: Matthew Wilcox To: Linus Torvalds Cc: linux-fsdevel , Linux-MM , Linux Kernel Mailing List Subject: Re: [GIT PULL] Rename page_offset() to page_pos() Message-ID: <20200411214818.GH21484@bombadil.infradead.org> References: <20200411203220.GG21484@bombadil.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Sat, Apr 11, 2020 at 01:57:56PM -0700, Linus Torvalds wrote: > So honestly, i the confusion is that we have "pgoff_t", which is the > offset of the page counted in _pages_, then my reaction is that > > (a) I think the truly confusing name is "pgoff_t" (and any > "page_offset" variable of that type). Calling that "pgindex_t" and > "page_index" would be a real clarification. I think you're right. I have a patch series queued for 5.8 which renames a lot of 'pgoff_t offset' to 'pgoff_t index'. I wouldn't mind at all renaming pgoff_t to pgindex_t. If you're amenable, pgidx_t would be shorter. > (b) if we really do want to rename page_offset() because of confusion > with the page index "offset", then the logical thing would be to > clarify that it's a byte offset, not the page index. I wasn't entirely forthcoming ... I actually want to introduce a new #define page_offset(page, x) ((unsigned long)(x) & (page_size(page) - 1)) to simplify handling huge pages. So I always want to see offset be a byte count. offset_in_page() is already taken, and I have no idea what else to call the function to get the offset of this address within a particular page. > If we'd want a _descriptive_ name, then "byte_offset_of_page()" would > probably be that. That's hard to mis-understand. > > Yes that's also more of a mouthful, and it still has the "two > different names for the same thing" issue wrt > stable/old/rebased/whatever patches. That was one of the options we discussed, along with file_offset_of_page(). > Which is why I'd much rather change "pgoff_t" to "pgindex_t" and > related "page_offset" variables to "page_index" variables. There's only about 20 of those out of the 938 pgoff_t users. But there's over a hundred called 'pgoff'. I need to get smarter about using Coccinelle; I'm sure it can do this.