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 4B0628489 for ; Fri, 10 Mar 2023 14:20:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C68CFC4339B; Fri, 10 Mar 2023 14:20:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1678458020; bh=9JQN3AtlysHx16o2AXHFfRv30uRyIeIJZ8MomPNA4QQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=W9jp7z2ytavqab9Ov8ymq4Hx4EZ0LoCoGkTuiZ3wZtVdmcssEMxwssZvH6wYlGEAG 6g8yyfGJcZKcjQHvCLu8GJ0L2Grv1Kn65dZd8oGM6f7gF7hg8TJF+rKKGqDyoUu623 i/2j8A7X0TwAghkjzOJyaoTQ18Pp2oj6VF74rQTk= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Mike Snitzer , Sasha Levin Subject: [PATCH 4.19 137/252] dm thin: add cond_resched() to various workqueue loops Date: Fri, 10 Mar 2023 14:38:27 +0100 Message-Id: <20230310133722.943854940@linuxfoundation.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230310133718.803482157@linuxfoundation.org> References: <20230310133718.803482157@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 386cb33953783..969ea013c74e4 100644 --- a/drivers/md/dm-thin.c +++ b/drivers/md/dm-thin.c @@ -2222,6 +2222,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); } @@ -2305,6 +2306,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