WSL2-Linux-Kernel/include
Peter Zijlstra 7531e2f34d lockdep: lock protection locks
On Fri, 2008-08-01 at 16:26 -0700, Linus Torvalds wrote:

> On Fri, 1 Aug 2008, David Miller wrote:
> >
> > Taking more than a few locks of the same class at once is bad
> > news and it's better to find an alternative method.
>
> It's not always wrong.
>
> If you can guarantee that anybody that takes more than one lock of a
> particular class will always take a single top-level lock _first_, then
> that's all good. You can obviously screw up and take the same lock _twice_
> (which will deadlock), but at least you cannot get into ABBA situations.
>
> So maybe the right thing to do is to just teach lockdep about "lock
> protection locks". That would have solved the multi-queue issues for
> networking too - all the actual network drivers would still have taken
> just their single queue lock, but the one case that needs to take all of
> them would have taken a separate top-level lock first.
>
> Never mind that the multi-queue locks were always taken in the same order:
> it's never wrong to just have some top-level serialization, and anybody
> who needs to take <n> locks might as well do <n+1>, because they sure as
> hell aren't going to be on _any_ fastpaths.
>
> So the simplest solution really sounds like just teaching lockdep about
> that one special case. It's not "nesting" exactly, although it's obviously
> related to it.

Do as Linus suggested. The lock protection lock is called nest_lock.

Note that we still have the MAX_LOCK_DEPTH (48) limit to consider, so anything
that spills that it still up shit creek.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-08-11 09:30:24 +02:00
..
acpi PCI: disable ASPM per ACPI FADT setting 2008-07-28 14:56:09 -07:00
asm-alpha [PATCH] kill altroot 2008-07-26 20:53:20 -04:00
asm-arm Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6 2008-07-28 18:14:24 -07:00
asm-avr32 Merge commit 'upstream/master' 2008-07-27 13:54:08 +02:00
asm-blackfin [PATCH] kill altroot 2008-07-26 20:53:20 -04:00
asm-cris Merge branch 'linus' into core/generic-dma-coherent 2008-07-29 00:07:55 +02:00
asm-frv [PATCH] kill altroot 2008-07-26 20:53:20 -04:00
asm-generic Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6 2008-07-28 18:14:24 -07:00
asm-h8300 [PATCH] kill altroot 2008-07-26 20:53:20 -04:00
asm-ia64 [PATCH] kill altroot 2008-07-26 20:53:20 -04:00
asm-m32r [PATCH] kill altroot 2008-07-26 20:53:20 -04:00
asm-m68k [PATCH] kill altroot 2008-07-26 20:53:20 -04:00
asm-m68knommu [PATCH] kill altroot 2008-07-26 20:53:20 -04:00
asm-mips [PATCH] kill altroot 2008-07-26 20:53:20 -04:00
asm-mn10300 [PATCH] kill altroot 2008-07-26 20:53:20 -04:00
asm-parisc [PATCH] kill altroot 2008-07-26 20:53:20 -04:00
asm-powerpc powerpc/mm: Implement _PAGE_SPECIAL & pte_special() for 64-bit 2008-07-28 16:30:52 +10:00
asm-s390 KVM: s390: Fix instruction naming for lctlg 2008-07-27 11:36:12 +03:00
asm-sh Merge branch 'linus' into core/generic-dma-coherent 2008-07-29 00:07:55 +02:00
asm-um [PATCH] kill altroot 2008-07-26 20:53:20 -04:00
asm-x86 Merge branch 'linus' into core/generic-dma-coherent 2008-07-29 00:07:55 +02:00
asm-xtensa [PATCH] kill altroot 2008-07-26 20:53:20 -04:00
crypto crypto: hash - Move ahash functions into crypto/hash.h 2008-07-10 20:35:18 +08:00
drm drm/radeon: fixup issue with radeon and PAT support. 2008-07-15 15:48:05 +10:00
keys
linux lockdep: lock protection locks 2008-08-11 09:30:24 +02:00
math-emu
media V4L/DVB (8525): fix a few assorted spelling mistakes. 2008-07-27 11:07:13 -03:00
mtd Merge branch 'linux-next' of git://git.infradead.org/~dedekind/ubi-2.6 2008-07-25 10:40:14 -04:00
net missing bits of net-namespace / sysctl 2008-07-27 09:45:34 -07:00
pcmcia pcmcia: (re)move {pcmcia,pccard}_get_status 2008-06-24 15:33:44 +02:00
rdma dma-mapping: add the device argument to dma_mapping_error() 2008-07-26 12:00:03 -07:00
rxrpc
scsi [SCSI] extend the last_sector_bug flag to cover more sectors 2008-07-27 10:16:13 -04:00
sound ALSA: Release v1.0.17 2008-07-14 09:54:43 +02:00
video include/video/atmel_lcdc.h must #include <linux/workqueue.h> 2008-07-26 12:00:01 -07:00
xen xen: implement Xen-specific spinlocks 2008-07-16 11:15:53 +02:00
Kbuild kbuild: only one call for include/ in make headers_* 2008-07-25 22:11:44 +02:00