Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp15600931rwb; Mon, 28 Nov 2022 13:43:29 -0800 (PST) X-Google-Smtp-Source: AA0mqf4HsvUEf/NxcFH7HQpXKuFGP4nIwoZAObmWWPWopv1HfF/tdoluwkIb6bq217Nv6flxHxhB X-Received: by 2002:a17:906:c30c:b0:7ba:1f48:ccec with SMTP id s12-20020a170906c30c00b007ba1f48ccecmr23743439ejz.105.1669671809400; Mon, 28 Nov 2022 13:43:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669671809; cv=none; d=google.com; s=arc-20160816; b=MCw30MvkxLeukVAX4Ryl8hDrb27TtdsLNPDamT1JVuWmEWn1dLGVfEeCXD/ra8hjGy NCSsgeN9Kuhll4aSMDVCJw+Sf7qQdb6zs6pcNxR6A7uxxSzxZ85pifDcKkJ85YfYgukI INcZj85zTjCrv2yJeMK9K968zKwjyTS8yXMzPZYWyBY3BxILqru1Ky6mwGIZVNHPYAnR bxyqNKLzo5H1eyoJlQuAyu5c6OOG5B/pbwmBZdnldNMi71KOiTFCFcbAf8VQmr75EBF/ eGGanWRn61kmVE3o6Znh26gDS/7GPHliTYkOtMzCwa1dtss1Pr9hZDv3pzgaBMxe3lKQ nwNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=eFSwu4ncmiC6LBw/HdEAKqUTfWQnyjW4Lf8/P3+YzYU=; b=aMrA99lO85bMo+3JQem7fuEK0D5LsKJVsWKZypLCkU6mX8sbFuz+JOlRevM9lY+2Wb zv1LSaCeCzqVrZRyXHPWoxHVPft2gZLgKUZFWLBkf/4/RNuFlcYPC26qdnI78U8pp9gm S2mY4JWc3itCz5O22WVDTfqC4Ehf3U+sHmOEGo1VWHXBI+a3Eyd5CbkQEvDRCbfFLNeK UzRzMYgrS4rUfnsLt5U9iuV06vuX+g9cmsyIoiqt3SrIxdXlkOuUq9pPtvuNuZu+Tpds oMy6P8n3H+ClJmZCeF66FNRXSezyju9VinWaVPVScYejajkLfAuUbkESye3rIsldiqg+ agdg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id be4-20020a1709070a4400b007a71a3cb3afsi11033608ejc.294.2022.11.28.13.43.08; Mon, 28 Nov 2022 13:43:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233121AbiK1Uja (ORCPT + 84 others); Mon, 28 Nov 2022 15:39:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48558 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233789AbiK1Uj0 (ORCPT ); Mon, 28 Nov 2022 15:39:26 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1891FB5A; Mon, 28 Nov 2022 12:39:24 -0800 (PST) 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 ams.source.kernel.org (Postfix) with ESMTPS id 80AF2B80FD4; Mon, 28 Nov 2022 20:39:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5820EC433D6; Mon, 28 Nov 2022 20:39:21 +0000 (UTC) Date: Mon, 28 Nov 2022 15:39:19 -0500 From: Steven Rostedt To: Daniel Bristot de Oliveira Cc: Masami Hiramatsu , Jonathan Corbet , Juri Lelli , Clark Williams , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH V3 2/3] tracing/osnoise: Add preempt/irq disable options Message-ID: <20221128153919.33c008d1@gandalf.local.home> In-Reply-To: <03d4a8522792fa3a51920c79f8a5074933a2fcb3.1669409262.git.bristot@kernel.org> References: <03d4a8522792fa3a51920c79f8a5074933a2fcb3.1669409262.git.bristot@kernel.org> 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 X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 25 Nov 2022 22:20:23 +0100 Daniel Bristot de Oliveira wrote: > @@ -1308,6 +1315,8 @@ static void notify_new_max_latency(u64 latency) > */ > static int run_osnoise(void) > { > + bool preempt_disable = test_bit(OSN_PREEMPT_DISABLE, &osnoise_options); > + bool irq_disable = test_bit(OSN_IRQ_DISABLE, &osnoise_options); bool irq_disable = test_bit(OSN_IRQ_DISABLE, &osnoise_options); bool preempt_disable = IS_ENABLED(CONFIG_PREEMPT) && !irq_disable && test_bit(OSN_PREEMPT_DISABLE, &osnoise_options); > struct osnoise_variables *osn_var = this_cpu_osn_var(); > u64 start, sample, last_sample; > u64 last_int_count, int_count; > @@ -1335,6 +1344,14 @@ static int run_osnoise(void) > */ > threshold = tracing_thresh ? : 5000; > > + /* > + * IRQ disable also implies in preempt disable. > + */ > + if (irq_disable) > + local_irq_disable(); if (preempt_disable) > + preempt_disable(); > + > /* > * Make sure NMIs see sampling first > */ > @@ -1422,16 +1439,21 @@ static int run_osnoise(void) > * cond_resched() > */ > if (IS_ENABLED(CONFIG_PREEMPT_RCU)) { > - local_irq_disable(); > + if (!irq_disable) > + local_irq_disable(); > + > rcu_momentary_dyntick_idle(); > - local_irq_enable(); > + > + if (!irq_disable) > + local_irq_enable(); > } > > /* > * For the non-preemptive kernel config: let threads runs, if > - * they so wish. > + * they so wish, unless set not do to so. > */ > - cond_resched(); > + if (!irq_disable && !preempt_disable) > + cond_resched(); > > last_sample = sample; > last_int_count = int_count; > @@ -1450,6 +1472,14 @@ static int run_osnoise(void) > */ > barrier(); > > + /* > + * Return to the preemptive state. > + */ if (preempt_disable) > + preempt_enable(); > + > + if (irq_disable) > + local_irq_enable(); -- Steve > /* > * Save noise info. > */