Re: [PATCH v3 08/20] sg: speed sg_poll and sg_get_num_waiting

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

 



On Wed, Aug 07, 2019 at 01:42:40PM +0200, Douglas Gilbert wrote:
> Track the number of submitted and waiting (for read/receive)
> requests on each file descriptor with two atomic integers.
> This speeds sg_poll() and ioctl(SG_GET_NUM_WAITING) which
> are oft used with the asynchronous (non-blocking) interfaces.

The idea of just tracking a count here seems sensible.

Tiny nitpick below:

> +	else if (likely(sfp->cmd_q))
> +		p_res |= EPOLLOUT | EPOLLWRNORM;
> +	else if (atomic_read(&sfp->submitted) == 0)
>  		p_res |= EPOLLOUT | EPOLLWRNORM;

Why not simply:

	 else if (sfp->cmd_q || atomic_read(&sfp->submitted)
 		p_res |= EPOLLOUT | EPOLLWRNORM;



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux