* [PATCH net-next] xfrm: Make xfrm_state timer monotonic
@ 2013-08-06 6:57 Fan Du
2013-08-06 9:22 ` Steffen Klassert
0 siblings, 1 reply; 7+ messages in thread
From: Fan Du @ 2013-08-06 6:57 UTC (permalink / raw)
To: steffen.klassert; +Cc: davem, netdev
xfrm_state timer should be independent of system clock change,
so switch to monotonic clock base.
Signed-off-by: Fan Du <fan.du@windriver.com>
---
net/xfrm/xfrm_state.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
index 78f66fa..e57ab07 100644
--- a/net/xfrm/xfrm_state.c
+++ b/net/xfrm/xfrm_state.c
@@ -499,7 +499,7 @@ struct xfrm_state *xfrm_state_alloc(struct net *net)
INIT_HLIST_NODE(&x->bydst);
INIT_HLIST_NODE(&x->bysrc);
INIT_HLIST_NODE(&x->byspi);
- tasklet_hrtimer_init(&x->mtimer, xfrm_timer_handler, CLOCK_REALTIME, HRTIMER_MODE_ABS);
+ tasklet_hrtimer_init(&x->mtimer, xfrm_timer_handler, CLOCK_MONOTONIC, HRTIMER_MODE_ABS);
setup_timer(&x->rtimer, xfrm_replay_timer_handler,
(unsigned long)x);
x->curlft.add_time = get_seconds();
--
1.7.9.5
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH net-next] xfrm: Make xfrm_state timer monotonic
2013-08-06 6:57 [PATCH net-next] xfrm: Make xfrm_state timer monotonic Fan Du
@ 2013-08-06 9:22 ` Steffen Klassert
2013-08-12 5:40 ` [PATCHv2 " Fan Du
0 siblings, 1 reply; 7+ messages in thread
From: Steffen Klassert @ 2013-08-06 9:22 UTC (permalink / raw)
To: Fan Du; +Cc: davem, netdev
On Tue, Aug 06, 2013 at 02:57:05PM +0800, Fan Du wrote:
> xfrm_state timer should be independent of system clock change,
> so switch to monotonic clock base.
>
I think a monotonic timer will reintroduce a bug on suspend/resume
that was fixed by commit 9e0d57fd6
(xfrm: SAD entries do not expire correctly after suspend-resume)
Please make sure that this does not happen.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCHv2 net-next] xfrm: Make xfrm_state timer monotonic
2013-08-06 9:22 ` Steffen Klassert
@ 2013-08-12 5:40 ` Fan Du
2013-08-13 7:55 ` Steffen Klassert
2013-08-14 11:34 ` Steffen Klassert
0 siblings, 2 replies; 7+ messages in thread
From: Fan Du @ 2013-08-12 5:40 UTC (permalink / raw)
To: Steffen Klassert; +Cc: davem, netdev
On 2013年08月06日 17:22, Steffen Klassert wrote:
> On Tue, Aug 06, 2013 at 02:57:05PM +0800, Fan Du wrote:
>> xfrm_state timer should be independent of system clock change,
>> so switch to monotonic clock base.
>>
>
> I think a monotonic timer will reintroduce a bug on suspend/resume
> that was fixed by commit 9e0d57fd6
> (xfrm: SAD entries do not expire correctly after suspend-resume)
>
> Please make sure that this does not happen.
What about using CLOCK_BOOTTIME? it's monotonic, but includes suspend time as well.
From 1dae5a22c203224ee46e2a2f95b569a04b74117b Mon Sep 17 00:00:00 2001
From: Fan Du <fan.du@windriver.com>
Date: Mon, 12 Aug 2013 13:33:45 +0800
Subject: [PATCHv2 net-next] xfrm: Make xfrm_state timer monotonic
xfrm_state timer should be independent of system clock change,
so switch to CLOCK_BOOTTIME base which is not only monotonic but
also counting suspend time.
Signed-off-by: Fan Du <fan.du@windriver.com>
---
net/xfrm/xfrm_state.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
index 78f66fa..1df4436 100644
--- a/net/xfrm/xfrm_state.c
+++ b/net/xfrm/xfrm_state.c
@@ -499,7 +499,7 @@ struct xfrm_state *xfrm_state_alloc(struct net *net)
INIT_HLIST_NODE(&x->bydst);
INIT_HLIST_NODE(&x->bysrc);
INIT_HLIST_NODE(&x->byspi);
- tasklet_hrtimer_init(&x->mtimer, xfrm_timer_handler, CLOCK_REALTIME, HRTIMER_MODE_ABS);
+ tasklet_hrtimer_init(&x->mtimer, xfrm_timer_handler, CLOCK_BOOTTIME, HRTIMER_MODE_ABS);
setup_timer(&x->rtimer, xfrm_replay_timer_handler,
(unsigned long)x);
x->curlft.add_time = get_seconds();
--
1.7.9.5
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
--
浮沉随浪只记今朝笑
--fan
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCHv2 net-next] xfrm: Make xfrm_state timer monotonic
2013-08-12 5:40 ` [PATCHv2 " Fan Du
@ 2013-08-13 7:55 ` Steffen Klassert
2013-08-13 8:37 ` Fan Du
2013-08-14 11:34 ` Steffen Klassert
1 sibling, 1 reply; 7+ messages in thread
From: Steffen Klassert @ 2013-08-13 7:55 UTC (permalink / raw)
To: Fan Du; +Cc: davem, netdev
On Mon, Aug 12, 2013 at 01:40:07PM +0800, Fan Du wrote:
>
>
> On 2013年08月06日 17:22, Steffen Klassert wrote:
> >On Tue, Aug 06, 2013 at 02:57:05PM +0800, Fan Du wrote:
> >>xfrm_state timer should be independent of system clock change,
> >>so switch to monotonic clock base.
> >>
> >
> >I think a monotonic timer will reintroduce a bug on suspend/resume
> >that was fixed by commit 9e0d57fd6
> >(xfrm: SAD entries do not expire correctly after suspend-resume)
> >
> >Please make sure that this does not happen.
>
> What about using CLOCK_BOOTTIME? it's monotonic, but includes suspend time as well.
As I said, I'm open to everything that fixes your problem and does not
introduce a regression. I'll consider applying after some testing
if noone else has objections.
Thanks!
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCHv2 net-next] xfrm: Make xfrm_state timer monotonic
2013-08-13 7:55 ` Steffen Klassert
@ 2013-08-13 8:37 ` Fan Du
2013-08-13 10:59 ` Steffen Klassert
0 siblings, 1 reply; 7+ messages in thread
From: Fan Du @ 2013-08-13 8:37 UTC (permalink / raw)
To: Steffen Klassert; +Cc: davem, netdev
On 2013年08月13日 15:55, Steffen Klassert wrote:
> On Mon, Aug 12, 2013 at 01:40:07PM +0800, Fan Du wrote:
>>
>>
>> On 2013年08月06日 17:22, Steffen Klassert wrote:
>>> On Tue, Aug 06, 2013 at 02:57:05PM +0800, Fan Du wrote:
>>>> xfrm_state timer should be independent of system clock change,
>>>> so switch to monotonic clock base.
>>>>
>>>
>>> I think a monotonic timer will reintroduce a bug on suspend/resume
>>> that was fixed by commit 9e0d57fd6
>>> (xfrm: SAD entries do not expire correctly after suspend-resume)
>>>
>>> Please make sure that this does not happen.
>>
>> What about using CLOCK_BOOTTIME? it's monotonic, but includes suspend time as well.
>
> As I said, I'm open to everything that fixes your problem and does not
> introduce a regression. I'll consider applying after some testing
> if noone else has objections.
Hi, Steffen
Thanks for your understanding! :)
I happened to bump into CLOCK_BOOTTIME several days ago, so apologize for
eating my words earlier. Changing xfrm_state timer to monotonic does not
solve the problem I've described earlier in:
http://www.spinics.net/lists/netdev/msg245019.html (*1*)
So is there any light of hope for the proposal in (*1*) by using CLOCK_BOOTTIME
instead?
> Thanks!
>
>
--
浮沉随浪只记今朝笑
--fan
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCHv2 net-next] xfrm: Make xfrm_state timer monotonic
2013-08-13 8:37 ` Fan Du
@ 2013-08-13 10:59 ` Steffen Klassert
0 siblings, 0 replies; 7+ messages in thread
From: Steffen Klassert @ 2013-08-13 10:59 UTC (permalink / raw)
To: Fan Du; +Cc: davem, netdev
On Tue, Aug 13, 2013 at 04:37:04PM +0800, Fan Du wrote:
>
>
> On 2013年08月13日 15:55, Steffen Klassert wrote:
> >On Mon, Aug 12, 2013 at 01:40:07PM +0800, Fan Du wrote:
> >>
> >>
> >>On 2013年08月06日 17:22, Steffen Klassert wrote:
> >>>On Tue, Aug 06, 2013 at 02:57:05PM +0800, Fan Du wrote:
> >>>>xfrm_state timer should be independent of system clock change,
> >>>>so switch to monotonic clock base.
> >>>>
> >>>
> >>>I think a monotonic timer will reintroduce a bug on suspend/resume
> >>>that was fixed by commit 9e0d57fd6
> >>>(xfrm: SAD entries do not expire correctly after suspend-resume)
> >>>
> >>>Please make sure that this does not happen.
> >>
> >>What about using CLOCK_BOOTTIME? it's monotonic, but includes suspend time as well.
> >
> >As I said, I'm open to everything that fixes your problem and does not
> >introduce a regression. I'll consider applying after some testing
> >if noone else has objections.
>
> Hi, Steffen
>
> Thanks for your understanding! :)
>
> I happened to bump into CLOCK_BOOTTIME several days ago, so apologize for
> eating my words earlier. Changing xfrm_state timer to monotonic does not
> solve the problem I've described earlier in:
>
> http://www.spinics.net/lists/netdev/msg245019.html (*1*)
>
> So is there any light of hope for the proposal in (*1*) by using CLOCK_BOOTTIME
> instead?
>
Well, you have to convince David in the first place, as he is sitting
upstream from me ;)
Also, I think he is right with his complaint. Why not following the
clock_was_set approach you started with?
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCHv2 net-next] xfrm: Make xfrm_state timer monotonic
2013-08-12 5:40 ` [PATCHv2 " Fan Du
2013-08-13 7:55 ` Steffen Klassert
@ 2013-08-14 11:34 ` Steffen Klassert
1 sibling, 0 replies; 7+ messages in thread
From: Steffen Klassert @ 2013-08-14 11:34 UTC (permalink / raw)
To: Fan Du; +Cc: davem, netdev
On Mon, Aug 12, 2013 at 01:40:07PM +0800, Fan Du wrote:
>
>
> On 2013年08月06日 17:22, Steffen Klassert wrote:
> >On Tue, Aug 06, 2013 at 02:57:05PM +0800, Fan Du wrote:
> >>xfrm_state timer should be independent of system clock change,
> >>so switch to monotonic clock base.
> >>
> >
> >I think a monotonic timer will reintroduce a bug on suspend/resume
> >that was fixed by commit 9e0d57fd6
> >(xfrm: SAD entries do not expire correctly after suspend-resume)
> >
> >Please make sure that this does not happen.
>
> What about using CLOCK_BOOTTIME? it's monotonic, but includes suspend time as well.
>
>
> From 1dae5a22c203224ee46e2a2f95b569a04b74117b Mon Sep 17 00:00:00 2001
> From: Fan Du <fan.du@windriver.com>
> Date: Mon, 12 Aug 2013 13:33:45 +0800
> Subject: [PATCHv2 net-next] xfrm: Make xfrm_state timer monotonic
>
> xfrm_state timer should be independent of system clock change,
> so switch to CLOCK_BOOTTIME base which is not only monotonic but
> also counting suspend time.
>
> Signed-off-by: Fan Du <fan.du@windriver.com>
> ---
> net/xfrm/xfrm_state.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
> index 78f66fa..1df4436 100644
> --- a/net/xfrm/xfrm_state.c
> +++ b/net/xfrm/xfrm_state.c
> @@ -499,7 +499,7 @@ struct xfrm_state *xfrm_state_alloc(struct net *net)
> INIT_HLIST_NODE(&x->bydst);
> INIT_HLIST_NODE(&x->bysrc);
> INIT_HLIST_NODE(&x->byspi);
> - tasklet_hrtimer_init(&x->mtimer, xfrm_timer_handler, CLOCK_REALTIME, HRTIMER_MODE_ABS);
> + tasklet_hrtimer_init(&x->mtimer, xfrm_timer_handler, CLOCK_BOOTTIME, HRTIMER_MODE_ABS);
> setup_timer(&x->rtimer, xfrm_replay_timer_handler,
> (unsigned long)x);
> x->curlft.add_time = get_seconds();
This does not apply to my tree, looks like your patch is whitespace damaged.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2013-08-14 11:34 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-06 6:57 [PATCH net-next] xfrm: Make xfrm_state timer monotonic Fan Du
2013-08-06 9:22 ` Steffen Klassert
2013-08-12 5:40 ` [PATCHv2 " Fan Du
2013-08-13 7:55 ` Steffen Klassert
2013-08-13 8:37 ` Fan Du
2013-08-13 10:59 ` Steffen Klassert
2013-08-14 11:34 ` Steffen Klassert
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).