mbox series

[f2fs-dev,0/2,v9] reclaim file-backed pages given POSIX_FADV_NOREUSE

Message ID 20250212023518.897942-1-jaegeuk@kernel.org (mailing list archive)
Headers show
Series reclaim file-backed pages given POSIX_FADV_NOREUSE | expand

Message

Jaegeuk Kim Feb. 12, 2025, 2:31 a.m. UTC
This patch series does not add new API, but implements POSIX_FADV_NOREUSE where
it keeps the page ranges in the f2fs superblock and add a way for users to
reclaim the pages manually.

Change log from v8:
 - remove new APIs, but use fadvise(POSIX_FADV_NOREUSE)

Jaegeuk Kim (2):
  f2fs: keep POSIX_FADV_NOREUSE ranges
  f2fs: add a sysfs entry to reclaim POSIX_FADV_NOREUSE pages

 Documentation/ABI/testing/sysfs-fs-f2fs |  7 ++
 fs/f2fs/debug.c                         |  3 +
 fs/f2fs/f2fs.h                          | 14 +++-
 fs/f2fs/file.c                          | 60 +++++++++++++++--
 fs/f2fs/inode.c                         | 14 ++++
 fs/f2fs/shrinker.c                      | 90 +++++++++++++++++++++++++
 fs/f2fs/super.c                         |  1 +
 fs/f2fs/sysfs.c                         | 63 +++++++++++++++++
 8 files changed, 246 insertions(+), 6 deletions(-)

Comments

Christoph Hellwig Feb. 18, 2025, 8:26 a.m. UTC | #1
This still has a file system sysfs HACK, you're still not Ccing the
right list, etc.

Can you pleae at least try to get it right?

On Wed, Feb 12, 2025 at 02:31:55AM +0000, Jaegeuk Kim wrote:
> This patch series does not add new API, but implements POSIX_FADV_NOREUSE where
> it keeps the page ranges in the f2fs superblock and add a way for users to
> reclaim the pages manually.
> 
> Change log from v8:
>  - remove new APIs, but use fadvise(POSIX_FADV_NOREUSE)
> 
> Jaegeuk Kim (2):
>   f2fs: keep POSIX_FADV_NOREUSE ranges
>   f2fs: add a sysfs entry to reclaim POSIX_FADV_NOREUSE pages
> 
>  Documentation/ABI/testing/sysfs-fs-f2fs |  7 ++
>  fs/f2fs/debug.c                         |  3 +
>  fs/f2fs/f2fs.h                          | 14 +++-
>  fs/f2fs/file.c                          | 60 +++++++++++++++--
>  fs/f2fs/inode.c                         | 14 ++++
>  fs/f2fs/shrinker.c                      | 90 +++++++++++++++++++++++++
>  fs/f2fs/super.c                         |  1 +
>  fs/f2fs/sysfs.c                         | 63 +++++++++++++++++
>  8 files changed, 246 insertions(+), 6 deletions(-)
> 
> -- 
> 2.48.1.601.g30ceb7b040-goog
> 
> 
---end quoted text---
Jaegeuk Kim Feb. 19, 2025, 9:38 a.m. UTC | #2
On 02/18, Christoph Hellwig wrote:
> This still has a file system sysfs HACK, you're still not Ccing the
> right list, etc.
> 
> Can you pleae at least try to get it right?

I was modifying the patch having 1) declaring a static global list, 2) adding
some fields to superblock and inode structures to keep the given range in the
inode through fadvise, 3) adding hooks in evict_inode to handle the list, 4)
exploring which sysfs entry in MM to reclaim them explicitly.

But, I stopped at some point, as it looks not good at all. Moreover, I started
to be questioning why not just doing in F2FS back, given sementically I didn't
change anything  on general behavior of fadvise(POSIX_FADV_NOREUSE), IIUC, which
moves pages back to LRU. In addiiton to that, I'd like to keep the range hint in
a filesystem and provide a sysfs entry to manage the hints additionally.
In addition, I don't think there's rule that filesystem cannot reclaim file-back
pages, as it just uses the exported symbol that all filesystems are using in
various different purpose. Hence, I don't get the point which is wrong.

Thanks,

> 
> On Wed, Feb 12, 2025 at 02:31:55AM +0000, Jaegeuk Kim wrote:
> > This patch series does not add new API, but implements POSIX_FADV_NOREUSE where
> > it keeps the page ranges in the f2fs superblock and add a way for users to
> > reclaim the pages manually.
> > 
> > Change log from v8:
> >  - remove new APIs, but use fadvise(POSIX_FADV_NOREUSE)
> > 
> > Jaegeuk Kim (2):
> >   f2fs: keep POSIX_FADV_NOREUSE ranges
> >   f2fs: add a sysfs entry to reclaim POSIX_FADV_NOREUSE pages
> > 
> >  Documentation/ABI/testing/sysfs-fs-f2fs |  7 ++
> >  fs/f2fs/debug.c                         |  3 +
> >  fs/f2fs/f2fs.h                          | 14 +++-
> >  fs/f2fs/file.c                          | 60 +++++++++++++++--
> >  fs/f2fs/inode.c                         | 14 ++++
> >  fs/f2fs/shrinker.c                      | 90 +++++++++++++++++++++++++
> >  fs/f2fs/super.c                         |  1 +
> >  fs/f2fs/sysfs.c                         | 63 +++++++++++++++++
> >  8 files changed, 246 insertions(+), 6 deletions(-)
> > 
> > -- 
> > 2.48.1.601.g30ceb7b040-goog
> > 
> > 
> ---end quoted text---
patchwork-bot+f2fs--- via Linux-f2fs-devel Feb. 21, 2025, 2:17 a.m. UTC | #3
Hello:

This series was applied to jaegeuk/f2fs.git (dev)
by Jaegeuk Kim <jaegeuk@kernel.org>:

On Wed, 12 Feb 2025 02:31:55 +0000 you wrote:
> This patch series does not add new API, but implements POSIX_FADV_NOREUSE where
> it keeps the page ranges in the f2fs superblock and add a way for users to
> reclaim the pages manually.
> 
> Change log from v8:
>  - remove new APIs, but use fadvise(POSIX_FADV_NOREUSE)
> 
> [...]

Here is the summary with links:
  - [f2fs-dev,1/2] f2fs: keep POSIX_FADV_NOREUSE ranges
    https://git.kernel.org/jaegeuk/f2fs/c/ef0c333cad8d
  - [f2fs-dev,2/2] f2fs: add a sysfs entry to reclaim POSIX_FADV_NOREUSE pages
    https://git.kernel.org/jaegeuk/f2fs/c/a907f3a68ee2

You are awesome, thank you!