Re: [PATCH bpf-next] bpf: Alloc bpf_async_cb by using bpf_global_ma under PREEMPT_RT

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

 




On 1/14/2025 4:13 PM, Hou Tao wrote:
> From: Hou Tao <houtao1@xxxxxxxxxx>
>
> Under PREEMPT_RT, it is not safe to use GPF_ATOMIC kmalloc when
> preemption or irq is disabled. The following warning is reported when
> running test_progs under PREEMPT_RT:
>
>   

SNIP
> +	bpf_async_free_rcu(&w->cb);
>  }
>  
>  static void bpf_timer_delete_work(struct work_struct *work)
> @@ -1236,7 +1266,7 @@ static void bpf_timer_delete_work(struct work_struct *work)
>  	 * bpf_timer_cancel_and_free will have been cancelled.
>  	 */
>  	hrtimer_cancel(&t->timer);
> -	kfree_rcu(t, cb.rcu);
> +	bpf_async_free_rcu(&t->cb);
>  }

Er, it is buggy here. migrate_{disable|enable} pair is missed because it
is running under kworker context. Found it when apply the patch after
the patch set "Free htab element out of bucket lock v2". Will send v2
for it.





[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux