From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 022F93E1D1A for ; Tue, 17 Mar 2026 14:22:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773757338; cv=none; b=KDDmORNmL2WSzAr9wbdczw3XKcNVYS8N5rT5s/G34ybL8ZOm1XY+20Er/+2dQ2rXWKl0CiiAxItnEBKe6sqRHouK8Igr9yjTINLhFc/CqkCUTxY2rUyYmh7eNGD2ng7zv5yFswYZ3AvRLpAklYJAnXx2yh/RASjgYoh2Mo5j7Gs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773757338; c=relaxed/simple; bh=HBKoQa05urRQHzvm/eOMEQ3NBxOihkkkcqgHIqC842A=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=mn6169SKr/NhNJdjNocL20pKM2FdxWOHkYBEjog0IrKkRzOcZcjlJrta9CCDYKjxGSMoeOWnkAK96XFCFRMHx5TrZ8/1ykLl0NS+rtfEzrF9V/UwG99SG/4sS8qw4t6+U+w5qlt5AYhg9Bmz03/PDkGA7dtStWjVj6Oec6SMXRY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=4iAgw2Mm; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="4iAgw2Mm" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=HBKoQa05urRQHzvm/eOMEQ3NBxOihkkkcqgHIqC842A=; b=4iAgw2MmwA1nPiKfzbqjkDLthe 8ruh5lvun9CNpddDenOKrwJBrLoNXBfvMMMLRqvdBIJsyzM7+ThK/DxQXT99n7Cv66rahNOsdpqCo iSVWdU5zk9XcFYTJe7WSjwsFLDjVwIxy8R1EaBaAJEJ0tLG97VCmRAZqPdZ1ZAKvIJEnWViK3l9e7 Mg1I9lYtePHT2vxyHLMZe2nLCh/bVGxKPXht+pnOsWPotyE4Ytga8DkbZxBDvd9Vd0H2Jv5OZLfol 5X/jp3UcX4WUPSkV5ofp7LPx2HANvCUf99Tkmqmo/EZ4HF0nTQI5YWLTUl7qFDuKGppuoAiWPXURc R/IYb9wg==; Received: from hch by bombadil.infradead.org with local (Exim 4.98.2 #2 (Red Hat Linux)) id 1w2VJE-00000006ZO6-1K4P; Tue, 17 Mar 2026 14:22:12 +0000 Date: Tue, 17 Mar 2026 07:22:12 -0700 From: Christoph Hellwig To: Kuan-Wei Chiu Cc: Richard Weinberger , Andrew Morton , chengzhihao1 , jserv@ccns.ncku.edu.tw, eleanor15x@gmail.com, marscheng@google.com, linux-mtd , linux-kernel Subject: Re: [PATCH] lib/list_sort: introduce list_sort_nonatomic() and remove dummy cmp() calls Message-ID: References: <20260315193900.218737-1-visitorckw@gmail.com> <1295583760.42468.1773645957126.JavaMail.zimbra@nod.at> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html On Tue, Mar 17, 2026 at 02:04:07AM +0800, Kuan-Wei Chiu wrote: > I tried to dig into the history. It turns out this mechanism was > introduced 16 years ago in commit 835cc0c8477f ("lib: more scalable > list_sort()"). The commit message explicitly mentioned both XFS and > UBIFS as the intended users for this long-list workaround. However, > looking at the tree back then, XFS never actually put a cond_resched() > in their cmp() function. It seems UBIFS has been the sole user of this > trick ever since. Given that it has been this way for 16 years, it > seems other subsystems haven't really encountered any practical issues > with it. .. or it wasn't even needed in the first place. > For UBIFS, this patch doesn't alter the frequency, timing, or behavior > of the cond_resched() calls at all, so I am confident that this won't > introduce any regressions. I'd be tempted to drop the workaround and remove the cond_resched from ubifs given that entirely non-preemptible scheduling models are on their way out.