From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8195 invoked by alias); 16 Sep 2014 12:50:36 -0000 Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org Received: (qmail 8136 invoked by uid 89); 16 Sep 2014 12:50:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pa0-f44.google.com Received: from mail-pa0-f44.google.com (HELO mail-pa0-f44.google.com) (209.85.220.44) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Tue, 16 Sep 2014 12:50:34 +0000 Received: by mail-pa0-f44.google.com with SMTP id kx10so8769121pab.17 for ; Tue, 16 Sep 2014 05:50:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=t/ANHBM7cQE3qSDyhvMHY4+yvBBzoudscwIrEnk974k=; b=DMXIsXs+J7hqc8uaF6o1WCKRQRrPt/DXUkdxZx6j/Lh8edb1ZchclArMnlHhJYBHBr xOsK6Cd40E/78Ik2+uOHgMcV5LE2LexE0pkHMUIn1PmDkwYLKqCxxRUcdhaJSQxzcHln We9/etIX4zKT04m+l0hR5zoE34NNKisvCwHqOO0A7ETI1dEa2Jw8pwthuzYlpEx7Wm2U 8zkCQawi6nhM3EcxxOjymBK+LXvUt7lQydbkrK1oEHDnJvSprCQWEaAwzKB/mH2azmmj CS8W4I/3iAxfyAQ/HAk9gGivBQ6Avb54A6aSdLlZoQ8FHXPoKsvMQSbuLIyOwmd9Jg9s ROhQ== X-Gm-Message-State: ALoCoQmRhrcqyApeutPSNcE/niu8lSki0m/G4snOPo1354iRsYSx6D9W/tC42tap0w6kNwF94n3V X-Received: by 10.70.64.166 with SMTP id p6mr20188679pds.139.1410871829468; Tue, 16 Sep 2014 05:50:29 -0700 (PDT) Received: from santosh-Latitude-E5530-non-vPro.10.0.0.5 ([111.93.218.67]) by mx.google.com with ESMTPSA id n3sm6222160pdl.5.2014.09.16.05.50.27 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 16 Sep 2014 05:50:28 -0700 (PDT) From: Santosh Shukla To: dsmith@redhat.com, jistone@redhat.com Cc: systemtap@sourceware.org, Santosh Shukla Subject: [SYSTEMTAP/PATCH v2 5/6] stp: rt: replace utrace_struct lock to stp style raw lock Date: Tue, 16 Sep 2014 12:50:00 -0000 Message-Id: <1410871795-12539-6-git-send-email-sshukla@mvista.com> In-Reply-To: <1410871795-12539-1-git-send-email-sshukla@mvista.com> References: <1410871795-12539-1-git-send-email-sshukla@mvista.com> X-SW-Source: 2014-q3/txt/msg00272.txt.bz2 Patch fixes below bug_on for -rt mode kernel: [ 3375.430085] [] __schedule+0x5a9/0x700 [ 3375.430090] [] dump_stack+0x19/0x1b [ 3375.430094] [] schedule+0x2a/0x90 [ 3375.430098] [] __schedule_bug+0xa0/0xae [ 3375.430102] [] rt_spin_lock_slowlock+0xe5/0x2e0 [ 3375.430107] [] __schedule+0x5a9/0x700 [ 3375.430110] [] rt_spin_lock+0x25/0x30 [ 3375.430116] [] schedule+0x2a/0x90 [ 3375.430125] [] task_utrace_struct+0x1e/0x40 [stap_eb141ade124ccb17a233482e6996651f_15664] [ 3375.430131] [] rt_spin_lock_slowlock+0xe5/0x2e0 [ 3375.430138] [] utrace_report_syscall_exit+0x4b/0x110 [stap_eb141ade124ccb17a233482e6996651f_15664] [ 3375.430143] [] rt_spin_lock+0x25/0x30 [ 3375.430148] [] ? __audit_syscall_exit+0x1f6/0x2a0 [ 3375.430156] [] task_utrace_struct+0x1e/0x40 [stap_eb141ade124ccb17a233482e6996651f_15664] [ 3375.430161] [] syscall_trace_leave+0xd6/0xf0 [ 3375.430168] [] utrace_report_syscall_exit+0x4b/0x110 [stap_eb141ade124ccb17a233482e6996651f_15664] [ 3375.430173] [] int_check_syscall_exit_work+0x34/0x3d [ 3375.430178] [] ? __audit_syscall_exit+0x1f6/0x2a0 [ 3375.430184] [] syscall_trace_leave+0xd6/0xf0 [ 3375.430191] [] int_check_syscall_exit_work+0x34/0x3d Signed-off-by: Santosh Shukla --- runtime/stp_utrace.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/runtime/stp_utrace.c b/runtime/stp_utrace.c index e5d6d55..c69dec1 100644 --- a/runtime/stp_utrace.c +++ b/runtime/stp_utrace.c @@ -85,7 +85,7 @@ struct utrace { static struct hlist_head task_utrace_table[TASK_UTRACE_TABLE_SIZE]; //DEFINE_MUTEX(task_utrace_mutex); /* Protects task_utrace_table */ -static DEFINE_SPINLOCK(task_utrace_lock); /* Protects task_utrace_table */ +static STP_DEFINE_SPINLOCK(task_utrace_lock); /* Protects task_utrace_table */ static struct kmem_cache *utrace_cachep; static struct kmem_cache *utrace_engine_cachep; @@ -468,7 +468,7 @@ static void utrace_shutdown(void) #ifdef STP_TF_DEBUG printk(KERN_ERR "%s:%d - freeing task-specific\n", __FUNCTION__, __LINE__); #endif - spin_lock(&task_utrace_lock); + stp_spin_lock(&task_utrace_lock); for (i = 0; i < TASK_UTRACE_TABLE_SIZE; i++) { head = &task_utrace_table[i]; stap_hlist_for_each_entry_safe(utrace, node, node2, head, @@ -477,7 +477,7 @@ static void utrace_shutdown(void) utrace_cleanup(utrace); } } - spin_unlock(&task_utrace_lock); + stp_spin_unlock(&task_utrace_lock); #ifdef STP_TF_DEBUG printk(KERN_ERR "%s:%d - done\n", __FUNCTION__, __LINE__); #endif @@ -524,7 +524,7 @@ static bool utrace_task_alloc(struct task_struct *task) stp_init_task_work(&utrace->work, &utrace_resume); stp_init_task_work(&utrace->report_work, &utrace_report_work); - spin_lock(&task_utrace_lock); + stp_spin_lock(&task_utrace_lock); u = __task_utrace_struct(task); if (u == NULL) { hlist_add_head(&utrace->hlist, @@ -533,7 +533,7 @@ static bool utrace_task_alloc(struct task_struct *task) else { kmem_cache_free(utrace_cachep, utrace); } - spin_unlock(&task_utrace_lock); + stp_spin_unlock(&task_utrace_lock); return true; } @@ -552,9 +552,9 @@ static void utrace_free(struct utrace *utrace) /* Remove this utrace from the mapping list of tasks to * struct utrace. */ - spin_lock(&task_utrace_lock); + stp_spin_lock(&task_utrace_lock); hlist_del(&utrace->hlist); - spin_unlock(&task_utrace_lock); + stp_spin_unlock(&task_utrace_lock); /* Free the utrace struct. */ stp_spin_lock(&utrace->lock); @@ -595,9 +595,9 @@ static struct utrace *task_utrace_struct(struct task_struct *task) { struct utrace *utrace; - spin_lock(&task_utrace_lock); + stp_spin_lock(&task_utrace_lock); utrace = __task_utrace_struct(task); - spin_unlock(&task_utrace_lock); + stp_spin_unlock(&task_utrace_lock); return utrace; } -- 1.8.3.1