Received: by 2002:ab2:620c:0:b0:1ef:ffd0:ce49 with SMTP id o12csp1687682lqt; Wed, 20 Mar 2024 10:58:18 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUpSTH/PTA8J+GcN+Pu+KGsizcWnM2MjYE3HaJITIZauaFVLaIt/aEw7a2k5ct66U6XTE6XSWeOqXbrpDFoM/xGPF2Y3mW2/ppdiQZkDg== X-Google-Smtp-Source: AGHT+IEsOOiDAhIQaPaFbChZSr8JMpKNyYcjJ70C9ubRDhCvU0ke74Aqch2MZTANwXzHkHlds51i X-Received: by 2002:a05:6a20:9589:b0:1a3:6f98:f677 with SMTP id iu9-20020a056a20958900b001a36f98f677mr8430778pzb.8.1710957498224; Wed, 20 Mar 2024 10:58:18 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710957498; cv=pass; d=google.com; s=arc-20160816; b=CXKHxnRsgSzMxapMaokCn1Z2ELziT+lzAGvekcxw++ETyFOqOO6BOUZqpW+xQRhG+K tepOa86LuR+Ctf/vpwb9js+qyM3zeCgW13mdlsvjqIJk7YgdaQd6dQ6ujLbr4w4WFLSD JYI8vK/JVrKWaLm/18utqw5xrj6t+W6w6kOY2HOWmtAAwiO87Z75dz0wsHoqGoxCMapi OtEc9LkIwBN8J2ZqcBFJjiGo6c9y/ur0GTVDMP4L8k2d5GYJZ8H1uNhXXAMbdkKxIZhW //5T/Neg+ANUxqpDmJ18xiXAU1b6TVzKpxBAT9k9h4o2/+pT44WaX4XMzfX+pmNtxkSX ck9Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date; bh=gVvneLWSCVdAj+DynHZdtTw9zAjfZ0tn8jbnWRc/1W8=; fh=1+IMX6ucQ2FgDOG9WoJCJYv+3PEWb/o5h6zxOnYyI6Y=; b=wUsTwHDpdcZdUs+ftCmGvv8y4I0Mr4by15IJ+kv98/N6OB4i8llqiOsvQLLleL8Jvc je8dSoRlfaZT1K8tFCdDeH8GvLBupRWjNMkmTswgu5l76e6YqDh0X+sDZ/wolMzOnSNv MEqBP+qerN3qSlma/sgxWW2IyWRmx8UyJvY1DokYkxCHTCxccERESwwIOVey6mH01R1c pHhgs/r3zfYw5GfE6ZbyzQMnTANLFdSAPx7ifFe3VtQn1a78+emtWsjVsISTC/Zse9bX bd+amZ/qEQkPcbgS7gEkFfQ6Ea89oW7FtEUubYU57lJU5tQf3xy6KhkQr9Aq7JKDW4ce pgaA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-109258-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-109258-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id l125-20020a632583000000b005dc55764005si12601392pgl.640.2024.03.20.10.58.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Mar 2024 10:58:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-109258-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-109258-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-109258-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id F1CA8B23886 for ; Wed, 20 Mar 2024 17:56:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D47BE6A8CD; Wed, 20 Mar 2024 17:55:56 +0000 (UTC) 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-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