Hi, On 6/21/2023 9:20 AM, Alexei Starovoitov wrote: > On Tue, Jun 20, 2023 at 6:07 PM Hou Tao <houtao@xxxxxxxxxxxxxxx> wrote: >> Hi, >> >> On 6/21/2023 12:15 AM, Alexei Starovoitov wrote: >>> On Mon, Jun 19, 2023 at 7:00 AM Hou Tao <houtao@xxxxxxxxxxxxxxx> wrote: >>>> +static void bpf_rcu_gp_acc_work(struct callback_head *head) >>>> +{ >>>> + struct bpf_rcu_gp_acc_ctx *ctx = container_of(head, struct bpf_rcu_gp_acc_ctx, work); >>>> + >>>> + local_irq_disable(); >>>> + rcu_momentary_dyntick_idle(); >>>> + local_irq_enable(); >>> We discussed this with Paul off-line and decided to go a different route. >> "A different route" means the method used to reduce the memory footprint >> is different or the method to do reuse-after-rcu-gp is different ? > Pretty much everything is different. I see. > >>> Paul prepared a patch for us to expose rcu_request_urgent_qs_task(). >>> I'll be sending the series later this week. >> Do you plan to take over the reuse-after-rcu-gp patchset ? > I took a different approach. > It will be easier to discuss when I post patches. > Hopefully later today or tomorrow. Look forward to the new approach. > >> I did a quick test, it showed that the memory footprint is smaller and >> the performance is similar when using rcu_request_urgent_qs_task() >> instead of rcu_momentary_dyntick_idle(). > Right. I saw a similar effect as well. > My understanding is that rcu_momentary_dyntick_idle() is a heavier mechanism > and absolutely should not be used while holding rcu_read_lock(). > So calling from irq_work is not ok. > Only kworker, as you did, is ok from safety pov. It is not kworker and it is a task work which runs when the process returns back to userspace. > Still not recommended in general. Hence rcu_request_urgent_qs_task. Thanks for the explanation.