[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YjotekJZcSvwoZhp@localhost.localdomain>
Date: Tue, 22 Mar 2022 16:11:38 -0400
From: Josef Bacik <josef@...icpanda.com>
To: Xie Yongji <xieyongji@...edance.com>
Cc: axboe@...nel.dk, bvanassche@....org, linux-block@...r.kernel.org,
nbd@...er.debian.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] nbd: Don't use workqueue to handle recv work
On Mon, Dec 27, 2021 at 05:12:41PM +0800, Xie Yongji wrote:
> The rescuer thread might take over the works queued on
> the workqueue when the worker thread creation timed out.
> If this happens, we have no chance to create multiple
> recv threads which causes I/O hung on this nbd device.
>
> To fix it, we can not simply remove the WQ_MEM_RECLAIM
> flag since the recv work is in the memory reclaim path.
> So this patch tries to create kthreads directly to
> handle the recv work instead of using workqueue.
>
I still don't understand why we can't drop WQ_MEM_RECLAIM. IIRC your argument
is that we need it because a reconnect could happen under memory pressure and we
need to be able to queue work for that. However your code makes it so we're
just doing a kthread_create(), which isn't coming out of some emergency pool, so
it's just as likely to fail as a !WQ_MEM_RECLAIM workqueue. Thanks,
Josef
Powered by blists - more mailing lists