* Why use page_cache_ra_unbounded?
@ 2021-04-07 15:02 ` Matthew Wilcox
0 siblings, 0 replies; 4+ messages in thread
From: Matthew Wilcox @ 2021-04-07 15:02 UTC (permalink / raw)
To: Daeho Jeong; +Cc: Chao Yu, Jaegeuk Kim, linux-fsdevel, linux-f2fs-devel
commit 5fdb322ff2c2b4ad519f490dcb7ebb96c5439af7
Author: Daeho Jeong <daehojeong@google.com>
Date: Thu Dec 3 15:56:15 2020 +0900
f2fs: add F2FS_IOC_DECOMPRESS_FILE and F2FS_IOC_COMPRESS_FILE
+ page_cache_ra_unbounded(&ractl, len, 0);
/**
* page_cache_ra_unbounded - Start unchecked readahead.
* @ractl: Readahead control.
* @nr_to_read: The number of pages to read.
* @lookahead_size: Where to start the next readahead.
*
* This function is for filesystems to call when they want to start
* readahead beyond a file's stated i_size. This is almost certainly
* not the function you want to call. Use page_cache_async_readahead()
* or page_cache_sync_readahead() instead.
*
* Context: File is referenced by caller. Mutexes may be held by caller.
* May sleep, but will not reenter filesystem to reclaim memory.
*/
Why?
^ permalink raw reply [flat|nested] 4+ messages in thread
* [f2fs-dev] Why use page_cache_ra_unbounded?
@ 2021-04-07 15:02 ` Matthew Wilcox
0 siblings, 0 replies; 4+ messages in thread
From: Matthew Wilcox @ 2021-04-07 15:02 UTC (permalink / raw)
To: Daeho Jeong; +Cc: linux-fsdevel, Jaegeuk Kim, linux-f2fs-devel
commit 5fdb322ff2c2b4ad519f490dcb7ebb96c5439af7
Author: Daeho Jeong <daehojeong@google.com>
Date: Thu Dec 3 15:56:15 2020 +0900
f2fs: add F2FS_IOC_DECOMPRESS_FILE and F2FS_IOC_COMPRESS_FILE
+ page_cache_ra_unbounded(&ractl, len, 0);
/**
* page_cache_ra_unbounded - Start unchecked readahead.
* @ractl: Readahead control.
* @nr_to_read: The number of pages to read.
* @lookahead_size: Where to start the next readahead.
*
* This function is for filesystems to call when they want to start
* readahead beyond a file's stated i_size. This is almost certainly
* not the function you want to call. Use page_cache_async_readahead()
* or page_cache_sync_readahead() instead.
*
* Context: File is referenced by caller. Mutexes may be held by caller.
* May sleep, but will not reenter filesystem to reclaim memory.
*/
Why?
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [f2fs-dev] Why use page_cache_ra_unbounded?
2021-04-07 15:02 ` [f2fs-dev] " Matthew Wilcox
@ 2021-04-07 22:41 ` Daeho Jeong
-1 siblings, 0 replies; 4+ messages in thread
From: Daeho Jeong @ 2021-04-07 22:41 UTC (permalink / raw)
To: Matthew Wilcox; +Cc: Daeho Jeong, linux-fsdevel, Jaegeuk Kim, linux-f2fs-devel
2021년 4월 8일 (목) 오전 12:05, Matthew Wilcox <willy@infradead.org>님이 작성:
>
>
> commit 5fdb322ff2c2b4ad519f490dcb7ebb96c5439af7
> Author: Daeho Jeong <daehojeong@google.com>
> Date: Thu Dec 3 15:56:15 2020 +0900
>
> f2fs: add F2FS_IOC_DECOMPRESS_FILE and F2FS_IOC_COMPRESS_FILE
>
> + page_cache_ra_unbounded(&ractl, len, 0);
>
> /**
> * page_cache_ra_unbounded - Start unchecked readahead.
> * @ractl: Readahead control.
> * @nr_to_read: The number of pages to read.
> * @lookahead_size: Where to start the next readahead.
> *
> * This function is for filesystems to call when they want to start
> * readahead beyond a file's stated i_size. This is almost certainly
> * not the function you want to call. Use page_cache_async_readahead()
> * or page_cache_sync_readahead() instead.
> *
> * Context: File is referenced by caller. Mutexes may be held by caller.
> * May sleep, but will not reenter filesystem to reclaim memory.
> */
>
> Why?
>
Hi Matthew,
What I wanted here is like do_page_cache_ra(), but do_page_cache_ra()
is defined in mm/internal.h only for internal use.
So, I used it, because we already checked the i_size boundary on our own.
Actually, I wanted to detour the internal readahead mechanism using
page_cache_ra_unbounded() to generate cluster size aligned read requests.
Plus, page_cache_sync_readahead() is not good for our situation,
it might end up with cluster misaligned reads which trigger internal
duplicated cluster reads.
>
>
> _______________________________________________
> Linux-f2fs-devel mailing list
> Linux-f2fs-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [f2fs-dev] Why use page_cache_ra_unbounded?
@ 2021-04-07 22:41 ` Daeho Jeong
0 siblings, 0 replies; 4+ messages in thread
From: Daeho Jeong @ 2021-04-07 22:41 UTC (permalink / raw)
To: Matthew Wilcox; +Cc: linux-fsdevel, Jaegeuk Kim, Daeho Jeong, linux-f2fs-devel
2021년 4월 8일 (목) 오전 12:05, Matthew Wilcox <willy@infradead.org>님이 작성:
>
>
> commit 5fdb322ff2c2b4ad519f490dcb7ebb96c5439af7
> Author: Daeho Jeong <daehojeong@google.com>
> Date: Thu Dec 3 15:56:15 2020 +0900
>
> f2fs: add F2FS_IOC_DECOMPRESS_FILE and F2FS_IOC_COMPRESS_FILE
>
> + page_cache_ra_unbounded(&ractl, len, 0);
>
> /**
> * page_cache_ra_unbounded - Start unchecked readahead.
> * @ractl: Readahead control.
> * @nr_to_read: The number of pages to read.
> * @lookahead_size: Where to start the next readahead.
> *
> * This function is for filesystems to call when they want to start
> * readahead beyond a file's stated i_size. This is almost certainly
> * not the function you want to call. Use page_cache_async_readahead()
> * or page_cache_sync_readahead() instead.
> *
> * Context: File is referenced by caller. Mutexes may be held by caller.
> * May sleep, but will not reenter filesystem to reclaim memory.
> */
>
> Why?
>
Hi Matthew,
What I wanted here is like do_page_cache_ra(), but do_page_cache_ra()
is defined in mm/internal.h only for internal use.
So, I used it, because we already checked the i_size boundary on our own.
Actually, I wanted to detour the internal readahead mechanism using
page_cache_ra_unbounded() to generate cluster size aligned read requests.
Plus, page_cache_sync_readahead() is not good for our situation,
it might end up with cluster misaligned reads which trigger internal
duplicated cluster reads.
>
>
> _______________________________________________
> Linux-f2fs-devel mailing list
> Linux-f2fs-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-04-07 22:42 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-07 15:02 Why use page_cache_ra_unbounded? Matthew Wilcox
2021-04-07 15:02 ` [f2fs-dev] " Matthew Wilcox
2021-04-07 22:41 ` Daeho Jeong
2021-04-07 22:41 ` Daeho Jeong
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.