From mboxrd@z Thu Jan 1 00:00:00 1970 From: dhylands@gmail.com (Dave Hylands) Date: Tue, 17 May 2011 23:20:57 -0700 Subject: unlocked_ioctl explanation In-Reply-To: <669504.52385.qm@web39322.mail.mud.yahoo.com> References: <669504.52385.qm@web39322.mail.mud.yahoo.com> Message-ID: To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org Hi Ezequiel, 2011/5/17 Ezequiel Garc?a > > I am aware that ioctl has been superseeded by unlocked_ioctl. I've been looking through patches and this seems to be BKL related. > > Could someone explain further the differences and reasons for the new ioctl prototype and name? > > I guess 'unlocked' means BKL is no longer held inside ioctl, right? Exaclty. > What precautions should we take when using unlocked_ioctl ? Well, since there is no BKL, your ioctl can get preempted by another process and that other process just might happen to make an ioctl call to your driver. So your driver has to protect itself from being called by 2 threads simultaneously, if that's a problem. Some drivers won't need any extra protection. Unfortunately, it really depends on exactly what your driver code does. -- Dave Hylands Shuswap, BC, Canada http://www.davehylands.com