Re: [PATCH V2 1/5] blk-mq: remove hctx_lock and hctx_unlock

kernel test robot
2021-11-30T14:42:57Z

Hi Ming,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on axboe-block/for-next]
[also build test WARNING on mkp-scsi/for-next v5.16-rc3 next-20211130]
[cannot apply to linux-nvme/for-next hch-configfs/for-next]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url: https://github.com/0day-ci/linux/commits/Ming-Lei/blk-mq-quiesce-improvement/20211130-154015
base: https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git for-next
config: hexagon-randconfig-r045-20211129 (https://download.01.org/0day-ci/archive/20211130/202111302217.rEsBycwv-lkp@intel.com/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 25eb7fa01d7ebbe67648ea03841cda55b4239ab2)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/4575a8b36e3a56fa87b1f77e0064fc2ec36ebb7c
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Ming-Lei/blk-mq-quiesce-improvement/20211130-154015
git checkout 4575a8b36e3a56fa87b1f77e0064fc2ec36ebb7c
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=hexagon SHELL=/bin/bash

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> block/blk-mq.c:2482:2: warning: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Wcompound-token-split-by-macro]
blk_mq_run_dispatch_ops(hctx,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
block/blk-mq.c:1079:3: note: expanded from macro 'blk_mq_run_dispatch_ops'
(dispatch_ops); \
^
block/blk-mq.c:2483:3: note: '{' token is here
{
^
block/blk-mq.c:1079:4: note: expanded from macro 'blk_mq_run_dispatch_ops'
(dispatch_ops); \
^~~~~~~~~~~~
>> block/blk-mq.c:2489:3: warning: '}' and ')' tokens terminating statement expression appear in different macro expansion contexts [-Wcompound-token-split-by-macro]
}
^
block/blk-mq.c:1079:4: note: expanded from macro 'blk_mq_run_dispatch_ops'
(dispatch_ops); \
^~~~~~~~~~~~
block/blk-mq.c:2482:2: note: ')' token is here
blk_mq_run_dispatch_ops(hctx,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
block/blk-mq.c:1079:16: note: expanded from macro 'blk_mq_run_dispatch_ops'
(dispatch_ops); \
^
>> block/blk-mq.c:2482:2: warning: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Wcompound-token-split-by-macro]
blk_mq_run_dispatch_ops(hctx,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
block/blk-mq.c:1086:3: note: expanded from macro 'blk_mq_run_dispatch_ops'
(dispatch_ops); \
^
block/blk-mq.c:2483:3: note: '{' token is here
{
^
block/blk-mq.c:1086:4: note: expanded from macro 'blk_mq_run_dispatch_ops'
(dispatch_ops); \
^~~~~~~~~~~~
>> block/blk-mq.c:2489:3: warning: '}' and ')' tokens terminating statement expression appear in different macro expansion contexts [-Wcompound-token-split-by-macro]
}
^
block/blk-mq.c:1086:4: note: expanded from macro 'blk_mq_run_dispatch_ops'
(dispatch_ops); \
^~~~~~~~~~~~
block/blk-mq.c:2482:2: note: ')' token is here
blk_mq_run_dispatch_ops(hctx,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
block/blk-mq.c:1086:16: note: expanded from macro 'blk_mq_run_dispatch_ops'
(dispatch_ops); \
^
4 warnings generated.

vim +2482 block/blk-mq.c

2466
2467 /**
2468 * blk_mq_try_issue_directly - Try to send a request directly to device driver.
2469 * @hctx: Pointer of the associated hardware queue.
2470 * @rq: Pointer to request to be sent.
2471 *
2472 * If the device has enough resources to accept a new request now, send the
2473 * request directly to device driver. Else, insert at hctx->dispatch queue, so
2474 * we can try send it another time in the future. Requests inserted at this
2475 * queue have higher priority.
2476 */
2477 static void blk_mq_try_issue_directly(struct blk_mq_hw_ctx *hctx,
2478 struct request *rq)
2479 {
2480 blk_status_t ret;
2481
> 2482 blk_mq_run_dispatch_ops(hctx,
2483 {
2484 ret = __blk_mq_try_issue_directly(hctx, rq, false, true);
2485 if (ret == BLK_STS_RESOURCE || ret == BLK_STS_DEV_RESOURCE)
2486 blk_mq_request_bypass_insert(rq, false, true);
2487 else if (ret != BLK_STS_OK)
2488 blk_mq_end_request(rq, ret);
> 2489 }
2490 );
2491 }
2492

---
0-DAY CI Kernel Test Service, Intel Corporation