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() || From patchwork Mon Jul 1 04:04:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Fernandes X-Patchwork-Id: 11024749 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 255CB1580 for ; Mon, 1 Jul 2019 04:04:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 172E828346 for ; Mon, 1 Jul 2019 04:04:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0B003284FC; Mon, 1 Jul 2019 04:04:28 +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 A742528346 for ; Mon, 1 Jul 2019 04:04:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727047AbfGAEEY (ORCPT ); Mon, 1 Jul 2019 00:04:24 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:36353 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727300AbfGAEEX (ORCPT ); Mon, 1 Jul 2019 00:04:23 -0400 Received: by mail-pf1-f195.google.com with SMTP id r7so5863706pfl.3 for ; Sun, 30 Jun 2019 21:04:23 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=6qXJPxYAnauV783BSNoiICPinJN47nYOdh3JYZXZjUY=; b=lKcpczd8fUzta/BytKyak8CozJjmS5tCRzUTEv7mLNT8zw7YgStF/XAgnGdAP2pwax xnveCcblDRFDpvtyjwBbp/bOevnuA5Ka6sAk57SBUNuX86/3VqlUdGHa5mEF1FP+4z3x pNELFZvs3hzcgfYvTPzZ0RwViUMV0VgjX+jNU= 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=6qXJPxYAnauV783BSNoiICPinJN47nYOdh3JYZXZjUY=; b=c0k021xIX3sf2fSw5o/TNF2PWE+du7tzunGNKtZ9Swe75igIo9z5cYvLIt5VAvSFRd cWjEXSX/Uq6UYRoDsI0D0XKVifliGJDNldMDPvR/Wb0rNkEXAdl+ORbqS8/XUU1llBgx 8Aiv1eoNQ0+BmjElJWGf4875umufTVcZCKe85YPQ9/YbcJagQPGjNny34feu8+Bn4ncw VWooedve98la0GUExPKxn/tXAPcFfK5UdO3qF+Ab/we/YgzTlesbVpxFpmxgR7d3HWpu uxp610h9xqcD+8JkAiLNlxC6gTK4GA76N9lUpiF5O2XSAdROhr5wBMLZXTtcoKfPnRbi 1EsA== X-Gm-Message-State: APjAAAUv7z0hjgXHM3P4YH/zsXNB8CjZ7EwnA5MBPVXZGQuJuhsVHQSI DSI/z+If1DEj7F1dN/sqS6POpg== X-Google-Smtp-Source: APXvYqwMPLyTUUEqZ2JAh0LEcgaDjLdoe3238I5iJJhjH9Ia8lGZLiH73Xc8d2j9wopbeCVOqGOeFQ== X-Received: by 2002:a17:90a:1c17:: with SMTP id s23mr28762222pjs.108.1561953863102; Sun, 30 Jun 2019 21:04:23 -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.21 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sun, 30 Jun 2019 21:04:22 -0700 (PDT) From: "Joel Fernandes (Google)" To: linux-kernel@vger.kernel.org Cc: "Joel Fernandes (Google)" , rcu@vger.kernel.org, kernel-team@android.com, Josh Triplett , Lai Jiangshan , linux-kselftest@vger.kernel.org, Mathieu Desnoyers , "Paul E. McKenney" , Sebastian Andrzej Siewior , Shuah Khan , Steven Rostedt Subject: [RFC 2/3] rcu: Simplify rcu_note_context_switch exit from critical section Date: Mon, 1 Jul 2019 00:04:14 -0400 Message-Id: <20190701040415.219001-2-joel@joelfernandes.org> X-Mailer: git-send-email 2.22.0.410.gd8fdbe21b5-goog In-Reply-To: <20190701040415.219001-1-joel@joelfernandes.org> References: <20190701040415.219001-1-joel@joelfernandes.org> 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 rcu_preempt_note_context_switch() tries to handle cases where __rcu_read_unlock() got preempted and then the context switch path does the reporting of the quiscent state along with clearing any bits in the rcu_read_unlock_special union. This can be handled by just calling rcu_deferred_qs() which was added during the RCU consolidation work and already does these checks. Tested RCU config TREE03 for an hour which succeeds. Cc: rcu@vger.kernel.org Cc: kernel-team@android.com Signed-off-by: Joel Fernandes (Google) --- kernel/rcu/tree_plugin.h | 9 --------- 1 file changed, 9 deletions(-) diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h index bff6410fac06..ebb4d46a6267 100644 --- a/kernel/rcu/tree_plugin.h +++ b/kernel/rcu/tree_plugin.h @@ -313,15 +313,6 @@ void rcu_note_context_switch(bool preempt) ? rnp->gp_seq : rcu_seq_snap(&rnp->gp_seq)); rcu_preempt_ctxt_queue(rnp, rdp); - } else if (t->rcu_read_lock_nesting < 0 && - t->rcu_read_unlock_special.s) { - - /* - * Complete exit from RCU read-side critical section on - * behalf of preempted instance of __rcu_read_unlock(). - */ - rcu_read_unlock_special(t); - rcu_preempt_deferred_qs(t); } else { rcu_preempt_deferred_qs(t); } From patchwork Mon Jul 1 04:04:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Fernandes X-Patchwork-Id: 11024751 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 540EB746 for ; Mon, 1 Jul 2019 04:04:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 42D6328346 for ; Mon, 1 Jul 2019 04:04:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 374C3284ED; Mon, 1 Jul 2019 04:04:28 +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 C76DD284DA for ; Mon, 1 Jul 2019 04:04:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727360AbfGAEE0 (ORCPT ); Mon, 1 Jul 2019 00:04:26 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:34614 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727303AbfGAEEZ (ORCPT ); Mon, 1 Jul 2019 00:04:25 -0400 Received: by mail-pg1-f195.google.com with SMTP id p10so5345575pgn.1 for ; Sun, 30 Jun 2019 21:04:25 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=Jy/K9h1um5pl+8SDvWEqL6+5KT54XouLblV746P0ug4=; b=u84Sii5aAkBvGlPfBDUEFlgzWi9pe/R8agHeC9cZDawsEvVr//eP4lbs319tS7MB+i QOphyTpWRhB92FW2gofqOe6B7/CBXpE5N4uRQQaCnTbXxHoIMZGYSLBUw3o2TvY3QAaF TZvXL0aKUkdSOgS71c1JNmf+geptZjHeKrEqo= 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=Jy/K9h1um5pl+8SDvWEqL6+5KT54XouLblV746P0ug4=; b=f0mAKCzrBsYBIOkshPEXD8f9QcsKyg9VUIBWrcWuekKp/z7rH4JtvfHS9Pv15MEJGF K4XklY5cMLdf8775oiH0dO47596bl2/zKjc0BSteOiV76ORQ+SwJHnoydIB+3lvXTM8b IwQ0Rq8c0pqBSHwX3aud6pck46x/qmA1PhRoUd34g0VODrPCRzOYjIxtyhGvF6wEo3SU tf+4CcFy4spxr58gEI8UKejcVrQDleScAB+trkWTVRnTGIwohVCr+ZMl0qOJBfSTJf4n LwGD7yqZzbE4M1zT5khWt6WuBn428VSPCs3LN/yls+DFKD6Gy/1PgImlcdXB40KKeX3s u2xA== X-Gm-Message-State: APjAAAW/WVnrN8Vy+PcqS7d08Skj7BkMCN9lK6fVidZ2+kcK4SRJWryO vn3c8VKT6DsK6sw/5HSdaYjS0Q== X-Google-Smtp-Source: APXvYqz7Htdbd6b36gdXr2EmEP4Fdix5WXB90ZCvu4Hf3VsWtGkMTcw8H7gq6+NbImTPXG9SZmJJRg== X-Received: by 2002:a63:4554:: with SMTP id u20mr16528634pgk.406.1561953865200; Sun, 30 Jun 2019 21:04:25 -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.23 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sun, 30 Jun 2019 21:04:24 -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 3/3] Revert "rcutorture: Tweak kvm options" Date: Mon, 1 Jul 2019 00:04:15 -0400 Message-Id: <20190701040415.219001-3-joel@joelfernandes.org> X-Mailer: git-send-email 2.22.0.410.gd8fdbe21b5-goog In-Reply-To: <20190701040415.219001-1-joel@joelfernandes.org> References: <20190701040415.219001-1-joel@joelfernandes.org> 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 This reverts commit a6fda6dab93c2c06ef4b8cb4b9258df6674d2438 which causes kvm.sh to not run on my machines. The qemu-system-x86_64 command runs but does nothing. Signed-off-by: Joel Fernandes (Google) --- I am Ok if we want to drop this patch but it is in my tree because without it I can't run the tests. tools/testing/selftests/rcutorture/bin/functions.sh | 13 +------------ .../selftests/rcutorture/configs/rcu/CFcommon | 3 --- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/tools/testing/selftests/rcutorture/bin/functions.sh b/tools/testing/selftests/rcutorture/bin/functions.sh index c3a49fb4d6f6..6bcb8b5b2ff2 100644 --- a/tools/testing/selftests/rcutorture/bin/functions.sh +++ b/tools/testing/selftests/rcutorture/bin/functions.sh @@ -172,7 +172,7 @@ identify_qemu_append () { local console=ttyS0 case "$1" in qemu-system-x86_64|qemu-system-i386) - echo selinux=0 initcall_debug debug + echo noapic selinux=0 initcall_debug debug ;; qemu-system-aarch64) console=ttyAMA0 @@ -191,19 +191,8 @@ identify_qemu_append () { # Output arguments for qemu arguments based on the TORTURE_QEMU_MAC # and TORTURE_QEMU_INTERACTIVE environment variables. identify_qemu_args () { - local KVM_CPU="" - case "$1" in - qemu-system-x86_64) - KVM_CPU=kvm64 - ;; - qemu-system-i386) - KVM_CPU=kvm32 - ;; - esac case "$1" in qemu-system-x86_64|qemu-system-i386) - echo -machine q35,accel=kvm - echo -cpu ${KVM_CPU} ;; qemu-system-aarch64) echo -machine virt,gic-version=host -cpu host diff --git a/tools/testing/selftests/rcutorture/configs/rcu/CFcommon b/tools/testing/selftests/rcutorture/configs/rcu/CFcommon index e19a444a0684..d2d2a86139db 100644 --- a/tools/testing/selftests/rcutorture/configs/rcu/CFcommon +++ b/tools/testing/selftests/rcutorture/configs/rcu/CFcommon @@ -1,5 +1,2 @@ CONFIG_RCU_TORTURE_TEST=y CONFIG_PRINTK_TIME=y -CONFIG_HYPERVISOR_GUEST=y -CONFIG_PARAVIRT=y -CONFIG_KVM_GUEST=y