lkml.org 
[lkml]   [2022]   [Oct]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] zram: Always expose rw_page
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@chromium.org>

> @@ -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.

\
 
 \ /
  Last update: 2022-10-03 04:59    [W:0.069 / U:0.272 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site