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
nexedi
linux
Commits
077813d7
Commit
077813d7
authored
Feb 13, 2004
by
Wensong Zhang
Committed by
David S. Miller
Feb 13, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[IPVS] retry to run kernel_thread when memory is temporarily exhausted
parent
cdcb596b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
8 deletions
+21
-8
net/ipv4/ipvs/ip_vs_sync.c
net/ipv4/ipvs/ip_vs_sync.c
+21
-8
No files found.
net/ipv4/ipvs/ip_vs_sync.c
View file @
077813d7
...
...
@@ -618,8 +618,6 @@ ip_vs_receive(struct socket *sock, char *buffer, const size_t buflen)
}
static
int
errno
;
static
DECLARE_WAIT_QUEUE_HEAD
(
sync_wait
);
static
pid_t
sync_master_pid
=
0
;
static
pid_t
sync_backup_pid
=
0
;
...
...
@@ -766,10 +764,10 @@ static int sync_thread(void *startup)
if
(
ip_vs_sync_state
&
IP_VS_STATE_MASTER
&&
!
sync_master_pid
)
{
state
=
IP_VS_STATE_MASTER
;
name
=
"ipvs
syncmaster"
;
name
=
"ipvs
_
syncmaster"
;
}
else
if
(
ip_vs_sync_state
&
IP_VS_STATE_BACKUP
&&
!
sync_backup_pid
)
{
state
=
IP_VS_STATE_BACKUP
;
name
=
"ipvs
syncbackup"
;
name
=
"ipvs
_
syncbackup"
;
}
else
{
IP_VS_BUG
();
ip_vs_use_count_dec
();
...
...
@@ -827,10 +825,19 @@ static int sync_thread(void *startup)
static
int
fork_sync_thread
(
void
*
startup
)
{
pid_t
pid
;
/* fork the sync thread here, then the parent process of the
sync thread is the init process after this thread exits. */
if
(
kernel_thread
(
sync_thread
,
startup
,
0
)
<
0
)
IP_VS_BUG
();
repeat:
if
((
pid
=
kernel_thread
(
sync_thread
,
startup
,
0
))
<
0
)
{
IP_VS_ERR
(
"could not create sync_thread due to %d... "
"retrying.
\n
"
,
pid
);
current
->
state
=
TASK_UNINTERRUPTIBLE
;
schedule_timeout
(
HZ
);
goto
repeat
;
}
return
0
;
}
...
...
@@ -857,8 +864,14 @@ int start_sync_thread(int state, char *mcast_ifn, __u8 syncid)
ip_vs_backup_syncid
=
syncid
;
}
if
((
pid
=
kernel_thread
(
fork_sync_thread
,
&
startup
,
0
))
<
0
)
IP_VS_BUG
();
repeat:
if
((
pid
=
kernel_thread
(
fork_sync_thread
,
&
startup
,
0
))
<
0
)
{
IP_VS_ERR
(
"could not create fork_sync_thread due to %d... "
"retrying.
\n
"
,
pid
);
current
->
state
=
TASK_UNINTERRUPTIBLE
;
schedule_timeout
(
HZ
);
goto
repeat
;
}
wait_for_completion
(
&
startup
);
...
...
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