Re: [PATCH 07/12] scsi_debug: use likely hints on fast path

2016-04-27 Thread Bart Van Assche
On 04/26/16 22:25, Douglas Gilbert wrote: On 2016-04-26 06:14 PM, Bart Van Assche wrote: On 04/25/2016 09:16 AM, Douglas Gilbert wrote: -if ((SDEBUG_OPT_MEDIUM_ERR & sdebug_opts) && -(lba <= (OPT_MEDIUM_ERR_ADDR + OPT_MEDIUM_ERR_NUM - 1)) && -((lba + num) > OPT_MEDIUM_ERR_AD

Re: [PATCH 07/12] scsi_debug: use likely hints on fast path

2016-04-26 Thread Bart Van Assche
On 04/26/16 22:25, Douglas Gilbert wrote: Do all re-factorings of code need a patch description? Describing all changes makes the job of a reviewer easier because if all changes have been described the reviewer only has to verify the changes against the patch description instead of additional

Re: [PATCH 07/12] scsi_debug: use likely hints on fast path

2016-04-26 Thread Douglas Gilbert
On 2016-04-26 06:14 PM, Bart Van Assche wrote: On 04/25/2016 09:16 AM, Douglas Gilbert wrote: -if ((SDEBUG_OPT_MEDIUM_ERR & sdebug_opts) && -(lba <= (OPT_MEDIUM_ERR_ADDR + OPT_MEDIUM_ERR_NUM - 1)) && -((lba + num) > OPT_MEDIUM_ERR_ADDR)) { +if (unlikely((SDEBUG_OPT_MEDIUM

Re: [PATCH 07/12] scsi_debug: use likely hints on fast path

2016-04-26 Thread Bart Van Assche
On 04/25/2016 09:16 AM, Douglas Gilbert wrote: - if ((SDEBUG_OPT_MEDIUM_ERR & sdebug_opts) && - (lba <= (OPT_MEDIUM_ERR_ADDR + OPT_MEDIUM_ERR_NUM - 1)) && - ((lba + num) > OPT_MEDIUM_ERR_ADDR)) { + if (unlikely((SDEBUG_OPT_MEDIUM_ERR & sdebug_opts) && +

Re: [PATCH 07/12] scsi_debug: use likely hints on fast path

2016-04-25 Thread Hannes Reinecke
On 04/25/2016 06:16 PM, Douglas Gilbert wrote: > The most common commands in normal use are the READ and WRITE SCSI > commands. Use likely and unlikely hints along the path taken by > these commands. Rename check_readiness() to make_ua() and remove > associated dead code. Rename devInfoReg() to fin

[PATCH 07/12] scsi_debug: use likely hints on fast path

2016-04-25 Thread Douglas Gilbert
The most common commands in normal use are the READ and WRITE SCSI commands. Use likely and unlikely hints along the path taken by these commands. Rename check_readiness() to make_ua() and remove associated dead code. Rename devInfoReg() to find_build_dev_info(). Signed-off-by: Douglas Gilbert --