From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: David Howells <dhowells@redhat.com>, netdev@vger.kernel.org
Cc: linux-afs@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next 08/15] rxrpc: Fix call timer
Date: Fri, 23 Sep 2016 21:04:31 +0300 [thread overview]
Message-ID: <9efafc3e-5f19-598c-ee0c-def748eeb78a@cogentembedded.com> (raw)
In-Reply-To: <147464377267.5090.12222734463447533990.stgit@warthog.procyon.org.uk>
On 09/23/2016 06:16 PM, David Howells wrote:
> Fix the call timer in the following ways:
>
> (1) If call->resend_at or call->ack_at are before or equal to the current
> time, then ignore that timeout.
>
> (2) If call->expire_at is before or equal to the current time, then don't
> set the timer at all (possibly we should queue the call).
>
> (3) Don't skip modifying the timer if timer_pending() is true. This
> indicates that the timer is working, not that it has expired and is
> running/waiting to run its expiry handler.
>
> Also call rxrpc_set_timer() to start the call timer going rather than
> calling add_timer().
>
> Signed-off-by: David Howells <dhowells@redhat.com>
> ---
>
> net/rxrpc/call_event.c | 25 ++++++++++++++-----------
> net/rxrpc/call_object.c | 4 ++--
> 2 files changed, 16 insertions(+), 13 deletions(-)
>
> diff --git a/net/rxrpc/call_event.c b/net/rxrpc/call_event.c
> index 3a7f90a2659c..8bc5c8e37ab4 100644
> --- a/net/rxrpc/call_event.c
> +++ b/net/rxrpc/call_event.c
> @@ -28,24 +28,27 @@ void rxrpc_set_timer(struct rxrpc_call *call)
> {
> unsigned long t, now = jiffies;
>
> - _enter("{%ld,%ld,%ld:%ld}",
> - call->ack_at - now, call->resend_at - now, call->expire_at - now,
> - call->timer.expires - now);
> -
> read_lock_bh(&call->state_lock);
>
> if (call->state < RXRPC_CALL_COMPLETE) {
> - t = call->ack_at;
> - if (time_before(call->resend_at, t))
> + t = call->expire_at;
> + if (time_before_eq(t, now))
> + goto out;
> +
> + if (time_after(call->resend_at, now) &&
> + time_before(call->resend_at, t))
> t = call->resend_at;
> - if (time_before(call->expire_at, t))
> - t = call->expire_at;
> - if (!timer_pending(&call->timer) ||
> - time_before(t, call->timer.expires)) {
> - _debug("set timer %ld", t - now);
> +
> + if (time_after(call->ack_at, now) &&
> + time_before(call->ack_at, t))
> + t = call->ack_at;
> +
> + if (call->timer.expires != t || !timer_pending(&call->timer)) {
> mod_timer(&call->timer, t);
> }
CodingStyle: {} not needed now.
[...]
MBR, Sergei
next prev parent reply other threads:[~2016-09-23 18:04 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-23 15:15 [PATCH net-next 00/15] rxrpc: Bug fixes and tracepoints David Howells
2016-09-23 15:15 ` [PATCH net-next 01/15] rxrpc: Preset timestamp on Tx sk_buffs David Howells
2016-09-23 15:15 ` [PATCH net-next 02/15] rxrpc: Don't send an ACK at the end of service call response transmission David Howells
2016-09-23 15:15 ` [PATCH net-next 03/15] rxrpc: Make sure sendmsg() is woken on call completion David Howells
2016-09-23 15:15 ` [PATCH net-next 04/15] rxrpc: Should be using ktime_add_ms() not ktime_add_ns() David Howells
2016-09-23 15:15 ` [PATCH net-next 05/15] rxrpc: Use before_eq() and friends to compare serial numbers David Howells
2016-09-23 15:15 ` [PATCH net-next 06/15] rxrpc: Need to start the resend timer on initial transmission David Howells
2016-09-23 15:16 ` [PATCH net-next 07/15] rxrpc: Fix accidental cancellation of scheduled resend by ACK parser David Howells
2016-09-23 18:02 ` Sergei Shtylyov
2016-09-23 18:20 ` David Howells
2016-09-23 15:16 ` [PATCH net-next 08/15] rxrpc: Fix call timer David Howells
2016-09-23 18:04 ` Sergei Shtylyov [this message]
2016-09-23 18:21 ` David Howells
2016-09-23 15:16 ` [PATCH net-next 09/15] rxrpc: Pass the last Tx packet marker in the annotation buffer David Howells
2016-09-23 15:16 ` [PATCH net-next 10/15] rxrpc: Don't call the tx_ack tracepoint if don't generate an ACK David Howells
2016-09-23 15:16 ` [PATCH net-next 11/15] rxrpc: Add a tracepoint for the call timer David Howells
2016-09-23 15:16 ` [PATCH net-next 12/15] rxrpc: Add data Tx tracepoint and adjust Tx ACK tracepoint David Howells
2016-09-23 15:16 ` [PATCH net-next 13/15] rxrpc: Add a tracepoint to log injected Rx packet loss David Howells
2016-09-23 15:16 ` [PATCH net-next 14/15] rxrpc: Add tracepoint for ACK proposal David Howells
2016-09-23 15:17 ` [PATCH net-next 15/15] rxrpc: Add a tracepoint to log which packets will be retransmitted David Howells
2016-09-24 12:24 ` [PATCH net-next 00/15] rxrpc: Bug fixes and tracepoints David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9efafc3e-5f19-598c-ee0c-def748eeb78a@cogentembedded.com \
--to=sergei.shtylyov@cogentembedded.com \
--cc=dhowells@redhat.com \
--cc=linux-afs@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).