[PATCH v3 1/2] smp: Introduce a helper function to check for pending IPIs

Thomas Gleixner tglx at linutronix.de
Sat Nov 1 12:59:48 PDT 2025


On Fri, Oct 31 2025 at 12:00, Ulf Hansson wrote:
> +/**
> + * cpus_peek_for_pending_ipi - Check for pending IPI for CPUs
> + * @mask: The CPU mask for the CPUs to check.
> + *
> + * This function walks through the @mask to check if there are any pending IPIs
> + * scheduled, for any of the CPUs in the @mask.
> + *
> + * It's important for the caller to know that this function does not guarantee
> + * correctness. It provides a snapshot, while being as lightweight as possible.

This read clumsy. Just say:

  * It does not guarantee correctness as it only can provide a racy snapshot.

or something like that.

> + * Returns true if there is a pending IPI scheduled and false otherwise.
> + */
> +bool cpus_peek_for_pending_ipi(const struct cpumask *mask)
> +{
> +	unsigned int cpu;
> +
> +	for_each_cpu(cpu, mask) {
> +		if (!llist_empty(per_cpu_ptr(&call_single_queue, cpu)))
> +			return true;
> +	}
> +
> +        return false;
   ^^^^^^^^
White space damage. Spaces instead of TAB.

Thanks,

        tglx



More information about the linux-arm-kernel mailing list