Re: [PATCH 7/7] xfs: use shifting and masking when converting rt extents, if possible

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

 



On Wed, Oct 11, 2023 at 11:06:14AM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@xxxxxxxxxx>
> 
> Avoid the costs of integer division (32-bit and 64-bit) if the realtime
> extent size is a power of two.

Looks good:

Reviewed-by: Christoph Hellwig <hch@xxxxxx>

Do you have any data on how common non-power of two rtext sizes are?
Might it be worth to add unlikely annotations?

> @@ -11,6 +11,9 @@ xfs_rtx_to_rtb(
>  	struct xfs_mount	*mp,
>  	xfs_rtxnum_t		rtx)
>  {
> +	if (mp->m_rtxblklog >= 0)
> +		return rtx << mp->m_rtxblklog;
> +
>  	return rtx * mp->m_sb.sb_rextsize;

i.e.

	if (unlikely(mp->m_rtxblklog == ‐1))
	  	return rtx * mp->m_sb.sb_rextsize;
	return rtx << mp->m_rtxblklog;




[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux