[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z+QjJxcnAkeGIbCT@visitorckw-System-Product-Name>
Date: Wed, 26 Mar 2025 23:54:15 +0800
From: Kuan-Wei Chiu <visitorckw@...il.com>
To: Kent Overstreet <kent.overstreet@...ux.dev>
Cc: linux-bcachefs@...r.kernel.org, linux-kernel@...r.kernel.org,
Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH] lib/sort.c: Add _nonatomic() variants with cond_resched()
On Wed, Mar 26, 2025 at 11:26:06AM -0400, Kent Overstreet wrote:
> Andrew - if you're ok with this patch I'd like to get it in soon as a
> bugfix, I've been getting quite a few reports on this one.
>
> I don't much care for the naming though, thoughts there?
>
> -- >8 --
>
> bcachefs calls sort() during recovery to sort all keys it found in the
> journal, and this may be very large - gigabytes on large machines.
>
> This has been causing "task blocked" warnings, so needs a
> cond_resched().
>
> Cc: Kuan-Wei Chiu <visitorckw@...il.com>
> Cc: Andrew Morton <akpm@...ux-foundation.org>
> Signed-off-by: Kent Overstreet <kent.overstreet@...ux.dev>
> ---
> include/linux/sort.h | 11 +++++++++++
> lib/sort.c | 46 +++++++++++++++++++++++++++++++++++++++-----
> 2 files changed, 52 insertions(+), 5 deletions(-)
>
I don't have strong opinions on this, but I recall that UBIFS had a
similar issue with list_sort(), and they addressed it by calling
cond_resched() within the compare function. Would that approach be
simpler and more appropriate than introducing a new API in the library
code?
Regards,
Kuan-Wei
Powered by blists - more mailing lists