Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
a7ec0168
Commit
a7ec0168
authored
Nov 08, 2002
by
Chuck Lever
Committed by
Linus Torvalds
Nov 08, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] fix jiffies wrap in new RPC RTO estimator
the new RPC RTO estimator has some jiffies wrap problems.
parent
44a15afe
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
15 deletions
+18
-15
include/linux/sunrpc/timer.h
include/linux/sunrpc/timer.h
+5
-5
include/linux/sunrpc/xprt.h
include/linux/sunrpc/xprt.h
+1
-1
net/sunrpc/timer.c
net/sunrpc/timer.c
+12
-9
No files found.
include/linux/sunrpc/timer.h
View file @
a7ec0168
...
...
@@ -12,16 +12,16 @@
#include <asm/atomic.h>
struct
rpc_rtt
{
long
timeo
;
/* default timeout value */
long
srtt
[
5
];
/* smoothed round trip time << 3 */
long
sdrtt
[
5
];
/* s
oothed medium deviation of RTT */
unsigned
long
timeo
;
/* default timeout value */
unsigned
long
srtt
[
5
];
/* smoothed round trip time << 3 */
unsigned
long
sdrtt
[
5
];
/* sm
oothed medium deviation of RTT */
atomic_t
ntimeouts
;
/* Global count of the number of timeouts */
};
extern
void
rpc_init_rtt
(
struct
rpc_rtt
*
rt
,
long
timeo
);
extern
void
rpc_init_rtt
(
struct
rpc_rtt
*
rt
,
unsigned
long
timeo
);
extern
void
rpc_update_rtt
(
struct
rpc_rtt
*
rt
,
int
timer
,
long
m
);
extern
long
rpc_calc_rto
(
struct
rpc_rtt
*
rt
,
int
timer
);
extern
unsigned
long
rpc_calc_rto
(
struct
rpc_rtt
*
rt
,
int
timer
);
static
inline
void
rpc_inc_timeo
(
struct
rpc_rtt
*
rt
)
{
...
...
include/linux/sunrpc/xprt.h
View file @
a7ec0168
...
...
@@ -109,7 +109,7 @@ struct rpc_rqst {
u32
rq_bytes_sent
;
/* Bytes we have sent */
long
rq_xtime
;
/* when transmitted */
unsigned
long
rq_xtime
;
/* when transmitted */
int
rq_ntimeo
;
int
rq_nresend
;
};
...
...
net/sunrpc/timer.c
View file @
a7ec0168
...
...
@@ -11,15 +11,15 @@
#define RPC_RTO_MIN (2)
void
rpc_init_rtt
(
struct
rpc_rtt
*
rt
,
long
timeo
)
rpc_init_rtt
(
struct
rpc_rtt
*
rt
,
unsigned
long
timeo
)
{
long
t
=
(
timeo
-
RPC_RTO_INIT
)
<<
3
;
int
i
;
unsigned
long
init
=
0
;
unsigned
i
;
rt
->
timeo
=
timeo
;
if
(
t
<
0
)
t
=
0
;
if
(
t
imeo
>
RPC_RTO_INIT
)
init
=
(
timeo
-
RPC_RTO_INIT
)
<<
3
;
for
(
i
=
0
;
i
<
5
;
i
++
)
{
rt
->
srtt
[
i
]
=
t
;
rt
->
srtt
[
i
]
=
ini
t
;
rt
->
sdrtt
[
i
]
=
RPC_RTO_INIT
;
}
atomic_set
(
&
rt
->
ntimeouts
,
0
);
...
...
@@ -28,11 +28,14 @@ rpc_init_rtt(struct rpc_rtt *rt, long timeo)
void
rpc_update_rtt
(
struct
rpc_rtt
*
rt
,
int
timer
,
long
m
)
{
long
*
srtt
,
*
sdrtt
;
unsigned
long
*
srtt
,
*
sdrtt
;
if
(
timer
--
==
0
)
return
;
/* jiffies wrapped; ignore this one */
if
(
m
<
0
)
return
;
if
(
m
==
0
)
m
=
1
;
srtt
=
&
rt
->
srtt
[
timer
];
...
...
@@ -61,10 +64,10 @@ rpc_update_rtt(struct rpc_rtt *rt, int timer, long m)
* other - timeo
*/
long
unsigned
long
rpc_calc_rto
(
struct
rpc_rtt
*
rt
,
int
timer
)
{
long
res
;
unsigned
long
res
;
if
(
timer
--
==
0
)
return
rt
->
timeo
;
res
=
(
rt
->
srtt
[
timer
]
>>
3
)
+
rt
->
sdrtt
[
timer
];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment