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 35FED1773D for ; Wed, 9 Aug 2023 11:16:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id ADAB7C433C9; Wed, 9 Aug 2023 11:16:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1691579814; bh=6NSlyZFCtoYusYzCDXUcJMOHFc3m5zk8n3J1aNX/8Sg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yb0LNhD6LcY1ul579XhamAXc1G9pmSXsV7eWNx89cWHAOnS/5dV4QaGSqSfPZlzf3 BurE6+MG0EJt2exu5mwZ7WdLUHzlEbR3NppPFWDjxoV4CpPrODGj57uLvDEFNacS0p eZk1xpUOKBIwe21x0WPYTmvx2DyWw3Rla6ADrYD4= From: Greg Kroah-Hartman To: stable@vger.kernel.org, netfilter-devel@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Florian Westphal , Pablo Neira Ayuso Subject: [PATCH 4.19 125/323] netfilter: nf_tables: add rescheduling points during loop detection walks Date: Wed, 9 Aug 2023 12:39:23 +0200 Message-ID: <20230809103703.848786206@linuxfoundation.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230809103658.104386911@linuxfoundation.org> References: <20230809103658.104386911@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: Florian Westphal [ 81ea010667417ef3f218dfd99b69769fe66c2b67 ] Add explicit rescheduling points during ruleset walk. Switching to a faster algorithm is possible but this is a much smaller change, suitable for nf tree. Link: https://bugzilla.netfilter.org/show_bug.cgi?id=1460 Signed-off-by: Florian Westphal Acked-by: Pablo Neira Ayuso Signed-off-by: Greg Kroah-Hartman --- net/netfilter/nf_tables_api.c | 6 ++++++ 1 file changed, 6 insertions(+) --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c @@ -2552,6 +2552,8 @@ int nft_chain_validate(const struct nft_ if (err < 0) return err; } + + cond_resched(); } return 0; @@ -6956,9 +6958,13 @@ static int nf_tables_check_loops(const s break; } } + + cond_resched(); } list_for_each_entry(set, &ctx->table->sets, list) { + cond_resched(); + if (!nft_is_active_next(ctx->net, set)) continue; if (!(set->flags & NFT_SET_MAP) ||