From patchwork Tue Oct 30 17:05:04 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: 12622 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 10A4923F56 for ; Tue, 30 Oct 2012 17:36:31 +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 8E45AA18FF9 for ; Tue, 30 Oct 2012 17:36:30 +0000 (UTC) Received: by mail-ia0-f180.google.com with SMTP id f6so354282iag.11 for ; Tue, 30 Oct 2012 10:36:30 -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=711AqTpCSllorytJuWMrzvVR/5nBVNDgeok8b/Lq8uE=; b=M4H1xda8QH+LUn3K00KgZaVX7uiOL4erNZfIJMlq07MzFB2Molkog3PWxgS4GvkdkA cPGSqDUEdLbrugwncaptg0/lN2cg0RGt5RT0/XtRt5U7c3kVPERGtCL8W42uEqtRga3z 9Gz7+wp/uOhReGeK1qfb0lE1O9VT+NiMyUXXlzeQWaHLi0dV9YjrdBAC9AIZafnCjN3O V+gJAoDo9qEe533FLlaNFtzmw6AmuvN4U4FCAFwtTU8wW2dxGv9CI6kJU66uafJ3THkI LXE1F0Q+bLCHgVuTrN4ELFIs12Soob7OHKd4Xzn5fybRzLS9PU/aa++R01Q8fFI9Fgan nStw== Received: by 10.50.100.137 with SMTP id ey9mr2214439igb.57.1351618589973; Tue, 30 Oct 2012 10:36:29 -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 n20csp458705igt; Tue, 30 Oct 2012 10:36:29 -0700 (PDT) Received: by 10.50.237.6 with SMTP id uy6mr2284675igc.31.1351618589723; Tue, 30 Oct 2012 10:36:29 -0700 (PDT) Received: from e31.co.us.ibm.com (e31.co.us.ibm.com. [32.97.110.149]) by mx.google.com with ESMTPS id pb3si1334633igc.50.2012.10.30.10.36.29 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 30 Oct 2012 10:36:29 -0700 (PDT) Received-SPF: pass (google.com: domain of paulmck@linux.vnet.ibm.com designates 32.97.110.149 as permitted sender) client-ip=32.97.110.149; Authentication-Results: mx.google.com; spf=pass (google.com: domain of paulmck@linux.vnet.ibm.com designates 32.97.110.149 as permitted sender) smtp.mail=paulmck@linux.vnet.ibm.com Received: from /spool/local by e31.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 30 Oct 2012 11:36:28 -0600 Received: from d03dlp01.boulder.ibm.com (9.17.202.177) by e31.co.us.ibm.com (192.168.1.131) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 30 Oct 2012 11:32:56 -0600 Received: from d03relay05.boulder.ibm.com (d03relay05.boulder.ibm.com [9.17.195.107]) by d03dlp01.boulder.ibm.com (Postfix) with ESMTP id 7F3B01FF004C for ; Tue, 30 Oct 2012 11:32:45 -0600 (MDT) Received: from d03av01.boulder.ibm.com (d03av01.boulder.ibm.com [9.17.195.167]) by d03relay05.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q9UHWQwl182994 for ; Tue, 30 Oct 2012 11:32:30 -0600 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 q9UHVcck028031 for ; Tue, 30 Oct 2012 11:31:39 -0600 Received: from paulmck-ThinkPad-W500 (sig-9-49-139-14.mts.ibm.com [9.49.139.14]) by d03av01.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q9UHVbYr027745; Tue, 30 Oct 2012 11:31:37 -0600 Received: by paulmck-ThinkPad-W500 (Postfix, from userid 1000) id C2389EBED9; Tue, 30 Oct 2012 10:05:14 -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, Michael Wang , "Paul E. McKenney" Subject: [PATCH tip/core/rcu 05/14] rcu: Optimize the 'rcu_pending' for RCU trace Date: Tue, 30 Oct 2012 10:05:04 -0700 Message-Id: <1351616713-26930-5-git-send-email-paulmck@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.8 In-Reply-To: <1351616713-26930-1-git-send-email-paulmck@linux.vnet.ibm.com> References: <20121030170454.GA25712@linux.vnet.ibm.com> <1351616713-26930-1-git-send-email-paulmck@linux.vnet.ibm.com> X-Content-Scanned: Fidelis XPS MAILER x-cbid: 12103017-7282-0000-0000-00000E6A003A X-Gm-Message-State: ALoCoQmrMhyL6+dUHo+dKGEBnmyZDgvkkqvw34VuQLGkF0TNZCQTK4PM3gUlhWF01E0iWQM7llYg From: Michael Wang This patch implements the new 'rcu_pending' interface under each rsp directory, by using the 'CPU units sequence reading', thus avoiding loss of tracing data. Signed-off-by: Michael Wang Signed-off-by: Paul E. McKenney --- kernel/rcutree_trace.c | 41 +++++++++++++++++++++++++++++++++++------ 1 files changed, 35 insertions(+), 6 deletions(-) diff --git a/kernel/rcutree_trace.c b/kernel/rcutree_trace.c index e387a64..8b24867 100644 --- a/kernel/rcutree_trace.c +++ b/kernel/rcutree_trace.c @@ -467,6 +467,8 @@ static const struct file_operations rcugp_fops = { static void print_one_rcu_pending(struct seq_file *m, struct rcu_data *rdp) { + if (!rdp->beenonline) + return; seq_printf(m, "%3d%cnp=%ld ", rdp->cpu, cpu_is_offline(rdp->cpu) ? '!' : ' ', @@ -485,16 +487,12 @@ static void print_one_rcu_pending(struct seq_file *m, struct rcu_data *rdp) static int show_rcu_pending(struct seq_file *m, void *unused) { int cpu; - struct rcu_data *rdp; struct rcu_state *rsp; for_each_rcu_flavor(rsp) { seq_printf(m, "%s:\n", rsp->name); - for_each_possible_cpu(cpu) { - rdp = per_cpu_ptr(rsp->rda, cpu); - if (rdp->beenonline) - print_one_rcu_pending(m, rdp); - } + for_each_possible_cpu(cpu) + print_one_rcu_pending(m, per_cpu_ptr(rsp->rda, cpu)); } return 0; } @@ -512,6 +510,32 @@ static const struct file_operations rcu_pending_fops = { .release = single_release, }; +static int new_show_rcu_pending(struct seq_file *m, void *v) +{ + print_one_rcu_pending(m, (struct rcu_data *)v); + return 0; +} + +static const struct seq_operations new_rcu_pending_op = { + .start = r_start, + .next = r_next, + .stop = r_stop, + .show = new_show_rcu_pending, +}; + +static int new_rcu_pending_open(struct inode *inode, struct file *file) +{ + return r_open(inode, file, &new_rcu_pending_op); +} + +static const struct file_operations new_rcu_pending_fops = { + .owner = THIS_MODULE, + .open = new_rcu_pending_open, + .read = seq_read, + .llseek = no_llseek, + .release = seq_release, +}; + static int show_rcutorture(struct seq_file *m, void *unused) { seq_printf(m, "rcutorture test sequence: %lu %s\n", @@ -561,6 +585,11 @@ static int __init rcutree_trace_init(void) rspdir, rsp, &new_rcudata_csv_fops); if (!retval) goto free_out; + + retval = debugfs_create_file("rcu_pending", 0444, + rspdir, rsp, &new_rcu_pending_fops); + if (!retval) + goto free_out; } retval = debugfs_create_file("rcubarrier", 0444, rcudir,