Re: [PATCH] zram: factor out partial IO routine

From: Sergey Senozhatsky
Date: Thu Mar 30 2017 - 00:12:43 EST


On (03/29/17 16:48), Minchan Kim wrote:
> For architecture(PAGE_SIZE > 4K), zram have supported partial IO.
> However, the mixed code for handling normal/partial IO is too mess,
> error-prone to modify IO handler functions with upcoming feature
> so this patch aims for cleaning up via factoring out partial IO
> routines to zram_bvec_partial_[read|write] which will be disabled
> for most 4K page architecures.
>
> x86(4K architecure)
> add/remove: 0/1 grow/shrink: 0/1 up/down: 0/-664 (-664)
> function old new delta
> zram_bvec_rw 2301 2039 -262
> zram_decompress_page.isra 402 - -402
>
> So, we will save 662 bytes.
>
> However, as side effect, it will increase binary size in
> non-4K architecure but it's not major for zram so I believe
> benefit(maintainance, binary size for most architecture) is bigger.

a bigger side effect is that now we double the amount of lines we need
to change in certain patches and, thus, the amount of work - when we
add new functionality/fix something in zram_bvec_{write, read} we also
would need to touch zram_bvec_partial_{write, read}.

still probably worth it.

Reviewed-by: Sergey Senozhatsky <sergey.senozhatsky@xxxxxxxxx>

-ss