From patchwork Mon Jul 1 04:04:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Fernandes X-Patchwork-Id: 11024747 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1DC01112C for ; Mon, 1 Jul 2019 04:04:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 01D0E28346 for ; Mon, 1 Jul 2019 04:04:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E3E28284ED; Mon, 1 Jul 2019 04:04:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7D28828346 for ; Mon, 1 Jul 2019 04:04:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726920AbfGAEEW (ORCPT ); Mon, 1 Jul 2019 00:04:22 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:33906 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725616AbfGAEEW (ORCPT ); Mon, 1 Jul 2019 00:04:22 -0400 Received: by mail-pl1-f195.google.com with SMTP id i2so6600150plt.1 for ; Sun, 30 Jun 2019 21:04:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=qybcP71evSZ3Czn0uZ7CwmogDfy9EhMz13IGHYQ9cik=; b=v/51NHIUki6YLjlvVPl3Jkfy7LUXWmK+iv3xk/Yp5JXZfN1742/jzEvBIYfRQKD8nZ ZAoHAoVAOPwhteWQ+O8bq5IIwUuoqa5AaYkLo+24ZtRhoUoQkVBZADwqS64JFYX6WytD X0ReoI/87B2gO5zL342T39V9EKj51eCT+uqLc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=qybcP71evSZ3Czn0uZ7CwmogDfy9EhMz13IGHYQ9cik=; b=NIH9lXo5HvMf36wvrEgsXULCOf7IAs2qb+THWksUXyk+76dtfLqWmoAF/jTKlPfpav 3WHxvoO0emHZZZF9ioGt2ut+wNv8/KXHgMScba8oc/tDG97c067yINZe7ynlvtza95WR VbtaTgvRdFDmdJ2S6b3n4txIo57q4lELM2zJ3ZKrneCA2Wkbv5ENhecxpyWFgsmLv2HE IswXmOTJtpmQCzpgCwcQwM4hYO+ROwE0nu69IQttY7wqUB8ScuexsBRExPCqpZTp3Vay zCwUoaS4+W+iR2axCv1iI8fLOplLsvlvziZVrn5xtgCrSSU1WghA3sfJUwAqRM5cOMF9 qyVw== X-Gm-Message-State: APjAAAVZ9+seq7/KmG2xk8RibJ0VofjthF/AS2QMD1gthcMruNkVmOaj GjEgExq7PXrrDT9cpcK2j5ja4Q== X-Google-Smtp-Source: APXvYqwR9FE1833UFgkphzpSnzxNBVxKDsrfEsL+IpRiKj6qQ2Q0E4uUpp8v0bAB1+jNqfjBrOsa5w== X-Received: by 2002:a17:902:70c3:: with SMTP id l3mr26445926plt.248.1561953860960; Sun, 30 Jun 2019 21:04:20 -0700 (PDT) Received: from joelaf.cam.corp.google.com ([2620:15c:6:12:9c46:e0da:efbf:69cc]) by smtp.gmail.com with ESMTPSA id w1sm10841305pjt.30.2019.06.30.21.04.18 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sun, 30 Jun 2019 21:04:20 -0700 (PDT) From: "Joel Fernandes (Google)" To: linux-kernel@vger.kernel.org Cc: "Joel Fernandes (Google)" , Josh Triplett , kernel-team@android.com, Lai Jiangshan , linux-kselftest@vger.kernel.org, Mathieu Desnoyers , "Paul E. McKenney" , rcu@vger.kernel.org, Sebastian Andrzej Siewior , Shuah Khan , Steven Rostedt Subject: [RFC 1/3] rcu: Expedite the rcu quiescent state reporting if help needed Date: Mon, 1 Jul 2019 00:04:13 -0400 Message-Id: <20190701040415.219001-1-joel@joelfernandes.org> X-Mailer: git-send-email 2.22.0.410.gd8fdbe21b5-goog MIME-Version: 1.0 Sender: linux-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The t->rcu_read_unlock_special union's need_qs bit can be set by the scheduler tick (in rcu_flavor_sched_clock_irq) to indicate that help is needed from the rcu_read_unlock path. When this help arrives however, we can do better to speed up the quiescent state reporting which if rcu_read_unlock_special::need_qs is set might be quite urgent. Make use of this information in deciding when to do heavy-weight softirq raising where possible. Signed-off-by: Joel Fernandes (Google) --- kernel/rcu/tree_plugin.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h index c588ef98efd3..bff6410fac06 100644 --- a/kernel/rcu/tree_plugin.h +++ b/kernel/rcu/tree_plugin.h @@ -622,7 +622,8 @@ static void rcu_read_unlock_special(struct task_struct *t) t->rcu_read_unlock_special.b.exp_hint = false; exp = (t->rcu_blocked_node && t->rcu_blocked_node->exp_tasks) || (rdp->grpmask & rnp->expmask) || - tick_nohz_full_cpu(rdp->cpu); + tick_nohz_full_cpu(rdp->cpu) || + t->rcu_read_unlock_special.b.need_qs; // Need to defer quiescent state until everything is enabled. if (irqs_were_disabled && use_softirq && (in_interrupt() ||