Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp2799207imw; Sun, 17 Jul 2022 17:33:12 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tmN+RLJZV2eJuAM10dV/H8hJVOJTZzb06HS8PCXlU+1f/SlPByCmgD95cNk7damjka4uDB X-Received: by 2002:a05:6402:1e92:b0:43a:7cd0:6bed with SMTP id f18-20020a0564021e9200b0043a7cd06bedmr34086909edf.423.1658104392616; Sun, 17 Jul 2022 17:33:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658104392; cv=none; d=google.com; s=arc-20160816; b=h48xz3pmKbGPu1AidCYiW7j+aP3AmpecXYsnaWJyj57e/tpS7Azxu9FiLzixO258Bo PSdzvWM6HXgmFqWAopd7GE7L/c/jB5CHSRupIyNF8qER8TEVAEJd4TQL0TuEy8jdC1r/ xbEPwvbRGhYjE7EwYRmFlytiMBV3MXXd+8DxogoVLxMlhEz7dAzyDAnuhZqaTNJQ7YMd 8dgabAk2vL6YfKWZAxPXIb0VMGwVsH83gFunwvMV6iz5i/56Kp2m2l2BGt8f7qFmNBlG LFB+BxOqcfbe/xDITlhyBVKDwjVlhe7oJGxPBtCCgckC9Y0U6sSq47ySW+0R9dFsMXil jAxw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=xSyz2uwUTiMyxAgkrXdLfSK8D9xKgcLl3g4LUnfBPH0=; b=OvIIy95a1dlsF6xpG9C3CfEWInTh1eziF47odotQPsy5mL1l5ybtTzD1r3SvoEu1rY /HXgnchwi6jvPa6ApKHoAWWBMMIXx0QORo5Ku4LqEbEe1OAjXrOGnEo1WZxTPIQrlLku YO2MnHaVB7pbnZ7+sSspUGkB6Eid4YU+3GRONKDP9p31yQnUnGhN5d5czMancRBPeGvv YutDyevxbbI8GFvPe/5+7V2/FtW9P1+h77GeWkvvFjPlQhofo47oHDBgj2NzehBhCABi QJFn4tHywL974tdM0rtbpdfyL1C5PlrjLlrh2zkdx8TDKgT9ugmNWmvIUejYeKyGZwK6 b9pw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=XYrICF4R; 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=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qa32-20020a17090786a000b0072b02ef4ae9si13909550ejc.618.2022.07.17.17.32.44; Sun, 17 Jul 2022 17:33:12 -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=@intel.com header.s=Intel header.b=XYrICF4R; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230504AbiGRALY (ORCPT + 99 others); Sun, 17 Jul 2022 20:11:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53558 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229535AbiGRALW (ORCPT ); Sun, 17 Jul 2022 20:11:22 -0400 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1FD81146B; Sun, 17 Jul 2022 17:11:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1658103078; x=1689639078; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=MhMxb972lT1cyCuWW992BzqSN/Kx1SNbxlpLCrfKF+w=; b=XYrICF4RWumwHtDKIwKgJB+ZIDO1O4fTLw9VD+VtpJswPjbKJ5dNUJ/H J24xNPgN4EpnKeq1wBae4JCLINg8N8bjDIQ7KoFiEyUrDHotbblfHZnMY 4Xqp9KfVHiNEXA7xKAGIjejHR6Bq7rpgAUVo7iAEYO5zTiaozMmxxpaeX G8FMlSFhmXiPlpSc1X6arWPZbDUjcQXg2NrxUNMuz8TPHQIlbJIX3z4lA qHRO3wUUH7gc79CLsaMh4KnCLjFvvSN+024EuLn6NVmnyXifFh0Jx53MW 6dSgCHMQX2ry9AOR9GIIIa1y1j6xunZ6v6lijF/8RRo5lM3WrIH6sQeT7 A==; X-IronPort-AV: E=McAfee;i="6400,9594,10411"; a="287246508" X-IronPort-AV: E=Sophos;i="5.92,280,1650956400"; d="scan'208";a="287246508" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Jul 2022 17:11:18 -0700 X-IronPort-AV: E=Sophos;i="5.92,280,1650956400"; d="scan'208";a="655048444" Received: from zq-optiplex-7090.bj.intel.com ([10.238.156.125]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Jul 2022 17:11:16 -0700 From: Zqiang To: paulmck@kernel.org, frederic@kernel.org, quic_neeraju@quicinc.com, joel@joelfernandes.org Cc: rcu@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] rcu-tasks: Make RCU Tasks Trace checking for userspace execution Date: Mon, 18 Jul 2022 08:16:10 +0800 Message-Id: <20220718001610.263700-1-qiang1.zhang@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE 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 For RCU tasks trace, the userspace execution is also a valid quiescent state, if the task is in userspace, the ->trc_reader_nesting should be zero and if the ->trc_reader_special.b.need_qs is not set, set the tasks ->trc_reader_special.b.need_qs is TRC_NEED_QS_CHECKED, this cause grace-period kthread remove it from holdout list if it remains here. This commit add rcu_tasks_trace_qs() to rcu_flavor_sched_clock_irq() when the kernel built with no PREEMPT_RCU. Signed-off-by: Zqiang --- v1->v2: Fix build error due to undeclared rcu_tasks_trace_qs(), note in no-PREEMPT_RCU kernel, the RCU Tasks is replaced by RCU, so rcu_note_voluntary_context_switch() only include rcu_tasks_trace_qs(). kernel/rcu/tree_plugin.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h index 4152816dd29f..5fb0b2dd24fd 100644 --- a/kernel/rcu/tree_plugin.h +++ b/kernel/rcu/tree_plugin.h @@ -976,7 +976,7 @@ static void rcu_flavor_sched_clock_irq(int user) * neither access nor modify, at least not while the * corresponding CPU is online. */ - + rcu_note_voluntary_context_switch(current); rcu_qs(); } } -- 2.25.1