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 8A44CEB64DD for ; Thu, 6 Jul 2023 16:33:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230054AbjGFQdI convert rfc822-to-8bit (ORCPT ); Thu, 6 Jul 2023 12:33:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37652 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229610AbjGFQdI (ORCPT ); Thu, 6 Jul 2023 12:33:08 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 27EA5183; Thu, 6 Jul 2023 09:33:07 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 9E07260F16; Thu, 6 Jul 2023 16:33:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4518EC433C7; Thu, 6 Jul 2023 16:33:03 +0000 (UTC) Date: Thu, 6 Jul 2023 12:33:00 -0400 From: Steven Rostedt To: Vivek Anand Cc: Thomas Gleixner , Peter Zijlstra , Bagas Sanjaya , Pablo Neira Ayuso , Jozsef Kadlecsik , Florian Westphal , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Lingutla Chandrasekhar , Frederic Weisbecker , "J. Avila" , "Rafael J. Wysocki" , Thomas Renninger , Shuah Khan , Borislav Petkov , Josh Poimboeuf , Linux Kernel Mailing List , Linux Regressions , Linux Netfilter Development , Netfilter Core Developers , Linux Networking , Linux Power Management , x86@kernel.org Subject: Re: High cpu usage caused by kernel process when upgraded to linux 5.19.17 or later Message-ID: <20230706123300.55d6450b@gandalf.local.home> In-Reply-To: References: <01ac399d-f793-49d4-844b-72cd8e0034df@gmail.com> <20230627073035.GV4253@hirez.programming.kicks-ass.net> <99b64dfd-be4a-2248-5c42-8eb9197824e1@gmail.com> <20230627101939.GZ4253@hirez.programming.kicks-ass.net> <878rc22vxq.ffs@tglx> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org On Mon, 3 Jul 2023 18:23:25 +0530 Vivek Anand wrote: > Hi Thomas, > > Further analyzing, I found that I did set > "CONFIG_NETFILTER_XT_MATCH_LIMIT=m" in my kernel config earlier which was > causing high CPU consumption. > Setting it to "CONFIG_NETFILTER_XT_MATCH_LIMIT=n" resolved the high CPU > issue. > > Is there any suggestion regarding the use of this config > "CONFIG_NETFILTER_XT_MATCH_LIMIT" as I'm getting high CPU by setting it to > "m" ? That config enables the compiling of: net/netfilter/xt_limit.c The htable_gc that you reported is defined in: net/netfilter/xt_hashlimit.c It has: static void htable_gc(struct work_struct *work) { struct xt_hashlimit_htable *ht; ht = container_of(work, struct xt_hashlimit_htable, gc_work.work); htable_selective_cleanup(ht, false); queue_delayed_work(system_power_efficient_wq, &ht->gc_work, msecs_to_jiffies(ht->cfg.gc_interval)); } So it queues itself every ht->cfg.gc_interval msecs. That variable seems to come from some configuration of netfilter, and I think you can see these in: find /proc/sys/net -name 'gc_interval' Perhaps you have it set off to go too much? -- Steve > > Thanks, > Vivek > > On Thu, Jun 29, 2023 at 7:48 PM Thomas Gleixner wrote: > > > On Thu, Jun 29 2023 at 12:05, Vivek Anand wrote: > > > I've tried booting with "spectre_v2=retpoline retbleed=off". > > > This change didn't work. Still CPU is 100% > > > > This does not make sense. > > > > retbleed=off has the same effect as CONFIG_X86_IBRS_ENTRY=n. > > > > The only difference is that with CONFIG_X86_IBRS_ENTRY=y and > > retbleed=off there is one extra jump in the low level entry code > > (syscall, interrupts, exceptions) and one extra jump on the exit side. > > > > But those extra jumps are completely irrelevant for the kworker threads. > > > > Can you please provide dmesg and the content of the files in > > > > /sys/devices/system/cpu/vulnerabilities/ > > > > on a kernel booted with "spectre_v2=retpoline retbleed=off" ? > > > > Thanks, > > > > tglx > >