lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALm+0cVivqMsTi0P_4dSK5XSE1ZW_Xx=9_h61VapZTtuOoUwDw@mail.gmail.com>
Date: Wed, 13 Mar 2024 12:49:50 +0800
From: Z qiang <qiang.zhang1211@...il.com>
To: paulmck@...nel.org
Cc: frederic@...nel.org, neeraj.upadhyay@...nel.org, joel@...lfernandes.org, 
	rcu@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] rcu-tasks: Remove unnecessary lazy_jiffies in call_rcu_tasks_generic_timer()

>
> On Tue, Mar 12, 2024 at 07:35:24PM +0800, Zqiang wrote:
> > The rcu_tasks_percpu structure's->lazy_timer is queued only when
> > the rcu_tasks structure's->lazy_jiffies is not equal to zero in
> > call_rcu_tasks_generic(), if the lazy_timer callback is invoked,
> > that means the lazy_jiffes is not equal to zero, this commit
> > therefore remove lazy_jiffies check in call_rcu_tasks_generic_timer().
> >
> > Signed-off-by: Zqiang <qiang.zhang1211@...il.com>
> > ---
> >  kernel/rcu/tasks.h | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/kernel/rcu/tasks.h b/kernel/rcu/tasks.h
> > index b1254cf3c210..439e0b9a2656 100644
> > --- a/kernel/rcu/tasks.h
> > +++ b/kernel/rcu/tasks.h
> > @@ -299,7 +299,7 @@ static void call_rcu_tasks_generic_timer(struct timer_list *tlp)
> >
> >       rtp = rtpcp->rtpp;
> >       raw_spin_lock_irqsave_rcu_node(rtpcp, flags);
> > -     if (!rcu_segcblist_empty(&rtpcp->cblist) && rtp->lazy_jiffies) {
> > +     if (!rcu_segcblist_empty(&rtpcp->cblist)) {
>
> Good eyes!
>
> But did you test with something like a WARN_ON_ONCE(rtp->lazy_jiffies)?

Hi, Paul

+  if (!rcu_segcblist_empty(&rtpcp->cblist) &&
!WARN_ON_ONCE(!rtp->lazy_jiffies))

I've done tests like this:

1. runqemu nographic kvm slirp qemuparams="-smp 4 -m 2048M -drive
file=$PWD/share.img,if=virtio"
bootparams="rcupdate.rcu_tasks_trace_lazy_ms=0" -d

2.  insmod torture.ko
     insmod rcutorture.ko torture_type=tasks-tracing fwd_progress=4

3. bpftrace -e 't:timer:timer_expire_entry /args->function ==
kaddr("call_rcu_tasks_generic_timer")/
                                            {
printf("comm:%s,cpu:%d,stack:%s,func:%s\n", comm, cpu, kstack,
ksym(args->function)); }'

The call_rcu_tasks_generic_timer() has never been executed.

Thanks
Zqiang


>
>                                                 Thanx, Paul
>
> >               if (!rtpcp->urgent_gp)
> >                       rtpcp->urgent_gp = 1;
> >               needwake = true;
> > --
> > 2.17.1
> >

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