Messages in this thread | | | Subject | Re: drm_vm.c:drm_mmap: possible circular locking dependency detected (was: Re: Linux 2.6.33-rc2 - Merry Christmas ...) | From | (Eric W. Biederman) | Date | Wed, 30 Dec 2009 13:34:38 -0800 |
| |
Linus Torvalds <torvalds@linux-foundation.org> writes:
> We've seen it several times (yes, mostly with drm, but it's been seen with > others too), and it's very annoying. It can be fixed by having very > careful readdir implementations, but I really would blame sysfs in > particular for having a very annoying lock reversal issue when used > reasonably.
Maybe. The mnmap_sem has some interesting issues all of it's own. What reasonable thing is the drm doing that is causing problems?
> So the optimal situation would be for sysfs to not have that annoying lock > dependency, and it would really have to be sysfs_readdir() that drops the > sysfs_mutex around the filldir call (and that obviously implies having to > re-validate and be really careful). > > Added Eric and Greg to the cc, in case the sysfs people want to solve it.
There are scalability reasons for dropping the sysfs_mutex in sysfs_readdir and I have some tenative patches for that. I will take a look after I come back from the holidays, in a couple of days. I don't understand the issue as described.
> And yes, one option would be to just fix drm - by avoiding calling any > sysfs functions while holding the mmap_lock (either in the mmap callback > or the page fault paths). However, as mentioned, I really do think that > the blame can be laid on sysfs for trying to be a nice generic interface, > but having a damn inconvenient locking model.
Could be. I have simplified the sysfs locking quite a bit this last round. I don't know if there is much more than corner cases left to improve.
Eric
| |