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
6445be80
Commit
6445be80
authored
May 08, 2002
by
Robert Olsson
Committed by
David S. Miller
May 08, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
IPV4: Add statistics for route cache GC monitoring.
parent
e53dd853
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
3 deletions
+21
-3
include/net/route.h
include/net/route.h
+4
-0
net/ipv4/route.c
net/ipv4/route.c
+17
-3
No files found.
include/net/route.h
View file @
6445be80
...
...
@@ -110,6 +110,10 @@ struct rt_cache_stat
unsigned
int
out_hit
;
unsigned
int
out_slow_tot
;
unsigned
int
out_slow_mc
;
unsigned
int
gc_total
;
unsigned
int
gc_ignored
;
unsigned
int
gc_goal_miss
;
unsigned
int
gc_dst_overflow
;
}
____cacheline_aligned_in_smp
;
extern
struct
ip_rt_acct
*
ip_rt_acct
;
...
...
net/ipv4/route.c
View file @
6445be80
...
...
@@ -286,7 +286,7 @@ static int rt_cache_stat_get_info(char *buffer, char **start, off_t offset, int
for
(
lcpu
=
0
;
lcpu
<
smp_num_cpus
;
lcpu
++
)
{
i
=
cpu_logical_map
(
lcpu
);
len
+=
sprintf
(
buffer
+
len
,
"%08x %08x %08x %08x %08x %08x %08x %08x %08x %08x %08x
\n
"
,
len
+=
sprintf
(
buffer
+
len
,
"%08x %08x %08x %08x %08x %08x %08x %08x %08x %08x %08x
%08x %08x %08x %08x
\n
"
,
dst_entries
,
rt_cache_stat
[
i
].
in_hit
,
rt_cache_stat
[
i
].
in_slow_tot
,
...
...
@@ -298,7 +298,13 @@ static int rt_cache_stat_get_info(char *buffer, char **start, off_t offset, int
rt_cache_stat
[
i
].
out_hit
,
rt_cache_stat
[
i
].
out_slow_tot
,
rt_cache_stat
[
i
].
out_slow_mc
rt_cache_stat
[
i
].
out_slow_mc
,
rt_cache_stat
[
i
].
gc_total
,
rt_cache_stat
[
i
].
gc_ignored
,
rt_cache_stat
[
i
].
gc_goal_miss
,
rt_cache_stat
[
i
].
gc_dst_overflow
);
}
len
-=
offset
;
...
...
@@ -499,9 +505,14 @@ static int rt_garbage_collect(void)
* Garbage collection is pretty expensive,
* do not make it too frequently.
*/
rt_cache_stat
[
smp_processor_id
()].
gc_total
++
;
if
(
now
-
last_gc
<
ip_rt_gc_min_interval
&&
atomic_read
(
&
ipv4_dst_ops
.
entries
)
<
ip_rt_max_size
)
atomic_read
(
&
ipv4_dst_ops
.
entries
)
<
ip_rt_max_size
)
{
rt_cache_stat
[
smp_processor_id
()].
gc_ignored
++
;
goto
out
;
}
/* Calculate number of entries, which we want to expire now. */
goal
=
atomic_read
(
&
ipv4_dst_ops
.
entries
)
-
...
...
@@ -567,6 +578,8 @@ static int rt_garbage_collect(void)
We will not spin here for long time in any case.
*/
rt_cache_stat
[
smp_processor_id
()].
gc_goal_miss
++
;
if
(
expire
==
0
)
break
;
...
...
@@ -584,6 +597,7 @@ static int rt_garbage_collect(void)
goto
out
;
if
(
net_ratelimit
())
printk
(
KERN_WARNING
"dst cache overflow
\n
"
);
rt_cache_stat
[
smp_processor_id
()].
gc_dst_overflow
++
;
return
1
;
work_done:
...
...
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