Re: [PATCH] zram: Always expose rw_page

From: Brian Geffon
Date: Mon Oct 03 2022 - 10:48:17 EST


On Sun, Oct 2, 2022 at 10:59 PM Sergey Senozhatsky
<senozhatsky@xxxxxxxxxxxx> wrote:
>
> On (22/09/30 15:52), Brian Geffon wrote:
> > Currently zram will adjust its fops to a version which does not
> > contain rw_page when a backing device has been assigned. This is
> > done to prevent upper layers from assuming a synchronous operation
> > when a page may have been written back. This forces every operation
> > through bio which has overhead associated with bio_alloc/frees.
> >
> > The code can be simplified to always expose a rw_page method and
> > only in the rare event that a page is written back we instead will
> > return -EOPNOTSUPP forcing the upper layer to fallback to bio.
>
> Reviewed-by: Sergey Senozhatsky <senozhatsky@xxxxxxxxxxxx>

Thank you.

>
> > @@ -1267,6 +1253,9 @@ static int __zram_bvec_read(struct zram *zram, struct page *page, u32 index,
> > struct bio_vec bvec;
> >
> > zram_slot_unlock(zram, index);
> > + /* If we don't have a bio we came via rw_page, we must fallback to bio */
> > + if (!bio)
> > + return -EOPNOTSUPP;
>
> The comment is above 80 cols.

Fixed in a new patch.