Re: [RFC PATCH v1 0/6] Introducing `wq_cpu_set` mount option for btrfs

From: Ammar Faizi
Date: Mon Feb 27 2023 - 08:42:52 EST


On Mon, Feb 27, 2023 at 06:18:43PM +0800, Qu Wenruo wrote:
> I'm not sure if pinning the wq is really the best way to your problem.
>
> Yes, I understand you want to limit the CPU usage of btrfs workqueues, but
> have you tried "thread_pool=" mount option?
>
> That mount option should limit the max amount of in-flight work items, thus
> at least limit the CPU usage.

I have tried to use the thread_poll=%u mount option previously. But I
didn't observe the effect intensively. I'll try to play with this option
more and see if it can yield the desired behavior.

> For the wq CPU pinning part, I'm not sure if it's really needed, although
> it's known CPU pinning can affect some performance characteristics.

What I like about CPU pinning is that we can dedicate CPUs for specific
workloads so it won't cause scheduling noise to the app we've dedicated
other CPUs for.

--
Ammar Faizi