Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1275072 > unrolled thread

[PATCH] locking_selftest: Save/restore migrate_disable_atomic in locking selftest

Started by<jianchuan.wang@windriver.com>
First post2015-11-23 08:30 +0100
Last post2015-11-23 16:10 +0100
Articles 8 — 5 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] locking_selftest: Save/restore migrate_disable_atomic in locking selftest <jianchuan.wang@windriver.com> - 2015-11-23 08:30 +0100
    Re: [PATCH] locking_selftest: Save/restore migrate_disable_atomic in  locking selftest kbuild test robot <lkp@intel.com> - 2015-11-23 08:40 +0100
      Re: [PATCH] locking_selftest: Save/restore migrate_disable_atomic  in locking selftest Steven Rostedt <rostedt@goodmis.org> - 2015-11-23 14:50 +0100
        Re: [kbuild-all] [PATCH] locking_selftest: Save/restore  migrate_disable_atomic in locking selftest Steven Rostedt <rostedt@goodmis.org> - 2015-11-23 15:20 +0100
          Re: [kbuild-all] [PATCH] locking_selftest: Save/restore  migrate_disable_atomic in locking selftest Fengguang Wu <lkp@intel.com> - 2015-11-23 16:10 +0100
        Re: [kbuild-all] [PATCH] locking_selftest: Save/restore  migrate_disable_atomic in locking selftest Fengguang Wu <lkp@intel.com> - 2015-11-23 15:20 +0100
          Re: [kbuild-all] [PATCH] locking_selftest: Save/restore  migrate_disable_atomic in locking selftest Sebastian Andrzej Siewior <bigeasy@linutronix.de> - 2015-11-23 15:40 +0100
            Re: [kbuild-all] [PATCH] locking_selftest: Save/restore  migrate_disable_atomic in locking selftest Fengguang Wu <lkp@intel.com> - 2015-11-23 16:10 +0100

#1275072 — [PATCH] locking_selftest: Save/restore migrate_disable_atomic in locking selftest

From<jianchuan.wang@windriver.com>
Date2015-11-23 08:30 +0100
Subject[PATCH] locking_selftest: Save/restore migrate_disable_atomic in locking selftest
Message-ID<qxTJw-76I-11@gated-at.bofh.it>
From: Jianchuan Wang <jianchuan.wang@windriver.com>

System will hang when enabling the kernel option
CONFIG_DEBUG_LOCKING_API_SELFTESTS and CONFIG_SCHED_CONFIG
in the preempt-rt kernel.

In the preempt-rt kernel, migrate_enable()/migrage_disable() are called
in the spinlock and read/write lock; The lock()/unlock() aren't used
in pairs in the selftest processing changes the migrate_disable_atomic
so that the system will hang in the dotest(), the calltrace is :
printk() ..-> vprintk_emit() -> migrage_disable()
-> WARN_ON_ONCE() ..-> warn_slowpath_common() ..-> printk()

For fixing it, we need save the migrate_disable_atomic before self-testing
and restore migrate_disable_atomic after self-testing.

Signed-off-by: Jianchuan Wang <jianchuan.wang@windriver.com>
---
 lib/locking-selftest.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/lib/locking-selftest.c b/lib/locking-selftest.c
