Re: [PATCH 1/2] zram: Less checks in zram_bvec_write() after error detection

2015-12-14 Thread SF Markus Elfring
>> I suggest to make the affected exception handling a bit more efficient. >> Such source code fine-tuning has got a few special consequences. > > by 'more efficient' you mean saving cpu cycles on 'bvec->bv_len != PAGE_SIZE' > comparison in exception/error path? Yes … > ... > check_strm: >

Re: [PATCH 1/2] zram: Less checks in zram_bvec_write() after error detection

2015-12-14 Thread Sergey Senozhatsky
On (12/14/15 07:58), SF Markus Elfring wrote: [..] > > keep it the way it is please. > > I suggest to make the affected exception handling a bit more efficient. > Such source code fine-tuning has got a few special consequences. by 'more efficient' you mean saving cpu cycles on 'bvec->bv_len !=

Re: [PATCH 1/2] zram: Less checks in zram_bvec_write() after error detection

2015-12-14 Thread Sergey Senozhatsky
On (12/14/15 07:58), SF Markus Elfring wrote: [..] > > keep it the way it is please. > > I suggest to make the affected exception handling a bit more efficient. > Such source code fine-tuning has got a few special consequences. by 'more efficient' you mean saving cpu cycles on 'bvec->bv_len !=

Re: [PATCH 1/2] zram: Less checks in zram_bvec_write() after error detection

2015-12-14 Thread SF Markus Elfring
>> I suggest to make the affected exception handling a bit more efficient. >> Such source code fine-tuning has got a few special consequences. > > by 'more efficient' you mean saving cpu cycles on 'bvec->bv_len != PAGE_SIZE' > comparison in exception/error path? Yes … > ... > check_strm: >

Re: [PATCH 1/2] zram: Less checks in zram_bvec_write() after error detection

2015-12-13 Thread Julia Lawall
> I suggest to make the affected exception handling a bit more efficient. > Such source code fine-tuning has got a few special consequences. Exception handling is by definition exceptional, and thus its efficiency is rarely important. What is important is that it should be correct, and ideally

Re: [PATCH 1/2] zram: Less checks in zram_bvec_write() after error detection

2015-12-13 Thread SF Markus Elfring
>> diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c >> index 47915d7..69d7fcd 100644 >> --- a/drivers/block/zram/zram_drv.c >> +++ b/drivers/block/zram/zram_drv.c >> @@ -652,9 +652,9 @@ static int zram_bvec_write(struct zram *zram, struct >> bio_vec *bvec, u32 index, >>

Re: [PATCH 1/2] zram: Less checks in zram_bvec_write() after error detection

2015-12-13 Thread Sergey Senozhatsky
On (12/11/15 19:24), SF Markus Elfring wrote: [..] > diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c > index 47915d7..69d7fcd 100644 > --- a/drivers/block/zram/zram_drv.c > +++ b/drivers/block/zram/zram_drv.c > @@ -652,9 +652,9 @@ static int zram_bvec_write(struct zram

Re: [PATCH 1/2] zram: Less checks in zram_bvec_write() after error detection

2015-12-13 Thread Sergey Senozhatsky
On (12/11/15 19:24), SF Markus Elfring wrote: [..] > diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c > index 47915d7..69d7fcd 100644 > --- a/drivers/block/zram/zram_drv.c > +++ b/drivers/block/zram/zram_drv.c > @@ -652,9 +652,9 @@ static int zram_bvec_write(struct zram

Re: [PATCH 1/2] zram: Less checks in zram_bvec_write() after error detection

2015-12-13 Thread SF Markus Elfring
>> diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c >> index 47915d7..69d7fcd 100644 >> --- a/drivers/block/zram/zram_drv.c >> +++ b/drivers/block/zram/zram_drv.c >> @@ -652,9 +652,9 @@ static int zram_bvec_write(struct zram *zram, struct >> bio_vec *bvec, u32 index, >>

Re: [PATCH 1/2] zram: Less checks in zram_bvec_write() after error detection

2015-12-13 Thread Julia Lawall
> I suggest to make the affected exception handling a bit more efficient. > Such source code fine-tuning has got a few special consequences. Exception handling is by definition exceptional, and thus its efficiency is rarely important. What is important is that it should be correct, and ideally

[PATCH 1/2] zram: Less checks in zram_bvec_write() after error detection

2015-12-11 Thread SF Markus Elfring
From: Markus Elfring Date: Fri, 11 Dec 2015 18:20:59 +0100 This issue was detected by using the Coccinelle software. A few checks could be repeated by the zram_bvec_write() function at two places even if the passed variables contained a null pointer. * This implementation detail could be

[PATCH 1/2] zram: Less checks in zram_bvec_write() after error detection

2015-12-11 Thread SF Markus Elfring
From: Markus Elfring Date: Fri, 11 Dec 2015 18:20:59 +0100 This issue was detected by using the Coccinelle software. A few checks could be repeated by the zram_bvec_write() function at two places even if the passed variables contained a null pointer. * This