Re: [NFS] 2.6.23-rc1-mm2

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Oleg Nesterov <oleg@...>
Cc: Trond Myklebust <trond.myklebust@...>, Andrew Morton <akpm@...>, Marc Dietrich <Marc.Dietrich@...>, Neil Brown <neilb@...>, <nfs@...>, <linux-kernel@...>, Ingo Molnar <mingo@...>, Peter Zijlstra <a.p.zijlstra@...>
Date: Monday, August 6, 2007 - 2:24 am

On Fri, 2007-08-03 at 21:21 +0400, Oleg Nesterov wrote:


I just had a thought: we could get rid of this warning by using a
read-lock here. That way, flushing from within a work function (which
would be seen as read-after-read recursive lock) won't trigger this
warning. Patch below. This would, however, also get rid of any warnings
for run_workqueue recursion. Which again we may or may not want, the
code inidicates that it should be allowed up to a depth of three.

However, the question whether we should allow flush_workqueue from
within a struct work is mainly an API policy issue; it doesn't hurt to
flush a workqueue from within a work, but it is probably nearer the
intent to use targeted cancel_work_sync() or such. OTOH, one could
imagine situations where multiple different work structs are on that
workqueue belonging to the same subsystem and then the general
flush_scheduled_work() call is the only way to guarantee nothing is on
scheduled at a given point... I don't feel qualified to make the
decision for or against allowing this use of the API at this point.

Marc, do you have an easy way to trigger this warning? Could you verify
that it goes away with the patch below applied?

johannes

---
 kernel/workqueue.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- wireless-dev.orig/kernel/workqueue.c	2007-08-06 08:11:23.297846657 +020=
