From patchwork Wed Oct 31 03:46:31 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Paul E. McKenney" X-Patchwork-Id: 12626 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id DA7A923E01 for ; Wed, 31 Oct 2012 03:46:41 +0000 (UTC) Received: from mail-ia0-f180.google.com (mail-ia0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id 54954A1837B for ; Wed, 31 Oct 2012 03:46:41 +0000 (UTC) Received: by mail-ia0-f180.google.com with SMTP id f6so701478iag.11 for ; Tue, 30 Oct 2012 20:46:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-content-scanned:x-cbid:x-gm-message-state; bh=/CvfXf9kZrC1IeaYmDRdeMw+kQ6R2Tsq3HcPY6S3zhU=; b=KbTAYFCjBcK+FX25kALqHBeju8fbb2eCE0PdafD+cwRxCgyy3+mAlc62PksBCQq9+q 1KiiiLkmpu4XDcUZGMn6/AD9aPy46B8sIdtSzm5qDgmh+0TlZ46aSEjBQB8iyZe/zk+O 8OMmWhTpxRIInbCc/qeERqBNI/wzHhE9bC5lKoGkTYT+q8+cD40Rr/JUC21szbI4qtbI LpWhgF/gzzkSmm2xuExYG8NXKtYlff2qg/7ZGZ0z4UFmsrQwHtmmlN/Sgi1eFwGs/ln9 fArUYBoCHrWnzvz/gD7lt0JgisltjKHYGgbnKPqFnm2p79o/61aJfl6y1qWpa1IGkvgQ 7hKg== Received: by 10.50.46.226 with SMTP id y2mr181388igm.62.1351655200749; Tue, 30 Oct 2012 20:46:40 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.67.148 with SMTP id n20csp549810igt; Tue, 30 Oct 2012 20:46:40 -0700 (PDT) Received: by 10.43.104.200 with SMTP id dn8mr30205987icc.43.1351655200187; Tue, 30 Oct 2012 20:46:40 -0700 (PDT) Received: from e7.ny.us.ibm.com (e7.ny.us.ibm.com. [32.97.182.137]) by mx.google.com with ESMTPS id ng8si2628870icb.33.2012.10.30.20.46.39 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 30 Oct 2012 20:46:40 -0700 (PDT) Received-SPF: pass (google.com: domain of paulmck@linux.vnet.ibm.com designates 32.97.182.137 as permitted sender) client-ip=32.97.182.137; Authentication-Results: mx.google.com; spf=pass (google.com: domain of paulmck@linux.vnet.ibm.com designates 32.97.182.137 as permitted sender) smtp.mail=paulmck@linux.vnet.ibm.com Received: from /spool/local by e7.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 30 Oct 2012 23:46:39 -0400 Received: from d01dlp03.pok.ibm.com (9.56.250.168) by e7.ny.us.ibm.com (192.168.1.107) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 30 Oct 2012 23:46:37 -0400 Received: from d01relay04.pok.ibm.com (d01relay04.pok.ibm.com [9.56.227.236]) by d01dlp03.pok.ibm.com (Postfix) with ESMTP id E2E10C90042; Tue, 30 Oct 2012 23:46:36 -0400 (EDT) Received: from d03av01.boulder.ibm.com (d03av01.boulder.ibm.com [9.17.195.167]) by d01relay04.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q9V3kaDe294704; Tue, 30 Oct 2012 23:46:36 -0400 Received: from d03av01.boulder.ibm.com (loopback [127.0.0.1]) by d03av01.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q9V3kYs2024230; Tue, 30 Oct 2012 21:46:36 -0600 Received: from paulmck-ThinkPad-W500 ([9.49.209.24]) by d03av01.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q9V3kWv2024186; Tue, 30 Oct 2012 21:46:33 -0600 Received: by paulmck-ThinkPad-W500 (Postfix, from userid 1000) id 090FCE4DB2; Tue, 30 Oct 2012 20:46:32 -0700 (PDT) From: "Paul E. McKenney" To: linux-kernel@vger.kernel.org Cc: mingo@elte.hu, laijs@cn.fujitsu.com, dipankar@in.ibm.com, akpm@linux-foundation.org, mathieu.desnoyers@polymtl.ca, josh@joshtriplett.org, niv@us.ibm.com, tglx@linutronix.de, peterz@infradead.org, rostedt@goodmis.org, Valdis.Kletnieks@vt.edu, dhowells@redhat.com, edumazet@google.com, darren@dvhart.com, fweisbec@gmail.com, sbw@mit.edu, patches@linaro.org, joe.korty@ccur.com, "Paul E. McKenney" , "Paul E. McKenney" Subject: [PATCH tip/core/rcu 2/2] rcu: Separate accounting of callbacks from callback-free CPUs Date: Tue, 30 Oct 2012 20:46:31 -0700 Message-Id: <1351655191-2648-2-git-send-email-paulmck@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.8 In-Reply-To: <1351655191-2648-1-git-send-email-paulmck@linux.vnet.ibm.com> References: <20121031034552.GA1999@linux.vnet.ibm.com> <1351655191-2648-1-git-send-email-paulmck@linux.vnet.ibm.com> X-Content-Scanned: Fidelis XPS MAILER x-cbid: 12103103-5806-0000-0000-00001B391438 X-Gm-Message-State: ALoCoQlpMNqPlKIUa4iHM0NbYdV+b9xxBEb/yJwBQ1hZRx5GaUFAUK01dfi35/jcx9hjeV1464VI From: "Paul E. McKenney" Currently, callback invocations from callback-free CPUs are accounted to the CPU that registered the callback, but using the same field that is used for normal callbacks. This makes it impossible to determine from debugfs output whether callbacks are in fact being diverted. This commit therefore adds a separate ->n_nocbs_invoked field in the rcu_data structure in which diverted callback invocations are counted. RCU's debugfs tracing still displays normal callback invocations using ci=, but displayed diverted callbacks with nci=. Signed-off-by: Paul E. McKenney Signed-off-by: Paul E. McKenney --- kernel/rcutree.h | 1 + kernel/rcutree_plugin.h | 2 +- kernel/rcutree_trace.c | 5 +++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/kernel/rcutree.h b/kernel/rcutree.h index 79954bb..db9bec8 100644 --- a/kernel/rcutree.h +++ b/kernel/rcutree.h @@ -287,6 +287,7 @@ struct rcu_data { long qlen_last_fqs_check; /* qlen at last check for QS forcing */ unsigned long n_cbs_invoked; /* count of RCU cbs invoked. */ + unsigned long n_nocbs_invoked; /* count of no-CBs RCU cbs invoked. */ unsigned long n_cbs_orphaned; /* RCU cbs orphaned by dying CPU */ unsigned long n_cbs_adopted; /* RCU cbs adopted from dying CPU */ unsigned long n_force_qs_snap; diff --git a/kernel/rcutree_plugin.h b/kernel/rcutree_plugin.h index ea960c4..31d3a95 100644 --- a/kernel/rcutree_plugin.h +++ b/kernel/rcutree_plugin.h @@ -2406,7 +2406,7 @@ static int rcu_nocb_kthread(void *arg) trace_rcu_batch_end(rdp->rsp->name, c, !!list, 0, 0, 1); ACCESS_ONCE(rdp->nocb_p_count) -= c; ACCESS_ONCE(rdp->nocb_p_count_lazy) -= cl; - rdp->n_cbs_invoked += c; + rdp->n_nocbs_invoked += c; } return 0; } diff --git a/kernel/rcutree_trace.c b/kernel/rcutree_trace.c index 5e9ca3e..167375d 100644 --- a/kernel/rcutree_trace.c +++ b/kernel/rcutree_trace.c @@ -146,8 +146,9 @@ static void print_one_rcu_data(struct seq_file *m, struct rcu_data *rdp) per_cpu(rcu_cpu_kthread_loops, rdp->cpu) & 0xffff); #endif /* #ifdef CONFIG_RCU_BOOST */ seq_printf(m, " b=%ld", rdp->blimit); - seq_printf(m, " ci=%lu co=%lu ca=%lu\n", - rdp->n_cbs_invoked, rdp->n_cbs_orphaned, rdp->n_cbs_adopted); + seq_printf(m, " ci=%lu nci=%lu co=%lu ca=%lu\n", + rdp->n_cbs_invoked, rdp->n_nocbs_invoked, + rdp->n_cbs_orphaned, rdp->n_cbs_adopted); } static int show_rcudata(struct seq_file *m, void *v)