Re: [PATCH 2/2] bcachefs: Set rebalance thread to SCHED_BATCH and nice 19
From: Kent Overstreet
Date: Fri Nov 15 2024 - 15:51:20 EST
On Fri, Nov 15, 2024 at 09:26:56AM +0100, Florian Schmaus wrote:
> On 15/11/2024 06.43, Kent Overstreet wrote:
> > On Thu, Nov 14, 2024 at 10:06:48PM +0100, Florian Schmaus wrote:
> > > Set the rebalance thread's scheduling class to BATCH, which means it
> > > could experience a higher scheduling latency. However, it reduces
> > > preemption events of running threads.
> > >
> > > And while the rebalance thread is ually not compute bound, it does
> > > cause a considerable amount of I/O. By increasing its nice level from
> > > 0 to 19 we also implicitly reduce the thread's best-effort I/O
> > > scheduling class level from 4 to 7. Therefore, the rebalance thread's
> > > I/O operations will be deprioritized over standard I/O operations.
> >
> > Is there a patch 1/2?
>
> Sorry, patch 1/2 was unfortunately not send to linux-bcachefs@. You can find
> it at
>
> https://lore.kernel.org/lkml/20241114210649.71377-1-flo@xxxxxxxxxxxx/
2/2: https://lore.kernel.org/lkml/20241114210649.71377-2-flo@xxxxxxxxxxxx/
Ingo, for sanity could we keep these two patches together? your tree or
mine is fine with me, if patch 1/2 is acceptable to you
Florian also had another idea I wanted to mention for giving userspace
control over sched policy - exposing the pids of our
rebalance/copygc/etc. threads in /sys/fs/bcachefs.
I'm liking it, do we have precedent elsewhere in the kernel for that?