Subject: Re: [RFC rdma-next] RDMA/core: Add attribute WQ_MEM_RECLAIM to workqueue "infiniband"

From: Jason Gunthorpe <[email-masked]>
Date: Tue, 18 Feb 2020 11:31:56 -0400

On Tue, Feb 18, 2020 at 11:35:35AM +0800, Lang Cheng wrote:
> The hns3 driver sets "hclge_service_task" workqueue with
> WQ_MEM_RECLAIM flag in order to guarantee forward progress
> under memory pressure.

Don't do that. WQ_MEM_RECLAIM is only to be used by things interlinked
with reclaimed processing.

Work on queues marked with WQ_MEM_RECLAIM can't use GFP_KERNEL
allocations, can't do certain kinds of sleeps, can't hold certain
kinds of locks, etc.

Jason