[Trimmed most CCs]

Hi Joel,

I've got a warning from "make htmldocs" on top of rcu/next:

[...]/kernel/rcu/tree.c:775: warning: cannot understand function prototype: 
'unsigned long seq_gpwrap_lag = ULONG_MAX / 4; '

On Mon, 21 Apr 2025 13:47:15 -0400, Joel Fernandes wrote:
[...]

> diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
> index 659f83e71048..6ec30d07759d 100644
> --- a/kernel/rcu/tree.c
> +++ b/kernel/rcu/tree.c
[...]

> @@ -757,6 +766,25 @@ void rcu_request_urgent_qs_task(struct task_struct *t)
>       smp_store_release(per_cpu_ptr(&rcu_data.rcu_urgent_qs, cpu), true);
>  }
>  
> +/**
> + * rcu_set_gpwrap_lag - Set RCU GP sequence overflow lag value.
> + * @lag_gps: Set overflow lag to this many grace period worth of counters
> + * which is used by rcutorture to quickly force a gpwrap situation.
> + * @lag_gps = 0 means we reset it back to the boot-time value.
> + */

This kernel-doc comment should be in front of its corresponding function
prototype so that it is recognized as such.

> +static unsigned long seq_gpwrap_lag = ULONG_MAX / 4;
> +

, so this static variable needs to go above the kernel-doc comment.

> +void rcu_set_gpwrap_lag(unsigned long lag_gps)
> +{
> +     unsigned long lag_seq_count;
> +
> +     lag_seq_count = (lag_gps == 0)
> +                     ? ULONG_MAX / 4
> +                     : lag_gps << RCU_SEQ_CTR_SHIFT;
> +     WRITE_ONCE(seq_gpwrap_lag, lag_seq_count);
> +}
> +EXPORT_SYMBOL_GPL(rcu_set_gpwrap_lag);
> +

You can test it by saying:

    ./scripts/kernel-doc -none kernel/rcu/tree.c

Thanks,
Akira


Reply via email to