index b93a610..61798da 100644
--- a/lib/locking-selftest.c
+++ b/lib/locking-selftest.c
@@ -997,10 +997,23 @@ static int unexpected_testcase_failures;
 static void dotest(void (*testcase_fn)(void), int expected, int lockclass_mask)
 {
 	unsigned long saved_preempt_count = preempt_count();
+#ifdef CONFIG_SCHED_DEBUG
+	struct task_struct *p = current;
+	int save_migrate_atomic;
+#endif
 
 	WARN_ON(irqs_disabled());
 
+#ifdef CONFIG_SCHED_DEBUG
+	save_migrate_atomic = p->migrate_disable_atomic;
+#endif
+
 	testcase_fn();
+
+#ifdef CONFIG_SCHED_DEBUG
+	p->migrate_disable_atomic = save_migrate_atomic;
+#endif
+
 	/*
 	 * Filter out expected failures:
 	 */
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1275076 — Re: [PATCH] locking_selftest: Save/restore migrate_disable_atomic in locking selftest

Fromkbuild test robot <lkp@intel.com>
Date2015-11-23 08:40 +0100
SubjectRe: [PATCH] locking_selftest: Save/restore migrate_disable_atomic in locking selftest
Message-ID<qxTTc-7a2-3@gated-at.bofh.it>
In reply to#1275072

[Multipart message — attachments visible in raw view] — view raw

Hi Jianchuan,

[auto build test ERROR on: v4.4-rc2]
[also build test ERROR on: next-20151120]

url:    https://github.com/0day-ci/linux/commits/jianchuan-wang-windriver-com/locking_selftest-Save-restore-migrate_disable_atomic-in-locking-selftest/20151123-152217
config: x86_64-randconfig-x013-11230343 (attached as .config)
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All errors (new ones prefixed by >>):

   lib/locking-selftest.c: In function 'dotest':
>> lib/locking-selftest.c:981:25: error: 'struct task_struct' has no member named 'migrate_disable_atomic'
     save_migrate_atomic = p->migrate_disable_atomic;
                            ^
   lib/locking-selftest.c:987:3: error: 'struct task_struct' has no member named 'migrate_disable_atomic'
     p->migrate_disable_atomic = save_migrate_atomic;
      ^

vim +981 lib/locking-selftest.c

   975		int save_migrate_atomic;
   976	#endif
   977	
   978		WARN_ON(irqs_disabled());
   979	
   980	#ifdef CONFIG_SCHED_DEBUG
 > 981		save_migrate_atomic = p->migrate_disable_atomic;
   982	#endif
   983	
   984		testcase_fn();

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[toc] | [prev] | [next] | [standalone]


#1275399 — Re: [PATCH] locking_selftest: Save/restore migrate_disable_atomic in locking selftest

FromSteven Rostedt <rostedt@goodmis.org>
Date2015-11-23 14:50 +0100
SubjectRe: [PATCH] locking_selftest: Save/restore migrate_disable_atomic in locking selftest
Message-ID<qxZFg-2qN-1@gated-at.bofh.it>
In reply to#1275076
On Mon, 23 Nov 2015 15:30:30 +0800
kbuild test robot <lkp@intel.com> wrote:

> Hi Jianchuan,
> 
> [auto build test ERROR on: v4.4-rc2]
> [also build test ERROR on: next-20151120]
> 
> url:    https://github.com/0day-ci/linux/commits/jianchuan-wang-windriver-com/locking_selftest-Save-restore-migrate_disable_atomic-in-locking-selftest/20151123-152217
> config: x86_64-randconfig-x013-11230343 (attached as .config)
> reproduce:
>         # save the attached .config to linux build tree
>         make ARCH=x86_64 
> 
> All errors (new ones prefixed by >>):
> 
>    lib/locking-selftest.c: In function 'dotest':
> >> lib/locking-selftest.c:981:25: error: 'struct task_struct' has no member named 'migrate_disable_atomic'  
>      save_migrate_atomic = p->migrate_disable_atomic;
>                             ^
>    lib/locking-selftest.c:987:3: error: 'struct task_struct' has no member named 'migrate_disable_atomic'
>      p->migrate_disable_atomic = save_migrate_atomic;
>       ^


Need to add RT in the subject like "[PATCH RT]". Then perhaps Fengguang
can have his tests either ignore these or test against the -rt trees.

-- Steve

> 
> vim +981 lib/locking-selftest.c
> 
>    975		int save_migrate_atomic;
>    976	#endif
>    977	
>    978		WARN_ON(irqs_disabled());
>    979	
>    980	#ifdef CONFIG_SCHED_DEBUG
>  > 981		save_migrate_atomic = p->migrate_disable_atomic;  
>    982	#endif
>    983	
>    984		testcase_fn();
> 
> ---
> 0-DAY kernel test infrastructure                Open Source Technology Center
> https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1275415 — Re: [kbuild-all] [PATCH] locking_selftest: Save/restore migrate_disable_atomic in locking selftest

FromSteven Rostedt <rostedt@goodmis.org>
Date2015-11-23 15:20 +0100
SubjectRe: [kbuild-all] [PATCH] locking_selftest: Save/restore migrate_disable_atomic in locking selftest
Message-ID<qy08i-2R4-7@gated-at.bofh.it>
In reply to#1275399
On Mon, 23 Nov 2015 22:14:08 +0800
Fengguang Wu <lkp@intel.com> wrote:

> > Need to add RT in the subject like "[PATCH RT]". Then perhaps Fengguang
> > can have his tests either ignore these or test against the -rt trees.  
> 
> Yes sure. Shall I apply RT patches to this tree/branch?
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git linux-4.1.y-rt

Looks like a good of a branch as any.

-- Steve
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1275463 — Re: [kbuild-all] [PATCH] locking_selftest: Save/restore migrate_disable_atomic in locking selftest

FromFengguang Wu <lkp@intel.com>
Date2015-11-23 16:10 +0100
SubjectRe: [kbuild-all] [PATCH] locking_selftest: Save/restore migrate_disable_atomic in locking selftest
Message-ID<qy0UG-3v4-5@gated-at.bofh.it>
In reply to#1275415
On Mon, Nov 23, 2015 at 09:17:56AM -0500, Steven Rostedt wrote:
> On Mon, 23 Nov 2015 22:14:08 +0800
> Fengguang Wu <lkp@intel.com> wrote:
> 
> > > Need to add RT in the subject like "[PATCH RT]". Then perhaps Fengguang
> > > can have his tests either ignore these or test against the -rt trees.  
> > 
> > Yes sure. Shall I apply RT patches to this tree/branch?
> > 
> > https://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git linux-4.1.y-rt
> 
> Looks like a good of a branch as any.

OK. Added the [RT] mapping to that branch.

Thanks,
Fengguang
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1275417 — Re: [kbuild-all] [PATCH] locking_selftest: Save/restore migrate_disable_atomic in locking selftest

FromFengguang Wu <lkp@intel.com>
Date2015-11-23 15:20 +0100
SubjectRe: [kbuild-all] [PATCH] locking_selftest: Save/restore migrate_disable_atomic in locking selftest
Message-ID<qy08i-2R4-9@gated-at.bofh.it>
In reply to#1275399
On Mon, Nov 23, 2015 at 08:43:25AM -0500, Steven Rostedt wrote:
> On Mon, 23 Nov 2015 15:30:30 +0800
> kbuild test robot <lkp@intel.com> wrote:
> 
> > Hi Jianchuan,
> > 
> > [auto build test ERROR on: v4.4-rc2]
> > [also build test ERROR on: next-20151120]
> > 
> > url:    https://github.com/0day-ci/linux/commits/jianchuan-wang-windriver-com/locking_selftest-Save-restore-migrate_disable_atomic-in-locking-selftest/20151123-152217
> > config: x86_64-randconfig-x013-11230343 (attached as .config)
> > reproduce:
> >         # save the attached .config to linux build tree
> >         make ARCH=x86_64 
> > 
> > All errors (new ones prefixed by >>):
> > 
> >    lib/locking-selftest.c: In function 'dotest':
> > >> lib/locking-selftest.c:981:25: error: 'struct task_struct' has no member named 'migrate_disable_atomic'  
> >      save_migrate_atomic = p->migrate_disable_atomic;
> >                             ^
> >    lib/locking-selftest.c:987:3: error: 'struct task_struct' has no member named 'migrate_disable_atomic'
> >      p->migrate_disable_atomic = save_migrate_atomic;
> >       ^
> 
> 
> Need to add RT in the subject like "[PATCH RT]". Then perhaps Fengguang
> can have his tests either ignore these or test against the -rt trees.

Yes sure. Shall I apply RT patches to this tree/branch?

https://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git linux-4.1.y-rt

Thanks,
Fengguang
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1275451 — Re: [kbuild-all] [PATCH] locking_selftest: Save/restore migrate_disable_atomic in locking selftest

FromSebastian Andrzej Siewior <bigeasy@linutronix.de>
Date2015-11-23 15:40 +0100
SubjectRe: [kbuild-all] [PATCH] locking_selftest: Save/restore migrate_disable_atomic in locking selftest
Message-ID<qy0rF-30z-43@gated-at.bofh.it>
In reply to#1275417
On 11/23/2015 03:14 PM, Fengguang Wu wrote:

>> Need to add RT in the subject like "[PATCH RT]". Then perhaps Fengguang
>> can have his tests either ignore these or test against the -rt trees.
> 
> Yes sure. Shall I apply RT patches to this tree/branch?
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git linux-4.1.y-rt

I'm going to get you your kbot branch where you run bisect tests and
everything and tests the patches against. The problem with this one is
that we will drop it (or leave it stale) once we move to the next major
kernel release.

> Thanks,
> Fengguang

Sebastian

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1275464 — Re: [kbuild-all] [PATCH] locking_selftest: Save/restore migrate_disable_atomic in locking selftest

FromFengguang Wu <lkp@intel.com>
Date2015-11-23 16:10 +0100
SubjectRe: [kbuild-all] [PATCH] locking_selftest: Save/restore migrate_disable_atomic in locking selftest
Message-ID<qy0UG-3v4-11@gated-at.bofh.it>
In reply to#1275451
On Mon, Nov 23, 2015 at 03:35:11PM +0100, Sebastian Andrzej Siewior wrote:
> On 11/23/2015 03:14 PM, Fengguang Wu wrote:
> 
> >> Need to add RT in the subject like "[PATCH RT]". Then perhaps Fengguang
> >> can have his tests either ignore these or test against the -rt trees.
> > 
> > Yes sure. Shall I apply RT patches to this tree/branch?
> > 
> > https://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git linux-4.1.y-rt
> 
> I'm going to get you your kbot branch where you run bisect tests and
> everything and tests the patches against. The problem with this one is
> that we will drop it (or leave it stale) once we move to the next major
> kernel release.

Thanks! Yes, a stable branch name would be better than "linux-4.1.y-rt"
that's like to become stable over time.

Thanks,
Fengguang
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web