Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2395116pxp; Mon, 7 Mar 2022 14:37:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJwYGfvmHZKQo5HfxygBfZ8W2nCFRDRL0NED3anRq12G9lMC2JqKPou0qeqAtT6vlX/S4Rvs X-Received: by 2002:a05:6a00:b92:b0:4f6:dfe0:9abb with SMTP id g18-20020a056a000b9200b004f6dfe09abbmr12600156pfj.68.1646692666652; Mon, 07 Mar 2022 14:37:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646692666; cv=none; d=google.com; s=arc-20160816; b=pdZAArzJi7dpUc3B5czPjRKLKj5PaycJVy7iFPOO5piVDiJjkDPTXhbVLiRDWyXncx VPH/HCxtuobKK4EEfJd7s9Z2/7WKeZrO+cCSRPaJtj+8Duf73tdYk5rSczazvbJOcTM0 kA11pQvB+Fz8eZaQMNCP8L4rOl0lNA9aLZQDbhitZUG6d2/l6DzpLOd+vKaseaQl5lUw 0MAgu8XCMqto0NWOlhrEhMUQwmIgNcA0+LMSryS2BiNkCw+JJL/SxEVjvxJSlejoqaVr 4CDrWVQcZ8XqMq8t89vSzvhTZRfx5w7KKHrDSlUtlrT73S/jNRnVT0rTDTOV5GI6IU0y U9qg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=LNVFxjbvNsBKat46FB1XSe/jv6v6oTV37e58Yq5lc0s=; b=oNipvbveC1fUtGqpOD7c82XuZ3cyGLucCK1YnlC8SUEhz0W/BftI8tuY3qCwVKsolV hCucSCH32zqxIwZYOgFDX6XfaU9w5nAzObsrTlolQXycYZKOCgcb1xF7mKOSnFCW48rt neMKGz57gDcq/rXwRrKFdnrCHZ0bKa+7sI7jYaphod+qSMVt01Q7mYWK11Axn0huOyT4 Ktm4899+9FH7Wu0dkLInEN1UVrkWPhJSlz6VjGug5fu80hwUd2ixLGE25e6vrlTxgPBk iwjmBS3LV7BuTIY69HednTmN/HGvUfhsHKJ2GD0Xphg1ldIFE6OPbzjYOkX/BzhOr75H gI1g== 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t9-20020a170902e84900b0014d820206c8si16227059plg.452.2022.03.07.14.37.30; Mon, 07 Mar 2022 14:37:46 -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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244537AbiCGSax (ORCPT + 99 others); Mon, 7 Mar 2022 13:30:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38288 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239158AbiCGSav (ORCPT ); Mon, 7 Mar 2022 13:30:51 -0500 Received: from gateway33.websitewelcome.com (gateway33.websitewelcome.com [192.185.145.4]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50D922FFD8 for ; Mon, 7 Mar 2022 10:29:56 -0800 (PST) Received: from cm14.websitewelcome.com (cm14.websitewelcome.com [100.42.49.7]) by gateway33.websitewelcome.com (Postfix) with ESMTP id 644E523A2C for ; Mon, 7 Mar 2022 12:29:53 -0600 (CST) Received: from gator4132.hostgator.com ([192.185.4.144]) by cmsmtp with SMTP id RI7Fnw3uWHnotRI7FnNHUj; Mon, 07 Mar 2022 12:29:53 -0600 X-Authority-Reason: nr=8 Received: from host-82-63-1-3.business.telecomitalia.it ([82.63.1.3]:49480 helo=[10.0.0.45]) by gator4132.hostgator.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1nRI7E-000kJQ-K0; Mon, 07 Mar 2022 12:29:52 -0600 Message-ID: <9132fe3d-8248-909d-9b6e-16fe9018dfd1@kernel.org> Date: Mon, 7 Mar 2022 19:29:49 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH v2] tracing/osnoise: Force quiescent states while tracing Content-Language: en-US To: rostedt@goodmis.org, paulmck@kernel.org, Nicolas Saenz Julienne Cc: mingo@redhat.com, linux-kernel@vger.kernel.org, mtosatti@redhat.com References: <20220307180740.577607-1-nsaenzju@redhat.com> From: Daniel Bristot de Oliveira In-Reply-To: <20220307180740.577607-1-nsaenzju@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator4132.hostgator.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - kernel.org X-BWhitelist: no X-Source-IP: 82.63.1.3 X-Source-L: No X-Exim-ID: 1nRI7E-000kJQ-K0 X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: host-82-63-1-3.business.telecomitalia.it ([10.0.0.45]) [82.63.1.3]:49480 X-Source-Auth: kernel@bristot.me X-Email-Count: 2 X-Source-Cap: YnJpc3RvdG1lO2JyaXN0b3RtZTtnYXRvcjQxMzIuaG9zdGdhdG9yLmNvbQ== X-Local-Domain: no X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_SOFTFAIL, T_SCC_BODY_TEXT_LINE autolearn=no 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 3/7/22 19:07, Nicolas Saenz Julienne wrote: > At the moment running osnoise on a nohz_full CPU or uncontested FIFO > priority and a PREEMPT_RCU kernel might have the side effect of > extending grace periods too much. This will entice RCU to force a > context switch on the wayward CPU to end the grace period, all while > introducing unwarranted noise into the tracer. This behaviour is > unavoidable as overly extending grace periods might exhaust the system's > memory. > > This same exact problem is what extended quiescent states (EQS) were > created for, conversely, rcu_momentary_dyntick_idle() emulates them by > performing a zero duration EQS. So let's make use of it. > > In the common case rcu_momentary_dyntick_idle() is fairly inexpensive: > atomically incrementing a local per-CPU counter and doing a store. So it > shouldn't affect osnoise's measurements (which has a 1us granularity), > so we'll call it unanimously. > > The uncommon case involve calling rcu_momentary_dyntick_idle() after > having the osnoise process: > > - Receive an expedited quiescent state IPI with preemption disabled or > during an RCU critical section. (activates rdp->cpu_no_qs.b.exp > code-path). > > - Being preempted within in an RCU critical section and having the > subsequent outermost rcu_read_unlock() called with interrupts > disabled. (t->rcu_read_unlock_special.b.blocked code-path). > > Neither of those are possible at the moment, and are unlikely to be in > the future given the osnoise's loop design. On top of this, the noise > generated by the situations described above is unavoidable, and if not > exposed by rcu_momentary_dyntick_idle() will be eventually seen in > subsequent rcu_read_unlock() calls or schedule operations. > > Fixes: bce29ac9ce0b ("trace: Add osnoise tracer") > Signed-off-by: Nicolas Saenz Julienne > Acked-by: Paul E. McKenney I've been running a preliminary version of this patch over the weekend, and it provides the desired behavior. Acked-by: Daniel Bristot de Oliveira Thanks! -- Daniel