Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751852AbcCUAAH (ORCPT ); Sun, 20 Mar 2016 20:00:07 -0400 Received: from bh-25.webhostbox.net ([208.91.199.152]:52176 "EHLO bh-25.webhostbox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751232AbcCUAAA (ORCPT ); Sun, 20 Mar 2016 20:00:00 -0400 Date: Sun, 20 Mar 2016 16:59:58 -0700 From: Guenter Roeck To: "Kirill A. Shutemov" Cc: Andrew Morton , Alexander Viro , Linus Torvalds , Christoph Lameter , Matthew Wilcox , linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH 70/71] mm: get rid of PAGE_CACHE_* and page_cache_{get,release} macros Message-ID: <20160320235958.GA20915@roeck-us.net> References: <1458499278-1516-1-git-send-email-kirill.shutemov@linux.intel.com> <1458499278-1516-71-git-send-email-kirill.shutemov@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1458499278-1516-71-git-send-email-kirill.shutemov@linux.intel.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-Authenticated_sender: guenter@roeck-us.net X-OutGoing-Spam-Status: No, score=-1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bh-25.webhostbox.net X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - roeck-us.net X-Get-Message-Sender-Via: bh-25.webhostbox.net: authenticated_id: guenter@roeck-us.net X-Authenticated-Sender: bh-25.webhostbox.net: guenter@roeck-us.net X-Source: X-Source-Args: X-Source-Dir: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1534 Lines: 42 On Sun, Mar 20, 2016 at 09:41:17PM +0300, Kirill A. Shutemov wrote: > PAGE_CACHE_{SIZE,SHIFT,MASK,ALIGN} macros were introduced *long* time ago > with promise that one day it will be possible to implement page cache with > bigger chunks than PAGE_SIZE. > > This promise never materialized. And unlikely will. > > We have many places where PAGE_CACHE_SIZE assumed to be equal to > PAGE_SIZE. And it's constant source of confusion on whether PAGE_CACHE_* > or PAGE_* constant should be used in a particular case, especially on the > border between fs and mm. > > Global switching to PAGE_CACHE_SIZE != PAGE_SIZE would cause to much > breakage to be doable. > > Let's stop pretending that pages in page cache are special. They are not. > > The changes are pretty straight-forward: > > - << (PAGE_CACHE_SHIFT - PAGE_SHIFT) -> ; > > - PAGE_CACHE_{SIZE,SHIFT,MASK,ALIGN} -> PAGE_{SIZE,SHIFT,MASK,ALIGN}; > > - page_cache_get() -> get_page(); > > - page_cache_release() -> put_page(); > > Signed-off-by: Kirill A. Shutemov > --- ... > extern pgoff_t linear_hugepage_index(struct vm_area_struct *vma, > @@ -425,7 +425,7 @@ static inline pgoff_t linear_page_index(struct vm_area_struct *vma, > return linear_hugepage_index(vma, address); > pgoff = (address - vma->vm_start) >> PAGE_SHIFT; > pgoff += vma->vm_pgoff; > - return pgoff >> (PAGE_CACHE_SHIFT - PAGE_SHIFT); > + return pgoff >> (PAGE_SHIFT - PAGE_SHIFT); ^^^^^^^^^^^^^^^^^^^^^^^^^ Guenter