Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp585890iob; Wed, 11 May 2022 23:29:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyD9MRnUfx74RGbPF3Hc+zI82D+yrP4oC5w8hFHgNCqcCUgnK7FEc+eOsAyYB2QqFAp5MNM X-Received: by 2002:a17:907:7f0c:b0:6fa:8f52:98fc with SMTP id qf12-20020a1709077f0c00b006fa8f5298fcmr15062066ejc.454.1652336972383; Wed, 11 May 2022 23:29:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652336972; cv=none; d=google.com; s=arc-20160816; b=TUx/PQ1GStG7H37cFK4UtMdnaRmoLT2QSOgY+BBmNFk2zJR48iu8oK6VGfcHVYkcf5 R43PjBqwybK8+3SwaKwovpLv0hvbOwOTzHQ05rT1XjripSNz2Ld8Du2O7ZKEKMBHtsfV H913OVEJulooCux4XcQ4m2izSqUHLCXn07WlGHVkZDRApIp9UDZvgUxdAAWKHLKygaAv PbNACmMmub4hZoqzGtEkGSe3GWv6uPDtHvu/7cK/J8WTV1xNrWihHNq6E0zLAiVVQfAw R9RAaly8g7v7layJYi9SFRx7VcNQu+jkHeuLiJjgp5rLG+3JFhVNLIErFxuY8fVlhV2K egow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:date:from:dkim-signature; bh=NoAC1uKh1fP80FhMwvvGoVXu863+vZrNjnh223XA2iI=; b=tamHyKJPYPMIA4pZ3KiN8dD6MTq9xI1kW7JVOa8AIOxhtyfuOagASE45ghWmnQ36jD PFDidVX6K3sO+BKwPzV4SIM5XGBuXd89TRlrMSJTd5Ebnj3Vaq7qp0TFA0meOgavlOyH cV7HBzaTQQ0lm6n/bWdSPYpjUGjL8/OLN+fZsXcrPbkSpGiW1djnAOsqhCItz508c5yB WsVXpduy2bu0O/IDsLYssxbyStUGPHwFGeiie2oBtyy4OVdLMj82a1zI8/Lp8mKUtRK0 VYPNd3QOS7vB0amm2MQksc00q9OwmfOi6uIBn2Z9iZhK/Ebda3yaOPuo8Efs4o/5j/zQ oWgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Dhr06uf6; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i6-20020a05640242c600b0041d053799bdsi6909152edc.493.2022.05.11.23.29.06; Wed, 11 May 2022 23:29:32 -0700 (PDT) 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; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Dhr06uf6; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243976AbiEKNkI (ORCPT + 99 others); Wed, 11 May 2022 09:40:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243965AbiEKNkE (ORCPT ); Wed, 11 May 2022 09:40:04 -0400 Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com [IPv6:2a00:1450:4864:20::129]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4D46B1D7341; Wed, 11 May 2022 06:40:02 -0700 (PDT) Received: by mail-lf1-x129.google.com with SMTP id w19so3604258lfu.11; Wed, 11 May 2022 06:40:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=NoAC1uKh1fP80FhMwvvGoVXu863+vZrNjnh223XA2iI=; b=Dhr06uf6hoFNALMaa0NX3XVynPQRiNCGPE9Hptj+SvPkGuDz4wFD1d1Ew3hOMmQ00q fSlezFUryYYF11AH714es6awPtulKuRJSls2jAP61dQEMrUIrt4cVYUPqGkVROsznEzF l6+Piz+0yvAKpZCHukvXo+7s/nAqmowIKscHQqHvBae8fcnhPMXilTMl+cMqvOQA9lwr qC+pZ+9gCk1UGz9xz/IWuzLaryZe6XA5zmdUR3DpeOCFyQBWMgIjEXswgjru1yufM7aM STomhR1fdZrfa65fRvF1XoQlRVpqcBaU6Jl2Y0QDctnkLXNm8Qyq1V/KBZTglEIqXjbO yMzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:date:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=NoAC1uKh1fP80FhMwvvGoVXu863+vZrNjnh223XA2iI=; b=O7N5c5rd3gQzjivif2kIhZVu/LTkDnVz3oqrYSrwsskk71t+2sc8nDHdZO2sW9oi2N TlsNxYD4le8IalQzaLDY/9vYnGOh+iyVngNH3mg5WfR2ATpN59jZsE69xT65fK+O1+gW +W55dsxn263q0VKTym3wMA4RdHEExCeJaDNuJEGL/r7MbUF9FUIKJpDYoFxHTyeaLhii J9T2SnH306JOkBmwJ7P6hxx1WieBkhZvWuBl1NHY6noKmobE6H1UkQKBooSheTTxgJn1 uGPmGW0MXfWxly8XPI8z/2Jfm3UVaXfpGWfO0GtzERMDDCrj35I4PqI4b2VdSmxcd4Cy AALQ== X-Gm-Message-State: AOAM531cBpn/TE1ipSw/Mk9GldYRUZIRO12p9qQgwjfUHfPfa3EGc8/b +mQavyTU7Y0V1Z3XcCqZv9k= X-Received: by 2002:a05:6512:1109:b0:473:e582:a60c with SMTP id l9-20020a056512110900b00473e582a60cmr20277756lfg.150.1652276400325; Wed, 11 May 2022 06:40:00 -0700 (PDT) Received: from pc638.lan ([155.137.26.201]) by smtp.gmail.com with ESMTPSA id s15-20020a19770f000000b0047255d211edsm286330lfc.284.2022.05.11.06.39.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 May 2022 06:39:58 -0700 (PDT) From: Uladzislau Rezki X-Google-Original-From: Uladzislau Rezki Date: Wed, 11 May 2022 15:39:56 +0200 To: Steven Rostedt Cc: Uladzislau Rezki , "Paul E. McKenney" , Joel Fernandes , Alison Chaiken , Sebastian Andrzej Siewior , LKML , RCU , Frederic Weisbecker , Neeraj Upadhyay , Oleksiy Avramchenko Subject: Re: [PATCH] rcu/nocb: Add an option to ON/OFF an offloading from RT context Message-ID: References: <20220507223247.GK1790663@paulmck-ThinkPad-P17-Gen-1> <20220508213222.GL1790663@paulmck-ThinkPad-P17-Gen-1> <20220509033740.GM1790663@paulmck-ThinkPad-P17-Gen-1> <20220509181417.GO1790663@paulmck-ThinkPad-P17-Gen-1> <20220510100135.62a4f7df@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220510100135.62a4f7df@gandalf.local.home> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Mon, 9 May 2022 20:28:26 +0200 > Uladzislau Rezki wrote: > > > I see that Paul would like to keep it for CONFIG_PREEMPT_RT, because it > > was mainly designed for that kind of kernels. So we can align with Alison > > patch and her decision, so i do not see any issues. So far RT folk seems > > does not mind in having "callback-kthreads" as SCHED_FIFO :) > > That's because RT folks set the threads they care about to a higher RT > priority than the kthreads. ;-) > That explains many things :) I have one question, it is partly related to the topic that is in question and to this thread also. I was tracing a "long" duration of the offloading kthreads which actually invoke them one by one. And the picture was like below from ftrace point of view: rcuop/6-54 [000] .N.. 183.753018: rcu_invoke_callback: rcu_preempt rhp=0xffffff88ffd440b0 func=__d_free.cfi_jt rcuop/6-54 [000] .N.. 183.753020: rcu_invoke_callback: rcu_preempt rhp=0xffffff892ffd8400 func=inode_free_by_rcu.cfi_jt rcuop/6-54 [000] .N.. 183.753021: rcu_invoke_callback: rcu_preempt rhp=0xffffff89327cd708 func=i_callback.cfi_jt ... rcuop/6-54 [000] .N.. 183.755941: rcu_invoke_callback: rcu_preempt rhp=0xffffff8993c5a968 func=i_callback.cfi_jt rcuop/6-54 [000] .N.. 183.755942: rcu_invoke_callback: rcu_preempt rhp=0xffffff8993c4bd20 func=__d_free.cfi_jt rcuop/6-54 [000] dN.. 183.755944: rcu_batch_end: rcu_preempt CBs-invoked=2112 idle=>c<>c<>c<>c< rcuop/6-54 [000] dN.. 183.755946: rcu_utilization: Start context switch rcuop/6-54 [000] dN.. 183.755946: rcu_utilization: End context switch i spent some time in order to understand why the context was not switched, even though the "rcuop" kthread was marked as TIF_NEED_RESCHED and an IPI was sent to the CPU_0 to reschedule. The last "." in latency field shows that a context has not disabled any preemption. So everything should be fine. An explanation is that a local_bh_disable() modifies the current_thread_info()->preempt.count so a task becomes non preemtable but the ftrace does not provide any signal about it. So i was fooled for some time by my tracer logs. Do you have any thoughts about it? Should it be solved or signaled somehow that a task in fact is not preemtable if a counter > 0? Thanks! -- Uladzislau Rezki