linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* PAGE_CACHE_SIZE vs. PAGE_SIZE
@ 2013-01-18 15:57 Kirill A. Shutemov
  2013-01-31 22:40 ` Andrew Morton
  2013-02-19 10:32 ` Simon Jeons
  0 siblings, 2 replies; 4+ messages in thread
From: Kirill A. Shutemov @ 2013-01-18 15:57 UTC (permalink / raw)
  To: Andrew Morton, Linus Torvalds, Al Viro
  Cc: linux-mm, linux-fsdevel, linux-kernel, Wu Fengguang, Jan Kara,
	Nick Piggin, Andrea Arcangeli, Andi Kleen, Kirill A. Shutemov

[-- Attachment #1: Type: text/plain, Size: 726 bytes --]

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.

-- 
 Kirill A. Shutemov

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: PAGE_CACHE_SIZE vs. PAGE_SIZE
  2013-01-18 15:57 PAGE_CACHE_SIZE vs. PAGE_SIZE Kirill A. Shutemov
@ 2013-01-31 22:40 ` Andrew Morton
  2013-02-19 16:12   ` Michel Lespinasse
  2013-02-19 10:32 ` Simon Jeons
  1 sibling, 1 reply; 4+ messages in thread
From: Andrew Morton @ 2013-01-31 22:40 UTC (permalink / raw)
  To: Kirill A. Shutemov
  Cc: Linus Torvalds, Al Viro, linux-mm, linux-fsdevel, linux-kernel,
	Wu Fengguang, Jan Kara, Nick Piggin, Andrea Arcangeli, Andi Kleen,
	Kirill A. Shutemov

On Fri, 18 Jan 2013 17:57:25 +0200
"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> 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: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: PAGE_CACHE_SIZE vs. PAGE_SIZE
  2013-01-18 15:57 PAGE_CACHE_SIZE vs. PAGE_SIZE Kirill A. Shutemov
  2013-01-31 22:40 ` Andrew Morton
@ 2013-02-19 10:32 ` Simon Jeons
  1 sibling, 0 replies; 4+ messages in thread
From: Simon Jeons @ 2013-02-19 10:32 UTC (permalink / raw)
  To: Kirill A. Shutemov
  Cc: Andrew Morton, Linus Torvalds, Al Viro, linux-mm, linux-fsdevel,
	linux-kernel, Wu Fengguang, Jan Kara, Nick Piggin,
	Andrea Arcangeli, Andi Kleen, Kirill A. Shutemov

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: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: PAGE_CACHE_SIZE vs. PAGE_SIZE
  2013-01-31 22:40 ` Andrew Morton
@ 2013-02-19 16:12   ` Michel Lespinasse
  0 siblings, 0 replies; 4+ messages in thread
From: Michel Lespinasse @ 2013-02-19 16:12 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Kirill A. Shutemov, Linus Torvalds, Al Viro, linux-mm,
	linux-fsdevel, linux-kernel, Wu Fengguang, Jan Kara, Nick Piggin,
	Andrea Arcangeli, Andi Kleen, Kirill A. Shutemov

On Fri, Feb 1, 2013 at 6:40 AM, Andrew Morton <akpm@linux-foundation.org> wrote:
> On Fri, 18 Jan 2013 17:57:25 +0200
> "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> 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: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-02-19 16:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-18 15:57 PAGE_CACHE_SIZE vs. PAGE_SIZE Kirill A. Shutemov
2013-01-31 22:40 ` Andrew Morton
2013-02-19 16:12   ` Michel Lespinasse
2013-02-19 10:32 ` Simon Jeons

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).