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 B9C3BC77B7A for ; Wed, 31 May 2023 09:10:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235368AbjEaJJq (ORCPT ); Wed, 31 May 2023 05:09:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235017AbjEaJJk (ORCPT ); Wed, 31 May 2023 05:09:40 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 36982E48 for ; Wed, 31 May 2023 02:09:06 -0700 (PDT) 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 dfw.source.kernel.org (Postfix) with ESMTPS id 9033560BB5 for ; Wed, 31 May 2023 09:09:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B7A77C433EF; Wed, 31 May 2023 09:09:03 +0000 (UTC) Date: Wed, 31 May 2023 05:08:59 -0400 From: Steven Rostedt To: Peter Zijlstra Cc: LKML , x86@kernel.org, Masami Hiramatsu , Thomas Gleixner , Ingo Molnar , Borislav Petkov Subject: Re: [PATCH] x86/alternatives: Add cond_resched() to text_poke_bp_batch() Message-ID: <20230531050859.218a6632@rorschach.local.home> In-Reply-To: <20230530120148.GD156198@hirez.programming.kicks-ass.net> References: <20230528084652.5f3b48f0@rorschach.local.home> <20230530120148.GD156198@hirez.programming.kicks-ass.net> 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=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 30 May 2023 14:01:48 +0200 Peter Zijlstra wrote: > > diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c > > index f615e0cb6d93..e024eddd457f 100644 > > --- a/arch/x86/kernel/alternative.c > > +++ b/arch/x86/kernel/alternative.c > > @@ -1953,6 +1953,14 @@ static void text_poke_bp_batch(struct text_poke_loc *tp, unsigned int nr_entries > > */ > > atomic_set_release(&bp_desc.refs, 1); > > > > + /* > > + * Function tracing can enable thousands of places that need to be > > + * updated. This can take quite some time, and with full kernel debugging > > + * enabled, this could cause the softlockup watchdog to trigger. > > + * Add cond_resched() calls to each phase. > > + */ > > + cond_resched(); > > But but but... you can only have TP_VEC_MAX pokes queued, which is 256 > on normal setups. > > Please explain how this leads to problems and why you need _3_ > reschedule points here. I removed all but this first one and it works fine. I'll resend with the update. -- Steve