0
+++ wireless-dev/kernel/workqueue.c	2007-08-06 08:19:54.727846657 +0200
@@ -272,7 +272,7 @@ static void run_workqueue(struct cpu_wor
=20
 		BUG_ON(get_wq_data(work) !=3D cwq);
 		work_clear_pending(work);
-		lock_acquire(&cwq->wq->lockdep_map, 0, 0, 0, 2, _THIS_IP_);
+		lock_acquire(&cwq->wq->lockdep_map, 0, 0, 1, 2, _THIS_IP_);
 		lock_acquire(&lockdep_map, 0, 0, 0, 2, _THIS_IP_);
 		f(work);
 		lock_release(&lockdep_map, 1, _THIS_IP_);
@@ -395,7 +395,7 @@ void fastcall flush_workqueue(struct wor
 	int cpu;
=20
 	might_sleep();
-	lock_acquire(&wq->lockdep_map, 0, 0, 0, 2, _THIS_IP_);
+	lock_acquire(&wq->lockdep_map, 0, 0, 1, 2, _THIS_IP_);
 	lock_release(&wq->lockdep_map, 1, _THIS_IP_);
 	for_each_cpu_mask(cpu, *cpu_map)
 		flush_cpu_workqueue(per_cpu_ptr(wq->cpu_wq, cpu));
@@ -779,7 +779,7 @@ static void cleanup_workqueue_thread(str
 	if (cwq->thread =3D=3D NULL)
 		return;
=20
-	lock_acquire(&cwq->wq->lockdep_map, 0, 0, 0, 2, _THIS_IP_);
+	lock_acquire(&cwq->wq->lockdep_map, 0, 0, 1, 2, _THIS_IP_);
 	lock_release(&cwq->wq->lockdep_map, 1, _THIS_IP_);
=20
 	flush_cpu_workqueue(cwq);
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
2.6.23-rc1-mm2, Andrew Morton, (Wed Aug 1, 2:09 am)
[-mm patch] make pm3fb_init() static again, Adrian Bunk, (Tue Aug 14, 5:21 pm)
2.6.23-rc1-mm2: MMC_ARMMMCI compile error, Adrian Bunk, (Wed Aug 8, 5:31 pm)
Re: 2.6.23-rc1-mm2: MMC_ARMMMCI compile error, Pierre Ossman, (Thu Aug 9, 8:03 am)
Re: 2.6.23-rc1-mm2, Marc Dietrich, (Fri Aug 3, 7:00 am)
Re: 2.6.23-rc1-mm2, Andrew Morton, (Fri Aug 3, 12:38 pm)
Re: [NFS] 2.6.23-rc1-mm2, Trond Myklebust, (Fri Aug 3, 1:03 pm)
Re: [NFS] 2.6.23-rc1-mm2, Oleg Nesterov, (Fri Aug 3, 1:21 pm)
Re: [NFS] 2.6.23-rc1-mm2, Trond Myklebust, (Tue Aug 7, 5:08 pm)
Re: [NFS] 2.6.23-rc1-mm2, Oleg Nesterov, (Tue Aug 7, 5:37 pm)
Re: [NFS] 2.6.23-rc1-mm2, Trond Myklebust, (Tue Aug 7, 6:05 pm)
Re: [NFS] 2.6.23-rc1-mm2, Oleg Nesterov, (Tue Aug 7, 6:20 pm)
Re: [NFS] 2.6.23-rc1-mm2, Trond Myklebust, (Tue Aug 7, 7:08 pm)
Re: [NFS] 2.6.23-rc1-mm2, Oleg Nesterov, (Tue Aug 7, 7:14 pm)
Re: [NFS] 2.6.23-rc1-mm2, Johannes Berg, (Mon Aug 6, 2:24 am)
Re: [NFS] 2.6.23-rc1-mm2, Marc Dietrich, (Mon Aug 6, 7:05 am)
Re: [NFS] 2.6.23-rc1-mm2, Trond Myklebust, (Mon Aug 6, 12:24 pm)
Re: [NFS] 2.6.23-rc1-mm2, Marc Dietrich, (Tue Aug 7, 8:09 am)
Re: [NFS] 2.6.23-rc1-mm2, Johannes Berg, (Mon Aug 6, 7:13 am)
Re: [NFS] 2.6.23-rc1-mm2, Oleg Nesterov, (Mon Aug 6, 6:53 am)
Re: [NFS] 2.6.23-rc1-mm2, Johannes Berg, (Mon Aug 6, 6:58 am)
Re: 2.6.23-rc1-mm2: Fix crash in sysfs_hash_and_remove, Rafael J. Wysocki, (Thu Aug 2, 1:31 pm)
Re: 2.6.23-rc1-mm2: Fix crash in sysfs_hash_and_remove, Eric W. Biederman, (Thu Aug 2, 2:19 pm)
[PATCH -mm] linux-audit list is subscribers-only , Gabriel C, (Wed Aug 1, 7:59 pm)
Re: [PATCH -mm] linux-audit list is subscribers-only, Randy Dunlap, (Wed Aug 1, 9:30 pm)
INOTIFY=n , AUDIT*=y compile error, Gabriel C, (Wed Aug 1, 7:40 pm)
Re: 2.6.23-rc1-mm2, , (Wed Aug 1, 4:30 pm)
Re: 2.6.23-rc1-mm2, Andrew Morton, (Wed Aug 1, 4:40 pm)
Re: 2.6.23-rc1-mm2, Torsten Kaiser, (Wed Aug 1, 4:52 pm)
Re: 2.6.23-rc1-mm2, Mel Gorman, (Wed Aug 1, 7:40 pm)
Re: 2.6.23-rc1-mm2, Andy Whitcroft, (Thu Aug 2, 10:01 am)
Re: 2.6.23-rc1-mm2, Torsten Kaiser, (Thu Aug 2, 1:44 pm)
Re: 2.6.23-rc1-mm2, Torsten Kaiser, (Thu Aug 2, 12:38 am)
Re: 2.6.23-rc1-mm2, Andrew Morton, (Wed Aug 1, 5:17 pm)
[PATCH -mm] Fix a section mismatch warning, Gabriel C, (Wed Aug 1, 11:19 am)
[PATCH] fix slown down printk on boot compile error, Heiko Carstens, (Wed Aug 1, 7:16 am)
Re: [PATCH] fix slown down printk on boot compile error, Randy Dunlap, (Wed Aug 1, 12:32 pm)
Re: 2.6.23-rc1-mm2, Gabriel C, (Wed Aug 1, 6:56 am)
Re: 2.6.23-rc1-mm2, Andrew Morton, (Wed Aug 1, 1:26 pm)
Re: 2.6.23-rc1-mm2, Gabriel C, (Wed Aug 1, 1:39 pm)
unionfs compile error ( Re: 2.6.23-rc1-mm2 ), Gabriel C, (Wed Aug 1, 6:33 am)
Re: unionfs compile error ( Re: 2.6.23-rc1-mm2 ), Andrew Morton, (Wed Aug 1, 1:22 pm)
Re: unionfs compile error ( Re: 2.6.23-rc1-mm2 ), Gabriel C, (Wed Aug 1, 1:35 pm)
Re: unionfs compile error ( Re: 2.6.23-rc1-mm2 ), Josef Sipek, (Wed Aug 1, 1:27 pm)
Re: unionfs compile error ( Re: 2.6.23-rc1-mm2 ) , Erez Zadok, (Thu Aug 2, 12:29 pm)
[PATCH] prevent SSB compilation on s390 part 2, Heiko Carstens, (Wed Aug 1, 5:34 am)
Re: [PATCH] prevent SSB compilation on s390 part 2, Heiko Carstens, (Wed Aug 1, 10:43 am)
Re: [PATCH] prevent SSB compilation on s390 part 2, Michael Buesch, (Wed Aug 1, 10:54 am)
Re: [PATCH] prevent SSB compilation on s390 part 2, John W. Linville, (Wed Aug 1, 8:24 am)
Re: 2.6.23-rc1-mm2, Mariusz Kozlowski, (Wed Aug 1, 4:02 am)
Re: 2.6.23-rc1-mm2, Segher Boessenkool, (Mon Aug 6, 3:08 pm)
Re: 2.6.23-rc1-mm2, Mariusz Kozlowski, (Mon Aug 6, 3:34 pm)
Re: 2.6.23-rc1-mm2, Segher Boessenkool, (Mon Aug 6, 5:25 pm)
Re: 2.6.23-rc1-mm2, Mariusz Kozlowski, (Mon Aug 6, 6:34 pm)
Re: 2.6.23-rc1-mm2, Segher Boessenkool, (Mon Aug 6, 7:12 pm)
Re: 2.6.23-rc1-mm2, Greg KH, (Wed Aug 1, 12:36 pm)
Re: 2.6.23-rc1-mm2, Paul Mackerras, (Wed Aug 1, 6:32 am)
Re: 2.6.23-rc1-mm2, Mariusz Kozlowski, (Thu Aug 2, 6:14 am)
Re: 2.6.23-rc1-mm2, Segher Boessenkool, (Mon Aug 6, 3:10 pm)
Re: 2.6.23-rc1-mm2, Kumar Gala, (Fri Aug 3, 5:39 am)
Re: 2.6.23-rc1-mm2, Segher Boessenkool, (Mon Aug 6, 3:12 pm)
Re: 2.6.23-rc1-mm2, Andrew Morton, (Wed Aug 1, 4:13 am)
Re: 2.6.23-rc1-mm2, Jiri Kosina, (Wed Aug 1, 6:23 am)
Re: 2.6.23-rc1-mm2, Mariusz Kozlowski, (Thu Aug 2, 5:47 am)
Re: [linux-usb-devel] 2.6.23-rc1-mm2, Alan Stern, (Thu Aug 2, 10:20 am)
Re: [linux-usb-devel] 2.6.23-rc1-mm2, Mariusz Kozlowski, (Thu Aug 2, 10:32 am)
Re: [linux-usb-devel] 2.6.23-rc1-mm2, Jiri Kosina, (Thu Aug 2, 10:26 am)
Re: 2.6.23-rc1-mm2, Ingo Molnar, (Wed Aug 1, 4:16 am)
Re: 2.6.23-rc1-mm2, Paul Mundt, (Wed Aug 1, 2:25 am)
Re: 2.6.23-rc1-mm2, Jason Wessel, (Wed Aug 1, 8:22 am)
Re: 2.6.23-rc1-mm2, Mike Frysinger, (Wed Aug 1, 3:58 am)
Re: 2.6.23-rc1-mm2, Paul Mundt, (Wed Aug 1, 4:15 am)
Re: 2.6.23-rc1-mm2, Mike Frysinger, (Wed Aug 1, 5:04 am)
Re: 2.6.23-rc1-mm2, Andrew Morton, (Wed Aug 1, 4:10 am)
Re: 2.6.23-rc1-mm2, Christoph Hellwig, (Wed Aug 1, 9:45 am)
Re: 2.6.23-rc1-mm2, Jason Wessel, (Wed Aug 1, 9:57 am)