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 553E469DE4; Wed, 20 Mar 2024 17:55:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710957356; cv=none; b=ZDkaZDoXxe7LcUfm+Xu7KJk2H43jWzJtNIstlsmb01UJYY3MyzZmdMcg7AqpenjH9kbqoku+3t4HF0h+Gc+HTgw9RcOHAXqLRrur7OMQB/GiZJOdLWNUm/gdqaimzcG5ZqiO6ixaACvOlPLoKQhgQ0QLRCOaqPJkM2J74j49Bww= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710957356; c=relaxed/simple; bh=yvxdZcmVH4E1WLSo9+lpEe8WBNOQkbGm6Jg3v9hHgZ0=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=DPgT/kjpNJ1daMz+NDoZAO7bTVlnVZNPKmQEsZbUKaRmlaFdq25NQet5+p29sm+Wks8GC0y12ZOe2PY9eJfu2SnpBzQqTim3eL4JRoyawRKrRGxPbnEDB/YWljyCScD6042OqP9tqRuvlrVQekqlOKpniBSfItUEaNwlDab/K78= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9B179C433C7; Wed, 20 Mar 2024 17:55:54 +0000 (UTC) Date: Wed, 20 Mar 2024 13:58:19 -0400 From: Steven Rostedt To: Mathieu Desnoyers Cc: LKML , Linux Trace Kernel , Masami Hiramatsu , Daniel Bristot de Oliveira , Peter Zijlstra , Thomas Gleixner , Ingo Molnar , Will Deacon , Waiman Long , Boqun Feng , linux-rt-users Subject: Re: [RFC][PATCH] tracing: Introduce restart_critical_timings() Message-ID: <20240320135819.4a25c50f@gandalf.local.home> In-Reply-To: <0015569b-15dc-4ccd-b322-67c3665c585e@efficios.com> References: <20240320122012.2c1f461f@gandalf.local.home> <0015569b-15dc-4ccd-b322-67c3665c585e@efficios.com> X-Mailer: Claws Mail 3.19.1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-trace-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Wed, 20 Mar 2024 13:15:39 -0400 Mathieu Desnoyers wrote: > > I would like to introduce restart_critical_timings() and place it in > > locations that have this behavior. > > Is there any way you could move this to need_resched() rather than > sprinkle those everywhere ? Because need_resched() itself does not mean it's going to schedule immediately. I looked at a few locations that need_resched() is called. Most are in idle code where the critical timings are already handled. I'm not sure I'd add it for places like mm/memory.c or drivers/md/bcache/btree.c. A lot of places look to use it more for PREEMPT_NONE situations as a open coded cond_resched(). The main reason this one is particularly an issue, is that it spins as long as the owner is still running. Which may be some time, as here it was 7ms. -- Steve