From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 34E8D25A2A2 for ; Sat, 21 Mar 2026 01:21:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774056066; cv=none; b=hZMXQNPt5GOB3xi0SvvtZq1N3FD71QvX/iU1drubXtMbF5bFUrTEtOXj4AirO5iB49d1XBkqELz9EZ3dJrlSzqcHYD7qSzf4XuF/zNvJBM8oQvJuhRdrhShhdqMb4w5btlxgBQZ/uxzL6JE00jF27sRf3zK0b7LIOs+8HcZPz5A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774056066; c=relaxed/simple; bh=sFDu7MTIvw/KC9d5DLL4z/6GA5pNlruDO4eiSreCgjI=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=qM1acjQtJkinrYj8ECXz+TtVl/jOfDFbZGchLAwYkTDy3in25IWXKlMOBj5794+DhYBhpUXl/tVd2Y5UJIiyxJzP6/IiZE8un80qGVuNQkWIXImEliSX81E/EqdywWbt/xLHPD59m5K7TQaR8dSWGsFQCpUwX5amKpUomVA0jJQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=SJBluO7a; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="SJBluO7a" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 66B92C4CEF7; Sat, 21 Mar 2026 01:21:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1774056065; bh=sFDu7MTIvw/KC9d5DLL4z/6GA5pNlruDO4eiSreCgjI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=SJBluO7aBY7Q5/y8Uqg7Xxw6nLIKUtY0mMLTqSiEgLQ8kG0W05CwuOe3gZcTbcV3M aYyrthDGiFAJHr8EKGZ4IjgUu1V3EopI+cVko4J7hHQV0UpxHM8iOtP/vGvfYXx3CK i99aihsIvC5B2V418bCfkgIyBpiHtXQitWDVm8IQ= Date: Fri, 20 Mar 2026 18:21:04 -0700 From: Andrew Morton To: Kuan-Wei Chiu Cc: richard@nod.at, chengzhihao1@huawei.com, hch@infradead.org, jserv@ccns.ncku.edu.tw, eleanor15x@gmail.com, marscheng@google.com, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 0/2] lib/list_sort: Clean up list_sort() scheduling workarounds Message-Id: <20260320182104.fc8ec409731591d7021c6777@linux-foundation.org> In-Reply-To: <20260320180938.1827148-1-visitorckw@gmail.com> References: <20260320180938.1827148-1-visitorckw@gmail.com> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) 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-Transfer-Encoding: 7bit On Fri, 20 Mar 2026 18:09:36 +0000 Kuan-Wei Chiu wrote: > Historically, list_sort() included a hack in merge_final() that > periodically invoked dummy cmp(priv, b, b) calls when merging highly > unbalanced lists. This allowed the caller to invoke cond_resched() > within their comparison callbacks to avoid soft lockups. > > However, an audit of the kernel tree shows that fs/ubifs/ has been the > sole user of this mechanism. For all other generic list_sort() users, > this results in wasted function calls and unnecessary overhead in a > tight loop. > > Recent discussions and code inspection confirmed that the lists being > sorted in UBIFS are bounded in size (a few thousand elements at most), > and the comparison functions are extremely lightweight. Therefore, > UBIFS does not actually need to rely on this mechanism. Thanks. AI review found a now-unused local, which I'll fix. https://sashiko.dev/#/patchset/20260320180938.1827148-1-visitorckw@gmail.com