Re: [PATCH 2/7] mm: remove the swap_readpage return value

2023-01-25 Thread Christoph Hellwig
On Wed, Jan 25, 2023 at 08:58:31AM -0700, Keith Busch wrote: > On Wed, Jan 25, 2023 at 02:34:31PM +0100, Christoph Hellwig wrote: > > -static inline int swap_readpage(struct page *page, bool do_poll, > > - struct swap_iocb **plug) > > +static inline void swap_readpage(stru

Re: [PATCH 7/7] block: remove ->rw_page

2023-01-25 Thread Christoph Hellwig
On Wed, Jan 25, 2023 at 09:28:33AM -0700, Keith Busch wrote: > On Wed, Jan 25, 2023 at 02:34:36PM +0100, Christoph Hellwig wrote: > > @@ -363,8 +384,10 @@ void __swap_writepage(struct page *page, struct > > writeback_control *wbc) > > */ > > if (data_race(sis->flags & SWP_FS_OPS)) > >

RE: [PATCH 7/7] block: remove ->rw_page

2023-01-25 Thread Dan Williams
Christoph Hellwig wrote: > The ->rw_page method is a special purpose bypass of the usual bio > handling path that is limited to single-page reads and writes and > synchronous which causes a lot of extra code in the drivers, callers > and the block layer. > > The only remaining user is the MM swap

RE: [PATCH 3/7] mm: factor out a swap_readpage_bdev helper

2023-01-25 Thread Dan Williams
Christoph Hellwig wrote: > Split the block device case from swap_readpage into a separate helper, > following the abstraction for file based swap and frontswap. > > Signed-off-by: Christoph Hellwig > --- > mm/page_io.c | 68 +++- > 1 file changed,

RE: [PATCH 2/7] mm: remove the swap_readpage return value

2023-01-25 Thread Dan Williams
Christoph Hellwig wrote: > swap_readpage always returns 0, and no caller checks the return value. > > Signed-off-by: Christoph Hellwig > --- > mm/page_io.c | 16 +--- > mm/swap.h| 7 +++ > 2 files changed, 8 insertions(+), 15 deletions(-) > > diff --git a/mm/page_io.c b/mm/

RE: [PATCH 1/7] mpage: stop using bdev_{read,write}_page

2023-01-25 Thread Dan Williams
Christoph Hellwig wrote: > These are micro-optimizations for synchronous I/O, which do not matter > compared to all the other inefficiencies in the legacy buffer_head > based mpage code. > > Signed-off-by: Christoph Hellwig > --- > fs/mpage.c | 10 -- > 1 file changed, 10 deletions(-) >

Re: [PATCH 7/7] block: remove ->rw_page

2023-01-25 Thread Keith Busch
On Wed, Jan 25, 2023 at 02:34:36PM +0100, Christoph Hellwig wrote: > @@ -363,8 +384,10 @@ void __swap_writepage(struct page *page, struct > writeback_control *wbc) >*/ > if (data_race(sis->flags & SWP_FS_OPS)) > swap_writepage_fs(page, wbc); > + else if (sis->flags

Re: [PATCH 2/7] mm: remove the swap_readpage return value

2023-01-25 Thread Keith Busch
On Wed, Jan 25, 2023 at 02:34:31PM +0100, Christoph Hellwig wrote: > -static inline int swap_readpage(struct page *page, bool do_poll, > - struct swap_iocb **plug) > +static inline void swap_readpage(struct page *page, bool do_poll, > + struct swap_iocb **plu

Re: remove ->rw_page

2023-01-25 Thread Jens Axboe
On 1/25/23 6:34 AM, Christoph Hellwig wrote: > Hi all, > > this series removes the ->rw_page block_device_operation, which is an old > and clumsy attempt at a simple read/write fast path for the block layer. > It isn't actually used by the fastest block layer operations that we > support (polled I

[PATCH 7/7] block: remove ->rw_page

2023-01-25 Thread Christoph Hellwig
The ->rw_page method is a special purpose bypass of the usual bio handling path that is limited to single-page reads and writes and synchronous which causes a lot of extra code in the drivers, callers and the block layer. The only remaining user is the MM swap code. Switch that swap code to simpl

[PATCH 6/7] mm: factor out a swap_writepage_bdev helper

2023-01-25 Thread Christoph Hellwig
Split the block device case from swap_readpage into a separate helper, following the abstraction for file based swap. Signed-off-by: Christoph Hellwig --- mm/page_io.c | 33 +++-- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/mm/page_io.c b/mm/page_i

[PATCH 5/7] mm: remove the __swap_writepage return value

2023-01-25 Thread Christoph Hellwig
__swap_writepage always returns 0. Signed-off-by: Christoph Hellwig --- mm/page_io.c | 23 +-- mm/swap.h| 2 +- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/mm/page_io.c b/mm/page_io.c index 21ce4505f00607..c373d5694cdffd 100644 --- a/mm/page_io.c +++

[PATCH 4/7] mm: use an on-stack bio for synchronous swapin

2023-01-25 Thread Christoph Hellwig
Optimize the synchronous swap in case by using an on-stack bio instead of allocating one using bio_alloc. Signed-off-by: Christoph Hellwig --- mm/page_io.c | 69 +--- 1 file changed, 38 insertions(+), 31 deletions(-) diff --git a/mm/page_io.c b/mm

[PATCH 3/7] mm: factor out a swap_readpage_bdev helper

2023-01-25 Thread Christoph Hellwig
Split the block device case from swap_readpage into a separate helper, following the abstraction for file based swap and frontswap. Signed-off-by: Christoph Hellwig --- mm/page_io.c | 68 +++- 1 file changed, 35 insertions(+), 33 deletions(-) diff

[PATCH 2/7] mm: remove the swap_readpage return value

2023-01-25 Thread Christoph Hellwig
swap_readpage always returns 0, and no caller checks the return value. Signed-off-by: Christoph Hellwig --- mm/page_io.c | 16 +--- mm/swap.h| 7 +++ 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/mm/page_io.c b/mm/page_io.c index 3a5f921b932e82..6f7166fdc4b

remove ->rw_page

2023-01-25 Thread Christoph Hellwig
Hi all, this series removes the ->rw_page block_device_operation, which is an old and clumsy attempt at a simple read/write fast path for the block layer. It isn't actually used by the fastest block layer operations that we support (polled I/O through io_uring), but only used by the mpage buffered

[PATCH 1/7] mpage: stop using bdev_{read,write}_page

2023-01-25 Thread Christoph Hellwig
These are micro-optimizations for synchronous I/O, which do not matter compared to all the other inefficiencies in the legacy buffer_head based mpage code. Signed-off-by: Christoph Hellwig --- fs/mpage.c | 10 -- 1 file changed, 10 deletions(-) diff --git a/fs/mpage.c b/fs/mpage.c index