mbox series

[0/3] zram: use frontswap for zram swap usecase

Message ID 20230710221659.2473460-1-minchan@kernel.org (mailing list archive)
Headers show
Series zram: use frontswap for zram swap usecase | expand

Message

Minchan Kim July 10, 2023, 10:16 p.m. UTC
This patchset uses frontswap for zram swap usecase and remove
swap_slot_free_notify swap specific operation in block device.
It shows 13% swapout improvement for MADV_PAGEOUT.

Minchan Kim (3):
  frontswap: support backing_dev
  zram: support frontswap
  zram: remove swap_slot_free_notify

 Documentation/filesystems/locking.rst |   5 --
 drivers/block/zram/Kconfig            |   1 +
 drivers/block/zram/zram_drv.c         | 116 ++++++++++++++++++++++----
 drivers/block/zram/zram_drv.h         |   1 +
 include/linux/blkdev.h                |   2 -
 include/linux/frontswap.h             |   7 +-
 mm/frontswap.c                        |   4 +-
 mm/swapfile.c                         |  11 +--
 mm/zswap.c                            |   2 +-
 9 files changed, 110 insertions(+), 39 deletions(-)

Comments

Christoph Hellwig July 11, 2023, 5:17 a.m. UTC | #1
On Mon, Jul 10, 2023 at 03:16:56PM -0700, Minchan Kim wrote:
> This patchset uses frontswap for zram swap usecase and remove
> swap_slot_free_notify swap specific operation in block device.
> It shows 13% swapout improvement for MADV_PAGEOUT.

Err, no.  frontswap needs to go away, and not be tried to a block
driver.  If you want compressed swap without a block driver please use
zswap and help improvig it and the swap abstraction to not require
a backing allocation for it.

We need to fix swap and not pile hacks on top of hacks.
Nhat Pham July 11, 2023, 5:52 p.m. UTC | #2
On Mon, Jul 10, 2023 at 10:18 PM Christoph Hellwig <hch@infradead.org> wrote:
>
> On Mon, Jul 10, 2023 at 03:16:56PM -0700, Minchan Kim wrote:
> > This patchset uses frontswap for zram swap usecase and remove
> > swap_slot_free_notify swap specific operation in block device.
> > It shows 13% swapout improvement for MADV_PAGEOUT.
>
> Err, no.  frontswap needs to go away, and not be tried to a block
> driver.  If you want compressed swap without a block driver please use
> zswap and help improvig it and the swap abstraction to not require
> a backing allocation for it.
>
> We need to fix swap and not pile hacks on top of hacks.
>

+1. Based on earlier discussions, it seems like the agreed upon way forward
is to remove the frontswap interface:

https://lore.kernel.org/linux-mm/20230530235447.GB102494@cmpxchg.org/
Minchan Kim July 11, 2023, 11:56 p.m. UTC | #3
On Tue, Jul 11, 2023 at 10:52:02AM -0700, Nhat Pham wrote:
> On Mon, Jul 10, 2023 at 10:18 PM Christoph Hellwig <hch@infradead.org> wrote:
> >
> > On Mon, Jul 10, 2023 at 03:16:56PM -0700, Minchan Kim wrote:
> > > This patchset uses frontswap for zram swap usecase and remove
> > > swap_slot_free_notify swap specific operation in block device.
> > > It shows 13% swapout improvement for MADV_PAGEOUT.
> >
> > Err, no.  frontswap needs to go away, and not be tried to a block
> > driver.  If you want compressed swap without a block driver please use
> > zswap and help improvig it and the swap abstraction to not require
> > a backing allocation for it.
> >
> > We need to fix swap and not pile hacks on top of hacks.
> >
> 
> +1. Based on earlier discussions, it seems like the agreed upon way forward
> is to remove the frontswap interface:
> 
> https://lore.kernel.org/linux-mm/20230530235447.GB102494@cmpxchg.org/

Thanks for feedback.

Understood. I also agree frontswap is hack so let me this patchset.
I hope swap abstraction goes to the way Chris Li suggested in the end.