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
12414d6e
Commit
12414d6e
authored
Feb 27, 2004
by
David S. Miller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[TCP]: Restart tw bucket scan when lock is dropped, noticed by Olof Johansson.
parent
26d5aa5a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
5 deletions
+16
-5
include/net/tcp.h
include/net/tcp.h
+4
-1
net/ipv4/tcp_minisocks.c
net/ipv4/tcp_minisocks.c
+12
-4
No files found.
include/net/tcp.h
View file @
12414d6e
...
...
@@ -263,7 +263,10 @@ static __inline__ int tw_del_dead_node(struct tcp_tw_bucket *tw)
#define tw_for_each(tw, node, head) \
hlist_for_each_entry(tw, node, head, tw_node)
#define tw_for_each_inmate(tw, node, safe, jail) \
#define tw_for_each_inmate(tw, node, jail) \
hlist_for_each_entry(tw, node, jail, tw_death_node)
#define tw_for_each_inmate_safe(tw, node, safe, jail) \
hlist_for_each_entry_safe(tw, node, safe, jail, tw_death_node)
#define tcptw_sk(__sk) ((struct tcp_tw_bucket *)(__sk))
...
...
net/ipv4/tcp_minisocks.c
View file @
12414d6e
...
...
@@ -427,7 +427,7 @@ static u32 twkill_thread_slots;
static
int
tcp_do_twkill_work
(
int
slot
,
unsigned
int
quota
)
{
struct
tcp_tw_bucket
*
tw
;
struct
hlist_node
*
node
,
*
safe
;
struct
hlist_node
*
node
;
unsigned
int
killed
;
int
ret
;
...
...
@@ -439,8 +439,8 @@ static int tcp_do_twkill_work(int slot, unsigned int quota)
*/
killed
=
0
;
ret
=
0
;
tw_for_each_inmate
(
tw
,
node
,
safe
,
&
tcp_tw_death_row
[
slot
])
{
rescan:
tw_for_each_inmate
(
tw
,
node
,
&
tcp_tw_death_row
[
slot
])
{
__tw_del_dead_node
(
tw
);
spin_unlock
(
&
tw_death_lock
);
tcp_timewait_kill
(
tw
);
...
...
@@ -451,6 +451,14 @@ static int tcp_do_twkill_work(int slot, unsigned int quota)
ret
=
1
;
break
;
}
/* While we dropped tw_death_lock, another cpu may have
* killed off the next TW bucket in the list, therefore
* do a fresh re-read of the hlist head node with the
* lock reacquired. We still use the hlist traversal
* macro in order to get the prefetches.
*/
goto
rescan
;
}
tcp_tw_count
-=
killed
;
...
...
@@ -637,7 +645,7 @@ void tcp_twcal_tick(unsigned long dummy)
struct
hlist_node
*
node
,
*
safe
;
struct
tcp_tw_bucket
*
tw
;
tw_for_each_inmate
(
tw
,
node
,
safe
,
tw_for_each_inmate
_safe
(
tw
,
node
,
safe
,
&
tcp_twcal_row
[
slot
])
{
__tw_del_dead_node
(
tw
);
tcp_timewait_kill
(
tw
);
...
...
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