Personal blog guide home page – click here
Original text:
Follows an explanation of the patch that introduced unlocked_ioctl and compat_ioctl into 2.6.11.
The removal of the ioctl field happened a lot later, in 2.6.36.
Explanation: When ioctl was executed, it took the Big Kernel Lock (BKL), so nothing else could
execute at the same time. This is very bad on a multiprocessor machine, so there was a big effort
to get rid of the BKL. First, unlocked_ioctl was introduced. It lets each driver writer choose
what lock to use instead. This can be difficult, so there was a period of transition during which
old drivers still worked (using ioctl) but new drivers could use the improved interface (unlocked_ioctl).
Eventually all drivers were converted and ioctl could be removed.
compat_ioctl is actually unrelated, even though it was added at the same time.
Its purpose is to allow 32-bit userland programs to make ioctl calls on a 64-bit kernel.
The meaning of the last argument to ioctl depends on the driver, so there is no way to
do a driver-independent conversion
Explanation:
IOCTL: (after 2.6.36, the field is removed). The application enters the kernel and holds a giant lock/big lock/kernel lock. At the same time, only one application enters the kernel spaceunlocked_ IOCTL: 64 is a non giant lock called by the application_ IOCTL: 32 is a non giant lock called by the application
Reference:
giant lock: giant lock – font> big kernel lock (BKL)
fine graded locking: non giant lock – font> fine graded locking
what is the difference between IOCTL unlocked IOCTL and compat IOCTL
Read More:
- Linux error ttyname failed: inappropriate IOCTL for device solution
- About VMware: vmw_ ioctl_ Command error invalid argument. Solution
- ionic4- error TS2307: Cannot find module ‘rxjs-compat/Observable’
- Uncaught Error: No select2/compat/inputData
- Problem solving module ‘ tensorflow.compat . V2 ‘has no attribute’ contrib ‘and importerror cannot import name’ auto ‘
- The difference and usage of insmod and modprobe
- The difference between sleep() and wait() in Java
- The difference between classnotfoundexception and NoClassDefFoundError
- The difference between LSTM and Gru
- The difference between problem and observables
- The difference between hive and relational database
- Difference between getelementsbyname and getelementbyid
- The difference between onready or $() and onload
- The difference between “?” and “?:” introduced by php7
- JavaScript summary: the difference between typeof and instanceof, and Object.prototype.toString() method
- C#: Analysis of the difference between write() and writeline()
- Difference between vs code user and system version
- The tutorial and difference of glew, glfw, glad and freeglut
- The usage and difference of atoi() and stoi() functions in C + +
- The difference of four kinds of integer function (fix floor ceil round) in MATLAB