From: Pavel Machek Subject: Re: [PATCH 2/2] lockdep: check that no locks held at freeze time Date: Sat, 4 May 2013 15:04:40 +0200 Message-ID: <20130504130440.GC13770@amd.pavel.ucw.cz> References: <1367615050-3894-1-git-send-email-ccross@android.com> <1367615050-3894-2-git-send-email-ccross@android.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <1367615050-3894-2-git-send-email-ccross-z5hGa2qSFaRBDgjK7y7TUQ@public.gmane.org> Sender: linux-nfs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Colin Cross Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Trond Myklebust , Len Brown , "Rafael J. Wysocki" , Peter Zijlstra , Ingo Molnar , "J. Bruce Fields" , "David S. Miller" , Andrew Morton , Mandeep Singh Baines , Paul Walmsley , Al Viro , "Eric W. Biederman" , Oleg Nesterov , linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Linus Torvalds , Tejun Heo , Ben Chan List-Id: linux-pm@vger.kernel.org On Fri 2013-05-03 14:04:10, Colin Cross wrote: > From: Mandeep Singh Baines > > We shouldn't try_to_freeze if locks are held. Holding a lock can cause a > deadlock if the lock is later acquired in the suspend or hibernate path > (e.g. by dpm). Holding a lock can also cause a deadlock in the case of > cgroup_freezer if a lock is held inside a frozen cgroup that is later > acquired by a process outside that group. Ok, but this does not explain why > --- a/include/linux/debug_locks.h > +++ b/include/linux/debug_locks.h > @@ -51,7 +51,7 @@ struct task_struct; > extern void debug_show_all_locks(void); > extern void debug_show_held_locks(struct task_struct *task); > extern void debug_check_no_locks_freed(const void *from, unsigned long len); > -extern void debug_check_no_locks_held(struct task_struct *task); > +extern void debug_check_no_locks_held(void); > #else > static inline void debug_show_all_locks(void) > { Removing task_struct argument from those functions is good idea? > --- a/kernel/exit.c > +++ b/kernel/exit.c > @@ -835,7 +835,7 @@ void do_exit(long code) > /* > * Make sure we are holding no locks: > */ > - debug_check_no_locks_held(tsk); > + debug_check_no_locks_held(); Is task guaranteed == current? Pavel -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html