Skip to content

Commit

Permalink
IB/core: Fix use workqueue without WQ_MEM_RECLAIM
Browse files Browse the repository at this point in the history
The IB/core provides address resolution service and invokes callback
handler when address resolve request completes of requester in worker
thread context.

Such caller might allocate or free memory in callback handler
depending on the completion status to make further progress or to
terminate a connection. Most ULPs resolve route which involves
allocating route entry and path record elements in callback event handler.

It has been noticed that WQ_MEM_RECLAIM flag should not be used for
workers that tend to allocate memory in this [1] thread discussion.

In order to mitigate this situation, WQ_MEM_RECLAIM flag was dropped for
other such WQs in this [2] patch.

Similar problem might arise with address resolution path, though its not
yet noticed. The ib_addr workqueue is not memory reclaim path due to its
nature of invoking callback that might allocate memory or don't free any
memory under memory pressure.

[1] https://www.spinics.net/lists/linux-rdma/msg53239.html
[2] https://www.spinics.net/lists/linux-rdma/msg53416.html

Fixes: f548162 ("IB/addr: Remove deprecated create_singlethread_workqueue")
Fixes: 5fff41e ("IB/core: Fix race condition in resolving IP to MAC")
Signed-off-by: Parav Pandit <[email protected]>
Reviewed-by: Daniel Jurgens <[email protected]>
Signed-off-by: Leon Romanovsky <[email protected]>
Signed-off-by: Doug Ledford <[email protected]>
  • Loading branch information
paravmellanox authored and dledford committed Oct 18, 2017
1 parent 79c4d80 commit 39baf10
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/infiniband/core/addr.c
Original file line number Diff line number Diff line change
Expand Up @@ -852,7 +852,7 @@ static struct notifier_block nb = {

int addr_init(void)
{
addr_wq = alloc_ordered_workqueue("ib_addr", WQ_MEM_RECLAIM);
addr_wq = alloc_ordered_workqueue("ib_addr", 0);
if (!addr_wq)
return -ENOMEM;

Expand Down

0 comments on commit 39baf10

Please sign in to comment.