Re: [PATCH 3/3] io_uring: tweak io_req_task_work_add

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 6/30/21 2:54 PM, Pavel Begunkov wrote:
> Whenever possible we don't want to fallback a request. task_work_add()
> will be fine if the task is exiting, so don't check for PF_EXITING,
> there is anyway only a relatively small gap between setting the flag
> and doing the final task_work_run().
> 
> Also add likely for the hot path.

I'm not a huge fan of likely/unlikely, and in particular constructs like:

> -	if (test_bit(0, &tctx->task_state) ||
> +	if (likely(test_bit(0, &tctx->task_state)) ||
>  	    test_and_set_bit(0, &tctx->task_state))
>  		return 0;

where the state is combined. In any case, it should be a separate
change. If there's an "Also" paragraph in a patch, then that's also
usually a good clue that that particular change should've been
separate :-)

-- 
Jens Axboe




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux