Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp32076ybb; Fri, 27 Mar 2020 15:27:04 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsNJ9amtqMPJl9kOYvLyZ/XkqcCco3gTviNGprXbsoFmr0xgzZI4gBJDdjnqR03mIgt6nQE X-Received: by 2002:a54:4e8b:: with SMTP id c11mr859080oiy.136.1585348024230; Fri, 27 Mar 2020 15:27:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585348024; cv=none; d=google.com; s=arc-20160816; b=MVr/ZYdpX7rGCzUJgNH6MYWYt/KXKWg54r45+xekg0WoHAHNQilB8e82j22JisO9q0 5j32ui0SZp8wxB7UzUF6HzzaHdabKTkMb3IYTBowAoK3NfHQC6PVrmHqPk/siKacNtvS c1uZM6eC8OrLa4j0857V9XLG8XU9EKHQ0/tZ+4HalPHiR9kHeoOMVeRzBD13zQpSNSLh etIq2ZmXW/yBk/rs4ClcxVYRt0XNdKUC5SHi2A5O11OYlPjxWP9Td7QU+lLVSZVq/Yu8 EZv4WpPbaBWIqNOofB7NVK7VK6TIqLsyvmajZgSK0k3MzP/EBR5mNzVrbrVsUZ+SqAC3 WHyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=64mRZSpMoFMxyV9+41A5dJIerQn7kK8D1Vm0bv9/7H4=; b=KfvuI8Pdzfz+kgWxSqwPsBU1xw1sG7ufLHqsg4+bUNfctAzfiPsV3vso0M7R85fYO6 NDCR9ONHMR8FYPkfCtE8Oz4ni3Ugy6w3HnrYYVgvMagpEHzk0jEP7Mjn9XTAUbhsLfaN yklRyCMQUHvuTIFsPtNeXyrqDpoML9eFSUtg9u8w2cjIYqRoM8v8pFTaPH7O2DSgC4Tt ARhUgMH0IDZTWtCi8lBBI2a7FIWqVzXMPVIzRUNiDsM7B3to3vcfxMTzwrh8AfYd3KFL Oz+xNUIXVrHODmog8AtvJ7nRzIUoZ+q5tn/wki525bRsy/drAltrS1ureO5ESb+hbKht d5Fg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Izf6c6yz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u199si2719036oif.110.2020.03.27.15.26.51; Fri, 27 Mar 2020 15:27:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Izf6c6yz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1728043AbgC0WZp (ORCPT + 99 others); Fri, 27 Mar 2020 18:25:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:43394 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727878AbgC0WZJ (ORCPT ); Fri, 27 Mar 2020 18:25:09 -0400 Received: from paulmck-ThinkPad-P72.home (50-39-105-78.bvtn.or.frontiernet.net [50.39.105.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5E3C2218AC; Fri, 27 Mar 2020 22:25:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585347908; bh=xmpPXkhiLbhrjsXBBcsPOaQA+awYMXNedi+3mo3OqIg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Izf6c6yzMF5k6BVic5e/zHcV5IiG70GX0wOmt+KZsUGY2kChc2ETv/MZZBmu+7V2Z fgcMiQ8n96g2bGvlraeczf58BfkDNkvytwSVdnDsPijEps28Wujf4746BE7g+EYJze 7lIp8BkLoElmSebwUUKxtp+1to5ykqf+O66OLKmw= From: paulmck@kernel.org To: rcu@vger.kernel.org Cc: linux-kernel@vger.kernel.org, kernel-team@fb.com, mingo@kernel.org, jiangshanlai@gmail.com, dipankar@in.ibm.com, akpm@linux-foundation.org, mathieu.desnoyers@efficios.com, josh@joshtriplett.org, tglx@linutronix.de, peterz@infradead.org, rostedt@goodmis.org, dhowells@redhat.com, edumazet@google.com, fweisbec@gmail.com, oleg@redhat.com, joel@joelfernandes.org, "Paul E. McKenney" Subject: [PATCH v3 tip/core/rcu 30/34] rcu-tasks: Make RCU tasks trace also wait for idle tasks Date: Fri, 27 Mar 2020 15:24:52 -0700 Message-Id: <20200327222456.12470-30-paulmck@kernel.org> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20200327222346.GA12082@paulmck-ThinkPad-P72> References: <20200327222346.GA12082@paulmck-ThinkPad-P72> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: "Paul E. McKenney" This commit scans the CPUs, adding each CPU's idle task to the list of tasks that need quiescent states. Signed-off-by: Paul E. McKenney --- kernel/rcu/tasks.h | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/kernel/rcu/tasks.h b/kernel/rcu/tasks.h index d1fa7715..27d2458 100644 --- a/kernel/rcu/tasks.h +++ b/kernel/rcu/tasks.h @@ -15,7 +15,7 @@ struct rcu_tasks; typedef void (*rcu_tasks_gp_func_t)(struct rcu_tasks *rtp); typedef void (*pregp_func_t)(void); typedef void (*pertask_func_t)(struct task_struct *t, struct list_head *hop); -typedef void (*postscan_func_t)(void); +typedef void (*postscan_func_t)(struct list_head *hop); typedef void (*holdouts_func_t)(struct list_head *hop, bool ndrpt, bool *frptp); typedef void (*postgp_func_t)(struct rcu_tasks *rtp); @@ -331,7 +331,7 @@ static void rcu_tasks_wait_gp(struct rcu_tasks *rtp) rcu_read_unlock(); set_tasks_gp_state(rtp, RTGS_POST_SCAN_TASKLIST); - rtp->postscan_func(); + rtp->postscan_func(&holdouts); /* * Each pass through the following loop scans the list of holdout @@ -415,7 +415,7 @@ static void rcu_tasks_pertask(struct task_struct *t, struct list_head *hop) } /* Processing between scanning taskslist and draining the holdout list. */ -void rcu_tasks_postscan(void) +void rcu_tasks_postscan(struct list_head *hop) { /* * Wait for tasks that are in the process of exiting. This @@ -932,9 +932,17 @@ static void rcu_tasks_trace_pertask(struct task_struct *t, trc_wait_for_one_reader(t, hop); } -/* Do intermediate processing between task and holdout scans. */ -static void rcu_tasks_trace_postscan(void) +/* + * Do intermediate processing between task and holdout scans and + * pick up the idle tasks. + */ +static void rcu_tasks_trace_postscan(struct list_head *hop) { + int cpu; + + for_each_possible_cpu(cpu) + rcu_tasks_trace_pertask(idle_task(cpu), hop); + // Re-enable CPU hotplug now that the tasklist scan has completed. cpus_read_unlock(); -- 2.9.5