Hi Mika,

On Mon, Apr 03, 2017 at 08:52:33AM +0300, Mika Penttilä wrote:
> 
> Hi!
> 
> On 04/03/2017 08:17 AM, 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 zram's IO handling functions.
> > 
> > Signed-off-by: Minchan Kim <minc...@kernel.org>
> > ---
> >  drivers/block/zram/zram_drv.c | 333 
> > +++++++++++++++++++++++-------------------
> >  1 file changed, 184 insertions(+), 149 deletions(-)
> > 
> > diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c
> > index 28c2836f8c96..7938f4b98b01 100644
> > --- a/drivers/block/zram/zram_drv.c
> > +++ b/drivers/block/zram/zram_drv.c
> > @@ -45,6 +45,8 @@ static const char *default_compressor = "lzo";
> >  /* Module params (documentation at end) */
> >  static unsigned int num_devices = 1;
> >  
> > +static void zram_free_page(struct zram *zram, size_t index);
> > +
> >  static inline bool init_done(struct zram *zram)
> >  {
> >     return zram->disksize;
> > @@ -98,10 +100,17 @@ static void zram_set_obj_size(struct zram_meta *meta,
> >     meta->table[index].value = (flags << ZRAM_FLAG_SHIFT) | size;
> >  }
> >  
> > +#if PAGE_SIZE != 4096
> >  static inline bool is_partial_io(struct bio_vec *bvec)
> >  {
> >     return bvec->bv_len != PAGE_SIZE;
> >  }
> > +#else
> 
> For page size of 4096 bv_len can still be < 4096 and partial pages should be 
> supported 
> (uncompress before write etc). ? 

zram declares this.

        #define ZRAM_LOGICAL_BLOCK_SIZE (1<<12)

        blk_queue_physical_block_size(zram->disk->queue, PAGE_SIZE);
        blk_queue_logical_block_size(zram->disk->queue,
                                        ZRAM_LOGICAL_BLOCK_SIZE);

So, I thought there is no such partial IO in 4096 page architecture.
Am I missing something? Could you tell the scenario if it happens?

Thanks!

Reply via email to