From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Kirill A. Shutemov" Subject: PAGE_CACHE_SIZE vs. PAGE_SIZE Date: Fri, 18 Jan 2013 17:57:25 +0200 Message-ID: <20130118155724.GA8507@otc-wbsnb-06> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="LZvS9be/3tNcYl/X" Cc: linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Wu Fengguang , Jan Kara , Nick Piggin , Andrea Arcangeli , Andi Kleen , "Kirill A. Shutemov" To: Andrew Morton , Linus Torvalds , Al Viro Return-path: Content-Disposition: inline Sender: owner-linux-mm@kvack.org List-Id: linux-fsdevel.vger.kernel.org --LZvS9be/3tNcYl/X Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, PAGE_CACHE_* macros were introduced long time ago in hope to implement page cache with larger chunks than one page in future. In fact it was never done. Some code paths assume PAGE_CACHE_SIZE <=3D PAGE_SIZE. E.g. we use zero_user_segments() to clear stale parts of page on cache filling, but the function is implemented only for individual small page. It's unlikely that global switch to PAGE_CACHE_SIZE > PAGE_SIZE will never happen since it will affect to much code at once. I think support of larger chunks in page cache can be in implemented in some form of THP with per-fs enabling. Is it time to get rid of PAGE_CACHE_* macros? I can prepare patchset if it's okay. --=20 Kirill A. Shutemov --LZvS9be/3tNcYl/X Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iQIcBAEBAgAGBQJQ+XDkAAoJEAd+omnVudOMzKgP/2i22lky6JJInM7MxXkJFZ1l /pksssQ6hdHdb+B0QCBjoUDw/ZAUessm0/aDrBwjTmfAGoUbnIWQZf90Hf/ybNV8 e5gh8n73XXVr7irhUJB/7jJPOfMMdU2yw0g3cfr6MC9bzvzt9V8dWmyGnIvUPthG ZKtwH/Aj2VqkVg7My+Kucy+bM/VT3XwPtVG7CMbk1wpW9TkRWxVBbfQZdxuGHAzC 5dyagwKYltpc9N6zb0WUwmE3HFT1LEKDGdzA3Re20rZSgTcWY2hrrHQQARDVLfyc SWPaqhXDuKPh9iWn75yJPwvPXv+x/ME6wnh43k8wzX5dSXorohDARO1+Csc+3IJb tk/sDJK85198Hnpkg0IZE+rfSc+Y18Yy+cYch4nuTYn1BwLWNE6B/2ZaVc/vSbU/ lGD6HLCOtH9sOx/nQ+oopj0swcPXKsGxTV/lfqazPEeASmdVTA2XS99ArFl/Mp71 qTvYgxlp4Nn8+3CgvMwHZQUbW02Xo5RFd9SdaPyhF0kXmbWhnpxFk5N9Hsy70xG4 o7/f6psrC4XkSN8DlHw/2hT32OSrgmnFmttg8L6mcYN6E6cQY8/pJI2WDIGcq8uN vf8/PzVT/A/NySXrQQkCZNtYmhEW1f/k+NtBJHHuY1nr7qky+uKUM0GJmppW310k VvAC0r7ef7e8jEFAq43y =YqYo -----END PGP SIGNATURE----- --LZvS9be/3tNcYl/X-- -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Morton Subject: Re: PAGE_CACHE_SIZE vs. PAGE_SIZE Date: Thu, 31 Jan 2013 14:40:26 -0800 Message-ID: <20130131144026.bd735c07.akpm@linux-foundation.org> References: <20130118155724.GA8507@otc-wbsnb-06> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Linus Torvalds , Al Viro , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Wu Fengguang , Jan Kara , Nick Piggin , Andrea Arcangeli , Andi Kleen , "Kirill A. Shutemov" To: "Kirill A. Shutemov" Return-path: In-Reply-To: <20130118155724.GA8507@otc-wbsnb-06> Sender: owner-linux-mm@kvack.org List-Id: linux-fsdevel.vger.kernel.org On Fri, 18 Jan 2013 17:57:25 +0200 "Kirill A. Shutemov" wrote: > Hi, > > PAGE_CACHE_* macros were introduced long time ago in hope to implement > page cache with larger chunks than one page in future. > > In fact it was never done. > > Some code paths assume PAGE_CACHE_SIZE <= PAGE_SIZE. E.g. we use > zero_user_segments() to clear stale parts of page on cache filling, but > the function is implemented only for individual small page. > > It's unlikely that global switch to PAGE_CACHE_SIZE > PAGE_SIZE will never > happen since it will affect to much code at once. > > I think support of larger chunks in page cache can be in implemented in > some form of THP with per-fs enabling. > > Is it time to get rid of PAGE_CACHE_* macros? > I can prepare patchset if it's okay. The distinct PAGE_CACHE_SIZE has never been used for anything, but I do kinda like it for documentary reasons: PAGE_SIZE is a raw, low-level thing and PAGE_CACHE_SIZE is the specialized we're-doing-pagecache-stuff thing. But I'm sure I could get used to not having it ;) -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 From: Simon Jeons Subject: Re: PAGE_CACHE_SIZE vs. PAGE_SIZE Date: Tue, 19 Feb 2013 18:32:36 +0800 Message-ID: <512354C4.2040705@gmail.com> References: <20130118155724.GA8507@otc-wbsnb-06> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Andrew Morton , Linus Torvalds , Al Viro , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Wu Fengguang , Jan Kara , Nick Piggin , Andrea Arcangeli , Andi Kleen , "Kirill A. Shutemov" To: "Kirill A. Shutemov" Return-path: In-Reply-To: <20130118155724.GA8507@otc-wbsnb-06> Sender: owner-linux-mm@kvack.org List-Id: linux-fsdevel.vger.kernel.org On 01/18/2013 11:57 PM, Kirill A. Shutemov wrote: > Hi, > > PAGE_CACHE_* macros were introduced long time ago in hope to implement > page cache with larger chunks than one page in future. > > In fact it was never done. > > Some code paths assume PAGE_CACHE_SIZE <= PAGE_SIZE. E.g. we use > zero_user_segments() to clear stale parts of page on cache filling, but > the function is implemented only for individual small page. > > It's unlikely that global switch to PAGE_CACHE_SIZE > PAGE_SIZE will never > happen since it will affect to much code at once. > > I think support of larger chunks in page cache can be in implemented in > some form of THP with per-fs enabling. IIRC, you try to implement THP support page cache, then PAGE_CACHE_SIZE maybe don't need any more. > > Is it time to get rid of PAGE_CACHE_* macros? > I can prepare patchset if it's okay. > -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michel Lespinasse Subject: Re: PAGE_CACHE_SIZE vs. PAGE_SIZE Date: Wed, 20 Feb 2013 00:12:11 +0800 Message-ID: References: <20130118155724.GA8507@otc-wbsnb-06> <20130131144026.bd735c07.akpm@linux-foundation.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Cc: "Kirill A. Shutemov" , Linus Torvalds , Al Viro , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Wu Fengguang , Jan Kara , Nick Piggin , Andrea Arcangeli , Andi Kleen , "Kirill A. Shutemov" To: Andrew Morton Return-path: In-Reply-To: <20130131144026.bd735c07.akpm@linux-foundation.org> Sender: owner-linux-mm@kvack.org List-Id: linux-fsdevel.vger.kernel.org On Fri, Feb 1, 2013 at 6:40 AM, Andrew Morton wrote: > On Fri, 18 Jan 2013 17:57:25 +0200 > "Kirill A. Shutemov" wrote: > >> Hi, >> >> PAGE_CACHE_* macros were introduced long time ago in hope to implement >> page cache with larger chunks than one page in future. >> >> In fact it was never done. >> >> Some code paths assume PAGE_CACHE_SIZE <= PAGE_SIZE. E.g. we use >> zero_user_segments() to clear stale parts of page on cache filling, but >> the function is implemented only for individual small page. >> >> It's unlikely that global switch to PAGE_CACHE_SIZE > PAGE_SIZE will never >> happen since it will affect to much code at once. >> >> I think support of larger chunks in page cache can be in implemented in >> some form of THP with per-fs enabling. >> >> Is it time to get rid of PAGE_CACHE_* macros? >> I can prepare patchset if it's okay. > > The distinct PAGE_CACHE_SIZE has never been used for anything, but I do > kinda like it for documentary reasons: PAGE_SIZE is a raw, low-level > thing and PAGE_CACHE_SIZE is the specialized > we're-doing-pagecache-stuff thing. > > But I'm sure I could get used to not having it ;) Personally I always find such distinctions without a difference - like page_cache_release vs put_page - rather confusing, especially when working near the fs/mm boundary (for example in and under handle_pte_fault()) -- Michel "Walken" Lespinasse A program is never fully debugged until the last user dies. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757112Ab3AaWka (ORCPT ); Thu, 31 Jan 2013 17:40:30 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:41870 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755607Ab3AaWk1 (ORCPT ); Thu, 31 Jan 2013 17:40:27 -0500 Date: Thu, 31 Jan 2013 14:40:26 -0800 From: Andrew Morton To: "Kirill A. Shutemov" Cc: Linus Torvalds , Al Viro , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Wu Fengguang , Jan Kara , Nick Piggin , Andrea Arcangeli , Andi Kleen , "Kirill A. Shutemov" Subject: Re: PAGE_CACHE_SIZE vs. PAGE_SIZE Message-Id: <20130131144026.bd735c07.akpm@linux-foundation.org> In-Reply-To: <20130118155724.GA8507@otc-wbsnb-06> References: <20130118155724.GA8507@otc-wbsnb-06> X-Mailer: Sylpheed 3.0.2 (GTK+ 2.20.1; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 18 Jan 2013 17:57:25 +0200 "Kirill A. Shutemov" wrote: > Hi, > > PAGE_CACHE_* macros were introduced long time ago in hope to implement > page cache with larger chunks than one page in future. > > In fact it was never done. > > Some code paths assume PAGE_CACHE_SIZE <= PAGE_SIZE. E.g. we use > zero_user_segments() to clear stale parts of page on cache filling, but > the function is implemented only for individual small page. > > It's unlikely that global switch to PAGE_CACHE_SIZE > PAGE_SIZE will never > happen since it will affect to much code at once. > > I think support of larger chunks in page cache can be in implemented in > some form of THP with per-fs enabling. > > Is it time to get rid of PAGE_CACHE_* macros? > I can prepare patchset if it's okay. The distinct PAGE_CACHE_SIZE has never been used for anything, but I do kinda like it for documentary reasons: PAGE_SIZE is a raw, low-level thing and PAGE_CACHE_SIZE is the specialized we're-doing-pagecache-stuff thing. But I'm sure I could get used to not having it ;) From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758609Ab3BSKzQ (ORCPT ); Tue, 19 Feb 2013 05:55:16 -0500 Received: from mail-gh0-f173.google.com ([209.85.160.173]:65113 "EHLO mail-gh0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750791Ab3BSKzM (ORCPT ); Tue, 19 Feb 2013 05:55:12 -0500 Message-ID: <512354C4.2040705@gmail.com> Date: Tue, 19 Feb 2013 18:32:36 +0800 From: Simon Jeons User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130106 Thunderbird/17.0.2 MIME-Version: 1.0 To: "Kirill A. Shutemov" CC: Andrew Morton , Linus Torvalds , Al Viro , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Wu Fengguang , Jan Kara , Nick Piggin , Andrea Arcangeli , Andi Kleen , "Kirill A. Shutemov" Subject: Re: PAGE_CACHE_SIZE vs. PAGE_SIZE References: <20130118155724.GA8507@otc-wbsnb-06> In-Reply-To: <20130118155724.GA8507@otc-wbsnb-06> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/18/2013 11:57 PM, Kirill A. Shutemov wrote: > Hi, > > PAGE_CACHE_* macros were introduced long time ago in hope to implement > page cache with larger chunks than one page in future. > > In fact it was never done. > > Some code paths assume PAGE_CACHE_SIZE <= PAGE_SIZE. E.g. we use > zero_user_segments() to clear stale parts of page on cache filling, but > the function is implemented only for individual small page. > > It's unlikely that global switch to PAGE_CACHE_SIZE > PAGE_SIZE will never > happen since it will affect to much code at once. > > I think support of larger chunks in page cache can be in implemented in > some form of THP with per-fs enabling. IIRC, you try to implement THP support page cache, then PAGE_CACHE_SIZE maybe don't need any more. > > Is it time to get rid of PAGE_CACHE_* macros? > I can prepare patchset if it's okay. > From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932819Ab3BSQMP (ORCPT ); Tue, 19 Feb 2013 11:12:15 -0500 Received: from mail-ia0-f175.google.com ([209.85.210.175]:39650 "EHLO mail-ia0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758562Ab3BSQMM (ORCPT ); Tue, 19 Feb 2013 11:12:12 -0500 MIME-Version: 1.0 In-Reply-To: <20130131144026.bd735c07.akpm@linux-foundation.org> References: <20130118155724.GA8507@otc-wbsnb-06> <20130131144026.bd735c07.akpm@linux-foundation.org> Date: Wed, 20 Feb 2013 00:12:11 +0800 Message-ID: Subject: Re: PAGE_CACHE_SIZE vs. PAGE_SIZE From: Michel Lespinasse To: Andrew Morton Cc: "Kirill A. Shutemov" , Linus Torvalds , Al Viro , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Wu Fengguang , Jan Kara , Nick Piggin , Andrea Arcangeli , Andi Kleen , "Kirill A. Shutemov" Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 1, 2013 at 6:40 AM, Andrew Morton wrote: > On Fri, 18 Jan 2013 17:57:25 +0200 > "Kirill A. Shutemov" wrote: > >> Hi, >> >> PAGE_CACHE_* macros were introduced long time ago in hope to implement >> page cache with larger chunks than one page in future. >> >> In fact it was never done. >> >> Some code paths assume PAGE_CACHE_SIZE <= PAGE_SIZE. E.g. we use >> zero_user_segments() to clear stale parts of page on cache filling, but >> the function is implemented only for individual small page. >> >> It's unlikely that global switch to PAGE_CACHE_SIZE > PAGE_SIZE will never >> happen since it will affect to much code at once. >> >> I think support of larger chunks in page cache can be in implemented in >> some form of THP with per-fs enabling. >> >> Is it time to get rid of PAGE_CACHE_* macros? >> I can prepare patchset if it's okay. > > The distinct PAGE_CACHE_SIZE has never been used for anything, but I do > kinda like it for documentary reasons: PAGE_SIZE is a raw, low-level > thing and PAGE_CACHE_SIZE is the specialized > we're-doing-pagecache-stuff thing. > > But I'm sure I could get used to not having it ;) Personally I always find such distinctions without a difference - like page_cache_release vs put_page - rather confusing, especially when working near the fs/mm boundary (for example in and under handle_pte_fault()) -- Michel "Walken" Lespinasse A program is never fully debugged until the last user dies.