Skip to content

Commit ad7312b

Browse files
Wei Lin GuayLinuxMinion
authored andcommitted
net/rds: use different workqueue for base_conn
RDS uses rds_wq for various operations. During ADDR_CHANGE event, each connection queues at least two tasks into this single-threaded workqueue. Furthermore, the TOS connections have dependency on its base connection. Thus, a separate workqueue is created specifically for the base connections to speed up base connection establishment. Orabug: 25521901 Signed-off-by: Wei Lin Guay <[email protected]> Reviewed-by: Håkon Bugge <[email protected]> Reviewed-by: Ajaykumar Hotchandani <[email protected]> Tested-by: Dib Chatterjee <[email protected]> Tested-by: Rosa Isela Lopez Romero <[email protected]>
1 parent 1e1fbcc commit ad7312b

File tree

4 files changed

+11
-2
lines changed

4 files changed

+11
-2
lines changed

net/rds/connection.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,6 @@ static struct rds_connection *__rds_conn_create(struct net *net,
243243
}
244244

245245
conn->c_trans = trans;
246-
247246
init_waitqueue_head(&conn->c_hs_waitq);
248247
for (i = 0; i < RDS_MPATH_WORKERS; i++) {
249248
struct rds_conn_path *cp;
@@ -254,7 +253,7 @@ static struct rds_connection *__rds_conn_create(struct net *net,
254253
if (conn->c_loopback)
255254
cp->cp_wq = rds_local_wq;
256255
else
257-
cp->cp_wq = rds_wq;
256+
cp->cp_wq = tos ? rds_wq : rds_tos_wq;
258257
}
259258
ret = trans->conn_alloc(conn, gfp);
260259
if (ret) {

net/rds/ib.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2099,6 +2099,8 @@ static void rds_ib_unregister_client(void)
20992099
ib_unregister_client(&rds_ib_client);
21002100
/* wait for rds_ib_dev_free() to complete */
21012101
flush_workqueue(rds_ip_wq);
2102+
flush_workqueue(rds_wq);
2103+
flush_workqueue(rds_tos_wq);
21022104
flush_workqueue(rds_local_wq);
21032105
}
21042106

net/rds/rds.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1136,6 +1136,7 @@ extern unsigned int rds_sysctl_shutdown_trace_end_time;
11361136
int rds_threads_init(void);
11371137
void rds_threads_exit(void);
11381138
extern struct workqueue_struct *rds_wq;
1139+
extern struct workqueue_struct *rds_tos_wq;
11391140
extern struct workqueue_struct *rds_local_wq;
11401141
void rds_queue_reconnect(struct rds_conn_path *cp);
11411142
void rds_connect_worker(struct work_struct *);

net/rds/threads.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ MODULE_PARM_DESC(rds_conn_hb_timeout, " Connection heartbeat timeout");
7474
*/
7575
struct workqueue_struct *rds_wq;
7676
EXPORT_SYMBOL_GPL(rds_wq);
77+
struct workqueue_struct *rds_tos_wq;
78+
EXPORT_SYMBOL_GPL(rds_tos_wq);
7779
struct workqueue_struct *rds_local_wq;
7880
EXPORT_SYMBOL_GPL(rds_local_wq);
7981

@@ -352,6 +354,7 @@ void rds_shutdown_worker(struct work_struct *work)
352354
void rds_threads_exit(void)
353355
{
354356
destroy_workqueue(rds_wq);
357+
destroy_workqueue(rds_tos_wq);
355358
destroy_workqueue(rds_local_wq);
356359
}
357360

@@ -361,6 +364,10 @@ int rds_threads_init(void)
361364
if (!rds_wq)
362365
return -ENOMEM;
363366

367+
rds_tos_wq = create_singlethread_workqueue("krdsd_tos");
368+
if (!rds_wq)
369+
return -ENOMEM;
370+
364371
rds_local_wq = create_singlethread_workqueue("krdsd_local");
365372
if (!rds_local_wq)
366373
return -ENOMEM;

0 commit comments

Comments
 (0)