* [PATCH 1/2] srcu: Prevent sdp->srcu_gp_seq_needed_exp counter wrap
@ 2018-01-31 19:39 Ildar Ismagilov
2018-02-03 9:16 ` Paul E. McKenney
0 siblings, 1 reply; 3+ messages in thread
From: Ildar Ismagilov @ 2018-01-31 19:39 UTC (permalink / raw)
Cc: devix84, Paul E. McKenney, Josh Triplett, Steven Rostedt,
Mathieu Desnoyers, Lai Jiangshan, linux-kernel
Signed-off-by: Ildar Ismagilov <devix84@gmail.com>
---
kernel/rcu/srcutree.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/kernel/rcu/srcutree.c b/kernel/rcu/srcutree.c
index 1798d1aa60fa..c54617280245 100644
--- a/kernel/rcu/srcutree.c
+++ b/kernel/rcu/srcutree.c
@@ -552,6 +552,9 @@ static void srcu_gp_end(struct srcu_struct *sp)
if (ULONG_CMP_GE(gpseq,
sdp->srcu_gp_seq_needed + 100))
sdp->srcu_gp_seq_needed = gpseq;
+ if (ULONG_CMP_GE(gpseq,
+ sdp->srcu_gp_seq_needed_exp + 100))
+ sdp->srcu_gp_seq_needed_exp = gpseq;
raw_spin_unlock_irqrestore_rcu_node(sdp, flags);
}
}
--
2.11.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 1/2] srcu: Prevent sdp->srcu_gp_seq_needed_exp counter wrap
2018-01-31 19:39 [PATCH 1/2] srcu: Prevent sdp->srcu_gp_seq_needed_exp counter wrap Ildar Ismagilov
@ 2018-02-03 9:16 ` Paul E. McKenney
[not found] ` <CADCZxWdVnpjS7Xqs_-tJcxLRTONrEEh8yF32F=mZUNhyj8bBfw@mail.gmail.com>
0 siblings, 1 reply; 3+ messages in thread
From: Paul E. McKenney @ 2018-02-03 9:16 UTC (permalink / raw)
To: Ildar Ismagilov
Cc: Josh Triplett, Steven Rostedt, Mathieu Desnoyers, Lai Jiangshan,
linux-kernel
On Wed, Jan 31, 2018 at 10:39:53PM +0300, Ildar Ismagilov wrote:
> Signed-off-by: Ildar Ismagilov <devix84@gmail.com>
I did apply this for testing and review, thank you and good eyes!
However, I had to:
1. hand-edit it to make it work against the rcu/dev
branch of my -rcu tree:
git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git
2. fill out the commit logs.
Please see below for the updated patch, and please let me know if I
messed something up.
In the future, could you please apply your patches against the rcu/dev
branch of -rcu and provide more complete commit logs? The commit log
should describe the problem and how that problem is fixed.
Also, are you able to test these using rcutorture? If not, let's get you
set up for that, as I am prone to testing backlogs just now. Plus I am
writing this while 34,000 feet over Western Australia. So it would mean
fewer delays for you if you could test your own patches. ;-)
Thanx, Paul
------------------------------------------------------------------------
commit 753abb606ba61012c8838c73e2c888aea20efe13
Author: Ildar Ismagilov <devix84@gmail.com>
Date: Wed Jan 31 22:39:53 2018 +0300
srcu: Prevent sdp->srcu_gp_seq_needed_exp counter wrap
SRCU checks each srcu_data structure's grace-period number for counter
wrap four times per cycle by default. This frequency guarantees that
normal comparisons will detect potential wrap. However, the expedited
grace-period number is not checked. The consquences are not too horrible
(a failure to expedite a grace period when requested), but it would be
good to avoid such things. This commit therefore adds this check to
the expedited grace-period number.
Signed-off-by: Ildar Ismagilov <devix84@gmail.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
diff --git a/kernel/rcu/srcutree.c b/kernel/rcu/srcutree.c
index 2878387d4189..ad3e1aa5e6ea 100644
--- a/kernel/rcu/srcutree.c
+++ b/kernel/rcu/srcutree.c
@@ -579,6 +579,9 @@ static void srcu_gp_end(struct srcu_struct *sp)
if (ULONG_CMP_GE(gpseq,
sdp->srcu_gp_seq_needed + 100))
sdp->srcu_gp_seq_needed = gpseq;
+ if (ULONG_CMP_GE(gpseq,
+ sdp->srcu_gp_seq_needed_exp + 100))
+ sdp->srcu_gp_seq_needed_exp = gpseq;
spin_unlock_irqrestore_rcu_node(sdp, flags);
}
}
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 1/2] srcu: Prevent sdp->srcu_gp_seq_needed_exp counter wrap
[not found] ` <CADCZxWdVnpjS7Xqs_-tJcxLRTONrEEh8yF32F=mZUNhyj8bBfw@mail.gmail.com>
@ 2018-02-09 12:31 ` Paul E. McKenney
0 siblings, 0 replies; 3+ messages in thread
From: Paul E. McKenney @ 2018-02-09 12:31 UTC (permalink / raw)
To: Ildar Ismagilov
Cc: Josh Triplett, Steven Rostedt, Mathieu Desnoyers, Lai Jiangshan,
linux-kernel
On Tue, Feb 06, 2018 at 01:44:10PM +0300, Ildar Ismagilov wrote:
> The results of rcutorture tests in attachment. I only tested: SRCU-N,
> SRCU-P, SRCU-t and SRCU-u configs.
That is a good set for an SRUC change, thank you!
Thanx, Paul
> 2018-02-03 12:16 GMT+03:00 Paul E. McKenney <paulmck@linux.vnet.ibm.com>:
> > On Wed, Jan 31, 2018 at 10:39:53PM +0300, Ildar Ismagilov wrote:
> >> Signed-off-by: Ildar Ismagilov <devix84@gmail.com>
> >
> > I did apply this for testing and review, thank you and good eyes!
> >
> > However, I had to:
> >
> > 1. hand-edit it to make it work against the rcu/dev
> > branch of my -rcu tree:
> > git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git
> >
> > 2. fill out the commit logs.
> >
> > Please see below for the updated patch, and please let me know if I
> > messed something up.
> >
> > In the future, could you please apply your patches against the rcu/dev
> > branch of -rcu and provide more complete commit logs? The commit log
> > should describe the problem and how that problem is fixed.
> >
> > Also, are you able to test these using rcutorture? If not, let's get you
> > set up for that, as I am prone to testing backlogs just now. Plus I am
> > writing this while 34,000 feet over Western Australia. So it would mean
> > fewer delays for you if you could test your own patches. ;-)
> >
> > Thanx, Paul
> >
> > ------------------------------------------------------------------------
> >
> > commit 753abb606ba61012c8838c73e2c888aea20efe13
> > Author: Ildar Ismagilov <devix84@gmail.com>
> > Date: Wed Jan 31 22:39:53 2018 +0300
> >
> > srcu: Prevent sdp->srcu_gp_seq_needed_exp counter wrap
> >
> > SRCU checks each srcu_data structure's grace-period number for counter
> > wrap four times per cycle by default. This frequency guarantees that
> > normal comparisons will detect potential wrap. However, the expedited
> > grace-period number is not checked. The consquences are not too horrible
> > (a failure to expedite a grace period when requested), but it would be
> > good to avoid such things. This commit therefore adds this check to
> > the expedited grace-period number.
> >
> > Signed-off-by: Ildar Ismagilov <devix84@gmail.com>
> > Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> >
> > diff --git a/kernel/rcu/srcutree.c b/kernel/rcu/srcutree.c
> > index 2878387d4189..ad3e1aa5e6ea 100644
> > --- a/kernel/rcu/srcutree.c
> > +++ b/kernel/rcu/srcutree.c
> > @@ -579,6 +579,9 @@ static void srcu_gp_end(struct srcu_struct *sp)
> > if (ULONG_CMP_GE(gpseq,
> > sdp->srcu_gp_seq_needed + 100))
> > sdp->srcu_gp_seq_needed = gpseq;
> > + if (ULONG_CMP_GE(gpseq,
> > + sdp->srcu_gp_seq_needed_exp + 100))
> > + sdp->srcu_gp_seq_needed_exp = gpseq;
> > spin_unlock_irqrestore_rcu_node(sdp, flags);
> > }
> > }
> >
>
>
>
> --
> Best regards
> Ildar
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-02-09 12:31 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-31 19:39 [PATCH 1/2] srcu: Prevent sdp->srcu_gp_seq_needed_exp counter wrap Ildar Ismagilov
2018-02-03 9:16 ` Paul E. McKenney
[not found] ` <CADCZxWdVnpjS7Xqs_-tJcxLRTONrEEh8yF32F=mZUNhyj8bBfw@mail.gmail.com>
2018-02-09 12:31 ` Paul E. McKenney
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).