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
b172b819
Commit
b172b819
authored
Sep 29, 2003
by
Julian Anastasov
Committed by
David S. Miller
Sep 29, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[IPVS]: Use list_for_each_entry_continue in some schedulers.
parent
073fc1a8
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
24 additions
and
33 deletions
+24
-33
net/ipv4/ipvs/ip_vs_lblc.c
net/ipv4/ipvs/ip_vs_lblc.c
+5
-4
net/ipv4/ipvs/ip_vs_lblcr.c
net/ipv4/ipvs/ip_vs_lblcr.c
+5
-4
net/ipv4/ipvs/ip_vs_lc.c
net/ipv4/ipvs/ip_vs_lc.c
+4
-17
net/ipv4/ipvs/ip_vs_sed.c
net/ipv4/ipvs/ip_vs_sed.c
+5
-4
net/ipv4/ipvs/ip_vs_wlc.c
net/ipv4/ipvs/ip_vs_wlc.c
+5
-4
No files found.
net/ipv4/ipvs/ip_vs_lblc.c
View file @
b172b819
...
@@ -458,10 +458,11 @@ __ip_vs_wlc_schedule(struct ip_vs_service *svc, struct iphdr *iph)
...
@@ -458,10 +458,11 @@ __ip_vs_wlc_schedule(struct ip_vs_service *svc, struct iphdr *iph)
* The server with weight=0 is quiesced and will not receive any
* The server with weight=0 is quiesced and will not receive any
* new connection.
* new connection.
*/
*/
list_for_each_entry
(
lea
st
,
&
svc
->
destinations
,
n_list
)
{
list_for_each_entry
(
de
st
,
&
svc
->
destinations
,
n_list
)
{
if
(
lea
st
->
flags
&
IP_VS_DEST_F_OVERLOAD
)
if
(
de
st
->
flags
&
IP_VS_DEST_F_OVERLOAD
)
continue
;
continue
;
if
(
atomic_read
(
&
least
->
weight
)
>
0
)
{
if
(
atomic_read
(
&
dest
->
weight
)
>
0
)
{
least
=
dest
;
loh
=
atomic_read
(
&
least
->
activeconns
)
*
50
loh
=
atomic_read
(
&
least
->
activeconns
)
*
50
+
atomic_read
(
&
least
->
inactconns
);
+
atomic_read
(
&
least
->
inactconns
);
goto
nextstage
;
goto
nextstage
;
...
@@ -473,7 +474,7 @@ __ip_vs_wlc_schedule(struct ip_vs_service *svc, struct iphdr *iph)
...
@@ -473,7 +474,7 @@ __ip_vs_wlc_schedule(struct ip_vs_service *svc, struct iphdr *iph)
* Find the destination with the least load.
* Find the destination with the least load.
*/
*/
nextstage:
nextstage:
list_for_each_entry
(
dest
,
&
svc
->
destinations
,
n_list
)
{
list_for_each_entry
_continue
(
dest
,
&
svc
->
destinations
,
n_list
)
{
if
(
dest
->
flags
&
IP_VS_DEST_F_OVERLOAD
)
if
(
dest
->
flags
&
IP_VS_DEST_F_OVERLOAD
)
continue
;
continue
;
...
...
net/ipv4/ipvs/ip_vs_lblcr.c
View file @
b172b819
...
@@ -711,11 +711,12 @@ __ip_vs_wlc_schedule(struct ip_vs_service *svc, struct iphdr *iph)
...
@@ -711,11 +711,12 @@ __ip_vs_wlc_schedule(struct ip_vs_service *svc, struct iphdr *iph)
* The server with weight=0 is quiesced and will not receive any
* The server with weight=0 is quiesced and will not receive any
* new connection.
* new connection.
*/
*/
list_for_each_entry
(
lea
st
,
&
svc
->
destinations
,
n_list
)
{
list_for_each_entry
(
de
st
,
&
svc
->
destinations
,
n_list
)
{
if
(
lea
st
->
flags
&
IP_VS_DEST_F_OVERLOAD
)
if
(
de
st
->
flags
&
IP_VS_DEST_F_OVERLOAD
)
continue
;
continue
;
if
(
atomic_read
(
&
least
->
weight
)
>
0
)
{
if
(
atomic_read
(
&
dest
->
weight
)
>
0
)
{
least
=
dest
;
loh
=
atomic_read
(
&
least
->
activeconns
)
*
50
loh
=
atomic_read
(
&
least
->
activeconns
)
*
50
+
atomic_read
(
&
least
->
inactconns
);
+
atomic_read
(
&
least
->
inactconns
);
goto
nextstage
;
goto
nextstage
;
...
@@ -727,7 +728,7 @@ __ip_vs_wlc_schedule(struct ip_vs_service *svc, struct iphdr *iph)
...
@@ -727,7 +728,7 @@ __ip_vs_wlc_schedule(struct ip_vs_service *svc, struct iphdr *iph)
* Find the destination with the least load.
* Find the destination with the least load.
*/
*/
nextstage:
nextstage:
list_for_each_entry
(
dest
,
&
svc
->
destinations
,
n_list
)
{
list_for_each_entry
_continue
(
dest
,
&
svc
->
destinations
,
n_list
)
{
if
(
dest
->
flags
&
IP_VS_DEST_F_OVERLOAD
)
if
(
dest
->
flags
&
IP_VS_DEST_F_OVERLOAD
)
continue
;
continue
;
...
...
net/ipv4/ipvs/ip_vs_lc.c
View file @
b172b819
...
@@ -65,8 +65,8 @@ ip_vs_lc_dest_overhead(struct ip_vs_dest *dest)
...
@@ -65,8 +65,8 @@ ip_vs_lc_dest_overhead(struct ip_vs_dest *dest)
static
struct
ip_vs_dest
*
static
struct
ip_vs_dest
*
ip_vs_lc_schedule
(
struct
ip_vs_service
*
svc
,
struct
iphdr
*
iph
)
ip_vs_lc_schedule
(
struct
ip_vs_service
*
svc
,
struct
iphdr
*
iph
)
{
{
struct
ip_vs_dest
*
dest
,
*
least
;
struct
ip_vs_dest
*
dest
,
*
least
=
NULL
;
unsigned
int
loh
,
doh
;
unsigned
int
loh
=
0
,
doh
;
IP_VS_DBG
(
6
,
"ip_vs_lc_schedule(): Scheduling...
\n
"
);
IP_VS_DBG
(
6
,
"ip_vs_lc_schedule(): Scheduling...
\n
"
);
...
@@ -79,31 +79,18 @@ ip_vs_lc_schedule(struct ip_vs_service *svc, struct iphdr *iph)
...
@@ -79,31 +79,18 @@ ip_vs_lc_schedule(struct ip_vs_service *svc, struct iphdr *iph)
* served, but no new connection is assigned to the server.
* served, but no new connection is assigned to the server.
*/
*/
list_for_each_entry
(
least
,
&
svc
->
destinations
,
n_list
)
{
if
(
least
->
flags
&
IP_VS_DEST_F_OVERLOAD
)
continue
;
if
(
atomic_read
(
&
least
->
weight
)
>
0
)
{
loh
=
ip_vs_lc_dest_overhead
(
least
);
goto
nextstage
;
}
}
return
NULL
;
/*
* Find the destination with the least load.
*/
nextstage:
list_for_each_entry
(
dest
,
&
svc
->
destinations
,
n_list
)
{
list_for_each_entry
(
dest
,
&
svc
->
destinations
,
n_list
)
{
if
((
dest
->
flags
&
IP_VS_DEST_F_OVERLOAD
)
||
if
((
dest
->
flags
&
IP_VS_DEST_F_OVERLOAD
)
||
atomic_read
(
&
dest
->
weight
)
==
0
)
atomic_read
(
&
dest
->
weight
)
==
0
)
continue
;
continue
;
doh
=
ip_vs_lc_dest_overhead
(
dest
);
doh
=
ip_vs_lc_dest_overhead
(
dest
);
if
(
doh
<
loh
)
{
if
(
!
least
||
doh
<
loh
)
{
least
=
dest
;
least
=
dest
;
loh
=
doh
;
loh
=
doh
;
}
}
}
}
if
(
least
)
IP_VS_DBG
(
6
,
"LC: server %u.%u.%u.%u:%u activeconns %d inactconns %d
\n
"
,
IP_VS_DBG
(
6
,
"LC: server %u.%u.%u.%u:%u activeconns %d inactconns %d
\n
"
,
NIPQUAD
(
least
->
addr
),
ntohs
(
least
->
port
),
NIPQUAD
(
least
->
addr
),
ntohs
(
least
->
port
),
atomic_read
(
&
least
->
activeconns
),
atomic_read
(
&
least
->
activeconns
),
...
...
net/ipv4/ipvs/ip_vs_sed.c
View file @
b172b819
...
@@ -103,9 +103,10 @@ ip_vs_sed_schedule(struct ip_vs_service *svc, struct iphdr *iph)
...
@@ -103,9 +103,10 @@ ip_vs_sed_schedule(struct ip_vs_service *svc, struct iphdr *iph)
* new connections.
* new connections.
*/
*/
list_for_each_entry
(
least
,
&
svc
->
destinations
,
n_list
)
{
list_for_each_entry
(
dest
,
&
svc
->
destinations
,
n_list
)
{
if
(
!
(
least
->
flags
&
IP_VS_DEST_F_OVERLOAD
)
&&
if
(
!
(
dest
->
flags
&
IP_VS_DEST_F_OVERLOAD
)
&&
atomic_read
(
&
least
->
weight
)
>
0
)
{
atomic_read
(
&
dest
->
weight
)
>
0
)
{
least
=
dest
;
loh
=
ip_vs_sed_dest_overhead
(
least
);
loh
=
ip_vs_sed_dest_overhead
(
least
);
goto
nextstage
;
goto
nextstage
;
}
}
...
@@ -116,7 +117,7 @@ ip_vs_sed_schedule(struct ip_vs_service *svc, struct iphdr *iph)
...
@@ -116,7 +117,7 @@ ip_vs_sed_schedule(struct ip_vs_service *svc, struct iphdr *iph)
* Find the destination with the least load.
* Find the destination with the least load.
*/
*/
nextstage:
nextstage:
list_for_each_entry
(
dest
,
&
svc
->
destinations
,
n_list
)
{
list_for_each_entry
_continue
(
dest
,
&
svc
->
destinations
,
n_list
)
{
if
(
dest
->
flags
&
IP_VS_DEST_F_OVERLOAD
)
if
(
dest
->
flags
&
IP_VS_DEST_F_OVERLOAD
)
continue
;
continue
;
doh
=
ip_vs_sed_dest_overhead
(
dest
);
doh
=
ip_vs_sed_dest_overhead
(
dest
);
...
...
net/ipv4/ipvs/ip_vs_wlc.c
View file @
b172b819
...
@@ -91,9 +91,10 @@ ip_vs_wlc_schedule(struct ip_vs_service *svc, struct iphdr *iph)
...
@@ -91,9 +91,10 @@ ip_vs_wlc_schedule(struct ip_vs_service *svc, struct iphdr *iph)
* new connections.
* new connections.
*/
*/
list_for_each_entry
(
least
,
&
svc
->
destinations
,
n_list
)
{
list_for_each_entry
(
dest
,
&
svc
->
destinations
,
n_list
)
{
if
(
!
(
least
->
flags
&
IP_VS_DEST_F_OVERLOAD
)
&&
if
(
!
(
dest
->
flags
&
IP_VS_DEST_F_OVERLOAD
)
&&
atomic_read
(
&
least
->
weight
)
>
0
)
{
atomic_read
(
&
dest
->
weight
)
>
0
)
{
least
=
dest
;
loh
=
ip_vs_wlc_dest_overhead
(
least
);
loh
=
ip_vs_wlc_dest_overhead
(
least
);
goto
nextstage
;
goto
nextstage
;
}
}
...
@@ -104,7 +105,7 @@ ip_vs_wlc_schedule(struct ip_vs_service *svc, struct iphdr *iph)
...
@@ -104,7 +105,7 @@ ip_vs_wlc_schedule(struct ip_vs_service *svc, struct iphdr *iph)
* Find the destination with the least load.
* Find the destination with the least load.
*/
*/
nextstage:
nextstage:
list_for_each_entry
(
dest
,
&
svc
->
destinations
,
n_list
)
{
list_for_each_entry
_continue
(
dest
,
&
svc
->
destinations
,
n_list
)
{
if
(
dest
->
flags
&
IP_VS_DEST_F_OVERLOAD
)
if
(
dest
->
flags
&
IP_VS_DEST_F_OVERLOAD
)
continue
;
continue
;
doh
=
ip_vs_wlc_dest_overhead
(
dest
);
doh
=
ip_vs_wlc_dest_overhead
(
dest
);
...
...
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