Skip to content
Snippets Groups Projects
Commit b6d91f7f authored by maxim's avatar maxim
Browse files

b=14956

i=isaac
i=liang
Sleep on gmni_rx_mutex in interruptible way. Otherwise 'uptime' reports high load while rx thread is sleeping on mutex.
parent 422ffc2f
No related branches found
No related tags found
No related merge requests found
...@@ -433,9 +433,11 @@ gmnal_rx_thread(void *arg) ...@@ -433,9 +433,11 @@ gmnal_rx_thread(void *arg)
cfs_daemonize("gmnal_rxd"); cfs_daemonize("gmnal_rxd");
down(&gmni->gmni_rx_mutex);
while (!gmni->gmni_shutdown) { while (!gmni->gmni_shutdown) {
rc = down_interruptible(&gmni->gmni_rx_mutex);
LASSERT (rc == 0 || rc == -EINTR);
if (rc != 0)
continue;
spin_lock(&gmni->gmni_gm_lock); spin_lock(&gmni->gmni_gm_lock);
rxevent = gm_blocking_receive_no_spin(gmni->gmni_port); rxevent = gm_blocking_receive_no_spin(gmni->gmni_port);
...@@ -444,6 +446,7 @@ gmnal_rx_thread(void *arg) ...@@ -444,6 +446,7 @@ gmnal_rx_thread(void *arg)
switch (GM_RECV_EVENT_TYPE(rxevent)) { switch (GM_RECV_EVENT_TYPE(rxevent)) {
default: default:
gm_unknown(gmni->gmni_port, rxevent); gm_unknown(gmni->gmni_port, rxevent);
up(&gmni->gmni_rx_mutex);
continue; continue;
case GM_FAST_RECV_EVENT: case GM_FAST_RECV_EVENT:
...@@ -503,12 +506,8 @@ gmnal_rx_thread(void *arg) ...@@ -503,12 +506,8 @@ gmnal_rx_thread(void *arg)
if (rc < 0) /* parse failure */ if (rc < 0) /* parse failure */
gmnal_post_rx(gmni, rx); gmnal_post_rx(gmni, rx);
down(&gmni->gmni_rx_mutex);
} }
up(&gmni->gmni_rx_mutex);
CDEBUG(D_NET, "exiting\n"); CDEBUG(D_NET, "exiting\n");
atomic_dec(&gmni->gmni_nthreads); atomic_dec(&gmni->gmni_nthreads);
return 0; return 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment