Skip to content

RFC Cleanup init_MUTEX[_LOCKED] / DECLARE_MUTEX

Thomas Gleixner linux-scsi lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest37 patches 22 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/37semaphore: Add DEFINE_SEMAPHORE, semaphore_init, semaphore_init_lockedinclude/linux/semaphore.h+17 -04 replies
2/37input: keyboard/hil_kbd: semaphore cleanupdrivers/input/keyboard/hil_kbd.c+1 -11 reply
3/37input: misc/hp_sdc_rtc: semaphore cleanupdrivers/input/misc/hp_sdc_rtc.c+2 -20 replies
4/37input: mouse/hil_ptr: semaphore cleanupdrivers/input/mouse/hil_ptr.c+1 -10 replies
5/37input: serio/hil_mlc: semaphore cleanupdrivers/input/serio/hil_mlc.c+3 -30 replies
6/37input: serio/hp_sdc: semaphore cleanupdrivers/input/serio/hp_sdc.c+1 -10 replies
7/37net: 3c527: semaphore cleanupdrivers/net/3c527.c+1 -10 replies
8/37hamradio: 6pack: semaphore cleanupdrivers/net/hamradio/6pack.c+1 -10 replies
9/37hamradio: mkiss: semaphore cleanupdrivers/net/hamradio/mkiss.c+1 -10 replies
10/37net: ppp_async: semaphore cleanupdrivers/net/ppp_async.c+1 -10 replies
11/37parport: semaphore cleanupdrivers/parport/share.c+1 -10 replies
12/37ibmphp-hpc: semaphore cleanupdrivers/pci/hotplug/ibmphp_hpc.c+2 -20 replies
13/37s390: cio/crw: semaphore cleanupdrivers/s390/cio/crw.c+1 -11 reply
14/37scsi: aacraid semaphore cleanupdrivers/scsi/aacraid/commctrl.c drivers/scsi/aacraid/commsup.c+2 -22 replies
15/37bluetooth: Convert hdev->req_lock to mutexinclude/net/bluetooth/hci_core.h net/bluetooth/hci_core.c+4 -42 replies
16/37smbfs: Convert server->sem to mutexfs/smbfs/inode.c include/linux/smb_fs_sb.h+5 -50 replies
17/37hpfs: Convert sbi->hpfs_creation_de to mutexfs/hpfs/buffer.c fs/hpfs/hpfs_fn.h fs/hpfs/super.c+4 -40 replies
18/37hpfsplus: Convert tree_lock to mutexfs/hfsplus/bfind.c fs/hfsplus/btree.c fs/hfsplus/hfsplus_fs.h+4 -40 replies
19/37hfs: Convert tree_lock to mutexfs/hfs/bfind.c fs/hfs/btree.c fs/hfs/btree.h+4 -40 replies
20/37cifs: convert semaphore to mutexfs/cifs/cifsglob.h fs/cifs/cifssmb.c fs/cifs/connect.c +1 more+15 -153 replies
21/37affs: use semaphore_init instead of init_MUTEXfs/affs/super.c+2 -21 reply
22/37usb: ftdi-elan: Convert "mutex" to semaphoredrivers/usb/misc/ftdi-elan.c+1 -10 replies
23/37usb: gadgetfs: Convert semaphore to mutexdrivers/usb/gadget/inode.c+21 -181 reply
24/37xfs: semaphore cleanupfs/xfs/linux-2.6/xfs_buf.c+1 -11 reply
25/37net: wan/cosa.c: Convert "mutex" to semaphoredrivers/net/wan/cosa.c+1 -10 replies
26/37irda: semaphore cleanupdrivers/net/irda/sir_dev.c+1 -10 replies
27/37mmc: Convert "mutex" to semaphoredrivers/mmc/card/queue.c+1 -10 replies
28/37dvb: Convert "mutex" to semaphoredrivers/media/dvb/dvb-core/dvb_frontend.c+2 -20 replies
29/37infiniband: Make user_mad semaphore a real onedrivers/infiniband/core/user_mad.c+1 -12 replies
30/37drivers/base: Convert dev->sem to mutexdrivers/base/bus.c drivers/base/core.c drivers/base/dd.c +12 more+64 -650 replies
31/37ia64: salinfo: semaphore_init instead of init_MUTEXarch/ia64/kernel/salinfo.c+1 -10 replies
32/37drivers/macintosh/adb: Do not claim that the semaphore is a mutexdrivers/macintosh/adb.c+1 -10 replies
33/37arm: w90x900: convert semaphore to mutexarch/arm/mach-w90x900/mfp-w90p910.c+7 -71 reply
34/37printk: Make console_sem a semaphore not a pseudo mutexkernel/printk.c+2 -20 replies
35/37staging: Bulk convert the semaphore messdrivers/staging/comedi/drivers/dt9812.c drivers/staging/comedi/drivers/usbdux.c drivers/staging/comedi/drivers/usbduxfast.c +14 more+23 -230 replies
36/37fs: Convert bd_mount_sem to mutexfs/block_dev.c fs/super.c include/linux/fs.h+7 -73 replies
37/37semaphore: Remove mutex emulationinclude/linux/semaphore.h scripts/checkpatch.pl+3 -120 replies

Reviews trailers per patch

4 of 37 patches have a Reviewed-by or Acked-by.

PatchMarcel HoltmannJeff LaytonWan ZongShunMartin Schwidefsky
1/37
2/37
3/37
4/37
5/37
6/37
7/37
8/37
9/37
10/37
11/37
12/37
13/37A-b
14/37
15/37A-b
16/37
17/37
18/37
19/37
20/37A-b
21/37
22/37
23/37
24/37
25/37
26/37
27/37
28/37
29/37
30/37
31/37
32/37
33/37A-b
34/37
35/37
36/37
37/37

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v1 thread

Cover letter [Patch RFC 00/37] Cleanup init_MUTEX[_LOCKED] / DECLARE_MUTEX

There are still semaphores left which are used as mutexes. Many of them are not mutexes; they are used as completions and serialization object at the same time. Some others are simple mutexes and nobody bothered to clean them up.

Most of the cases have been identified in the preempt-rt patch. The conversion to mutexes has been tested with both lockdep and mutex debugging for quite a time. The other semaphore style users are simply converted to semaphores and the init_MUTEX[_LOCKED] / DECLARE_MUTEX confusion is removed.

Andrew: it would be great if we could merge the infrastructure patch [1/n] right away. It does not change any code as it just adds DEFINE_SEMAPHORE, semaphore_init() and semaphore_init_locked(). The latter is marked deprecated as well as the locked init usually points to a completion like use case. Merging it now would allow the maintainers to queue up the cleanup patches for .32

Thanks,

tglx