Re: drm_vm.c:drm_mmap: possible circular locking dependency detected

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Tejun Heo
Date: Friday, January 1, 2010 - 7:59 pm

Hello, Eric.

On 01/02/2010 12:16 AM, Eric W. Biederman wrote:

The synchronization against read/write ops is in sysfs_deactivate on
purpose so that drivers (most common users) don't have to worry about
sysfs ops accessing different parts of data structures once
device_del() is complete.  Implementing the exlusion at the driver
level is possible but not easy because some hardware devices are
represented with complex data structures, some of them are reused when
devices are exchanged and some sysfs ops end up accessing the
hardware.  So, it's often not possible to simply disassociate the data
structure and float it till the last reference goes away.  There needs
to be a synchronization point where the driver can tell that nothing
is accessing released data structure or hardware resource after it and
it's far easier to define it at the sysfs level.


Nobody would know when that final put will actually happen.  In
progress sysfs ops might access the hardware after the hardware is
gone or replaced with another unit.


I don't think this is really relevant to the problem at hand but
adding lockdep annotations would definitely be beneficial, which BTW
is another reason to leave the synchronization in sysfs_deactivate as
the trade off is between deadlocks which can be detected somewhat
reliably with lockdep and scary race conditions which may involve
hardware in mysterious ways.

Thanks.

-- 
tejun
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Linux 2.6.33-rc2 - Merry Christmas ..., Linus Torvalds, (Thu Dec 24, 3:00 pm)
-tip: origin tree boot crash, Ingo Molnar, (Fri Dec 25, 3:27 am)
Re: Linux 2.6.33-rc2 - Blank screen for Intel KMS, Miguel Calleja, (Fri Dec 25, 6:10 am)
Re: -tip: origin tree boot crash, Dmitry Torokhov, (Fri Dec 25, 12:49 pm)
Re: Linux 2.6.33-rc2 - Merry Christmas ..., Borislav Petkov, (Fri Dec 25, 1:00 pm)
Re: Linux 2.6.33-rc2 - Merry Christmas ..., Borislav Petkov, (Fri Dec 25, 2:50 pm)
Re: Linux 2.6.33-rc2 - Merry Christmas ..., Jesse Barnes, (Fri Dec 25, 11:00 pm)
Re: Linux 2.6.33-rc2 - Merry Christmas ..., Borislav Petkov, (Sat Dec 26, 1:02 am)
Re: -tip: origin tree boot crash, Len Brown, (Sat Dec 26, 1:17 pm)
Re: -tip: origin tree boot crash, Len Brown, (Sat Dec 26, 1:19 pm)
Re: -tip: origin tree boot crash, Len Brown, (Sat Dec 26, 9:20 pm)
Re: -tip: origin tree boot crash, Ingo Molnar, (Mon Dec 28, 2:44 am)
Re: -tip: origin tree boot crash, Ingo Molnar, (Mon Dec 28, 5:01 am)
Re: -tip: origin tree boot crash, Paul Rolland, (Mon Dec 28, 8:02 am)
Re: -tip: origin tree boot crash, Paul Rolland, (Mon Dec 28, 9:15 am)
Re: -tip: origin tree boot crash, Paul Rolland, (Mon Dec 28, 9:53 am)
Re: -tip: origin tree boot crash, Dmitry Torokhov, (Mon Dec 28, 1:17 pm)
Re: Linux 2.6.33-rc2 - Blank screen for Intel KMS, Miguel Calleja, (Tue Dec 29, 2:50 am)
Re: Linux 2.6.33-rc2 - Blank screen for Intel KMS, Rafael J. Wysocki, (Tue Dec 29, 7:01 am)
Re: -tip: origin tree boot crash, Len Brown, (Tue Dec 29, 11:14 pm)
Re: -tip: origin tree boot crash, Paul Rolland, (Wed Dec 30, 12:13 am)
Re: drm_vm.c:drm_mmap: possible circular locking dependenc ..., Eric W. Biederman, (Wed Dec 30, 2:34 pm)
Re: drm_vm.c:drm_mmap: possible circular locking dependenc ..., Eric W. Biederman, (Thu Dec 31, 1:40 am)
Re: drm_vm.c:drm_mmap: possible circular locking dependenc ..., Eric W. Biederman, (Thu Dec 31, 1:40 am)
Re: drm_vm.c:drm_mmap: possible circular locking dependenc ..., Tejun Heo, (Fri Jan 1, 7:59 pm)
Re: drm_vm.c:drm_mmap: possible circular locking dependenc ..., Eric W. Biederman, (Sat Jan 2, 10:38 pm)
Re: drm_vm.c:drm_mmap: possible circular locking dependenc ..., Eric W. Biederman, (Mon Jan 4, 12:43 pm)
Re: [PATCH] sysfs: Add lockdep annotations for the sysfs a ..., Eric W. Biederman, (Sun Jan 17, 10:18 am)
Re: [PATCH] sysfs: Add lockdep annotations for the sysfs a ..., Dominik Brodowski, (Sun Jan 17, 11:03 am)