Skip to contentSkip to conversation

PAGE_CACHE_SIZE vs. PAGE_SIZE

DISCUSSION Kirill A. Shutemov 4 participants 4 messages Jan 18, 2013 – Feb 19, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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.

Signature · 1 line
 Kirill A. Shutemov
maintainer
#1 lore raw
Quoted 11 lines · On Fri, 18 Jan 2013 17:57:25 +0200 "Kirill A. Shutemov"…

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.

Quoted 8 lines

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 [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

#3 lore raw
In reply to Kirill A. Shutemov
Quoted 11 lines · Kirill A. Shutemov

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.

Quoted 5 lines

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.

Quoted 4 lines

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 [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

#2 lore raw
In reply to Andrew Morton
Quoted 23 lines · Andrew Morton
Quoted 11 lines · On Fri, 18 Jan 2013 17:57:25 +0200 "Kirill A. Shutemov"…

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.

Quoted 8 lines

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.

Quoted 6 lines

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())

Signature · 8 lines
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 [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>