Re: [PATCH 1/3] mm/numa_balancing: Teach mpol_to_str about the balancing mode

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

 



On Fri, Jul 05, 2024 at 03:32:16PM +0100, Tvrtko Ursulin wrote:
> +		if (flags & MPOL_F_NUMA_BALANCING) {
> +			if (hweight16(flags & MPOL_MODE_FLAGS) > 1)

hweight() > 1 seems somewhat inefficient.
!is_power_of_2() would be better.  Or clear off the bits as they're
printed and print the bar if the remaining flags are not 0.

> +				p += snprintf(p, buffer + maxlen - p, "|");
> +			p += snprintf(p, buffer + maxlen - p, "balancing");
> +		}
>  	}
>  
>  	if (!nodes_empty(nodes))
> -- 
> 2.44.0
> 
> 




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux