From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D855FC678D5 for ; Tue, 7 Mar 2023 17:49:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232197AbjCGRtk (ORCPT ); Tue, 7 Mar 2023 12:49:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36688 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232198AbjCGRtU (ORCPT ); Tue, 7 Mar 2023 12:49:20 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DD45C9CBE2 for ; Tue, 7 Mar 2023 09:44:05 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 8DC53B81850 for ; Tue, 7 Mar 2023 17:44:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C66AEC433EF; Tue, 7 Mar 2023 17:44:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1678211043; bh=Tf7jTMEQeWZDw0zdKoXOGgIkF3bnwREM27msHOSKLc8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KiMqzc3tRfsWUuiwwRa/oU4hFEvlc403wvj7axv7lF0qbVOa3oVeXZLaHBK6J5Ieh DU4ovbHzNYv9ruDhn27QDe3W4eSzQi5Wlzt6VvU69kKxGJTd1JuVwLPDIxklOycp7s 7tWWzV4Arsuf4w4jijY9mzjOMOWwPo3/gVj6s9E8= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Mike Snitzer , Sasha Levin Subject: [PATCH 6.2 0736/1001] dm thin: add cond_resched() to various workqueue loops Date: Tue, 7 Mar 2023 17:58:28 +0100 Message-Id: <20230307170053.655024942@linuxfoundation.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230307170022.094103862@linuxfoundation.org> References: <20230307170022.094103862@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Mike Snitzer [ Upstream commit e4f80303c2353952e6e980b23914e4214487f2a6 ] Otherwise on resource constrained systems these workqueues may be too greedy. Signed-off-by: Mike Snitzer Signed-off-by: Sasha Levin --- drivers/md/dm-thin.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/md/dm-thin.c b/drivers/md/dm-thin.c index 64cfcf46881dc..e4c1a8a21bbd0 100644 --- a/drivers/md/dm-thin.c +++ b/drivers/md/dm-thin.c @@ -2207,6 +2207,7 @@ static void process_thin_deferred_bios(struct thin_c *tc) throttle_work_update(&pool->throttle); dm_pool_issue_prefetches(pool->pmd); } + cond_resched(); } blk_finish_plug(&plug); } @@ -2289,6 +2290,7 @@ static void process_thin_deferred_cells(struct thin_c *tc) else pool->process_cell(tc, cell); } + cond_resched(); } while (!list_empty(&cells)); } -- 2.39.2