Giant Lock

In operating systems, a giant lock, also known as a big-lock or kernel-lock, is a lock which may be used in the kernel to provide the concurrency control required by symmetric multiprocessing (SMP) systems.

A giant lock is a solitary global lock that is held whenever a thread enters kernel space, and is released when the thread returns to user space (a system call is the archetypal example). In this model, threads in user space can run concurrently on any available processors or processor cores, but no more than one thread can run in kernel space; any other threads that try to enter kernel space are forced to wait. In other words, the giant lock eliminates all concurrency in kernel space.

By isolating the kernel from concurrency, many parts of the kernel no longer need to be modified to support SMP. By the same token, performance is predictably inefficient on SMP systems. Accordingly, the giant lock approach is commonly seen as a preliminary means of bringing SMP support to an operating system, yielding benefits only in user space. Most modern operating systems use a fine-grained locking approach.

The Linux kernel had a big kernel lock from the introduction of SMP until Arnd Bergmann removed it in 2011 after the final remaining uses of the big lock had been removed or replaced by finer grained locking.

Famous quotes containing the words giant and/or lock:

    Next week Reagan will probably announce that American scientists have discovered that the entire U.S. agricultural surplus can be compacted into a giant tomato one thousand miles across, which will be suspended above the Kremlin from a cluster of U.S. satellites flying in geosynchronous orbit. At the first sign of trouble the satellites will drop the tomato on the Kremlin, drowning the fractious Muscovites in ketchup.
    Alexander Cockburn (b. 1941)

    There warn’t anybody at the church, except maybe a hog or two, for there warn’t any lock on the door, and hogs likes a puncheon floor in summertime because it’s cool. If you notice, most folks don’t go to church only when they’ve got to; but a hog is different.
    Mark Twain [Samuel Langhorne Clemens] (1835–1910)