Re: [PATCH] debugobjects: Move printk out of db lock critical sections

2018-12-14 Thread Waiman Long
On 12/14/2018 01:06 PM, Dmitry Safonov wrote: > On 12/13/18 10:10 PM, Waiman Long wrote: >> The bucket lock is for protecting the insertion and deletion of >> debug_obj to/from the bucket list as well as searching within the bucket >> list. It has nothing to do with the life time of the debug_obj i

Re: [PATCH] debugobjects: Move printk out of db lock critical sections

2018-12-14 Thread Dmitry Safonov
On 12/13/18 10:10 PM, Waiman Long wrote: > The bucket lock is for protecting the insertion and deletion of > debug_obj to/from the bucket list as well as searching within the bucket > list. It has nothing to do with the life time of the debug_obj itself. The bucket lock also protects lookups on a

Re: [PATCH] debugobjects: Move printk out of db lock critical sections

2018-12-13 Thread Waiman Long
On 12/12/2018 11:35 PM, Dmitry Safonov wrote: > Hi Waiman, > > On 12/12/18 10:28 PM, Waiman Long wrote: >> The db->lock is a raw spinlock and so the lock hold time is supposed >> to be short. This will not be the case when printk() is being involved >> in some of the critical sections. In order to

Re: [PATCH] debugobjects: Move printk out of db lock critical sections

2018-12-13 Thread Waiman Long
On 12/12/2018 06:39 PM, Andrew Morton wrote: > On Wed, 12 Dec 2018 17:28:14 -0500 Waiman Long wrote: > >> The db->lock is a raw spinlock and so the lock hold time is supposed >> to be short. This will not be the case when printk() is being involved >> in some of the critical sections. In order to

Re: [PATCH] debugobjects: Move printk out of db lock critical sections

2018-12-13 Thread Waiman Long
On 12/12/2018 09:03 PM, Sergey Senozhatsky wrote: > On (12/12/18 17:28), Waiman Long wrote: >> The db->lock is a raw spinlock and so the lock hold time is supposed >> to be short. This will not be the case when printk() is being involved >> in some of the critical sections. In order to avoid the lo

Re: [PATCH] debugobjects: Move printk out of db lock critical sections

2018-12-13 Thread Peter Zijlstra
On Thu, Dec 13, 2018 at 11:59:40AM +0900, Sergey Senozhatsky wrote: > On (12/12/18 17:28), Waiman Long wrote: > > > > warning from lockdep as reported in https://lkml.org/lkml/2018/12/11/143. > > > > That link shows an empty page, lkml.org is quite unstable. Let's > use this one instead: > > ht

Re: [PATCH] debugobjects: Move printk out of db lock critical sections

2018-12-13 Thread Sergey Senozhatsky
On (12/13/18 05:54), Dmitry Safonov wrote: > > I thought about it for a second, but couldn't figure out if this race > > was real. > > > > E.g. uart case - if there are two paths which concurrently free and > > access debug object, then the same race condition should exist for > > the xmit.buf page

Re: [PATCH] debugobjects: Move printk out of db lock critical sections

2018-12-12 Thread Dmitry Safonov
On Thu, 13 Dec 2018 at 05:19, Sergey Senozhatsky wrote: > > On (12/13/18 04:35), Dmitry Safonov wrote: > > I've tried to review it and found minor issues like missed > > debug_object_is_on_stack() for initializing already active object. > > > > But than I come to opinion that it's just generally u

Re: [PATCH] debugobjects: Move printk out of db lock critical sections

2018-12-12 Thread Sergey Senozhatsky
On (12/13/18 04:35), Dmitry Safonov wrote: > I've tried to review it and found minor issues like missed > debug_object_is_on_stack() for initializing already active object. > > But than I come to opinion that it's just generally unsafe: > debug_obj life-time is protected by bucket's spin_lock. > C

Re: [PATCH] debugobjects: Move printk out of db lock critical sections

2018-12-12 Thread Dmitry Safonov
Hi Waiman, On 12/12/18 10:28 PM, Waiman Long wrote: > The db->lock is a raw spinlock and so the lock hold time is supposed > to be short. This will not be the case when printk() is being involved > in some of the critical sections. In order to avoid the long hold time, > in case some messages need

Re: [PATCH] debugobjects: Move printk out of db lock critical sections

2018-12-12 Thread Sergey Senozhatsky
On (12/12/18 17:28), Waiman Long wrote: > > warning from lockdep as reported in https://lkml.org/lkml/2018/12/11/143. > That link shows an empty page, lkml.org is quite unstable. Let's use this one instead: https://lore.kernel.org/lkml/20181211091154.GL23332@shao2-debian/T/#u -ss

Re: [PATCH] debugobjects: Move printk out of db lock critical sections

2018-12-12 Thread Sergey Senozhatsky
On (12/12/18 17:28), Waiman Long wrote: > The db->lock is a raw spinlock and so the lock hold time is supposed > to be short. This will not be the case when printk() is being involved > in some of the critical sections. In order to avoid the long hold time, > in case some messages need to be printe

Re: [PATCH] debugobjects: Move printk out of db lock critical sections

2018-12-12 Thread Andrew Morton
On Wed, 12 Dec 2018 17:28:14 -0500 Waiman Long wrote: > The db->lock is a raw spinlock and so the lock hold time is supposed > to be short. This will not be the case when printk() is being involved > in some of the critical sections. In order to avoid the long hold time, > in case some messages n

[PATCH] debugobjects: Move printk out of db lock critical sections

2018-12-12 Thread Waiman Long
The db->lock is a raw spinlock and so the lock hold time is supposed to be short. This will not be the case when printk() is being involved in some of the critical sections. In order to avoid the long hold time, in case some messages need to be printed, the debug_object_is_on_stack() and debug_prin