Replacing mmap_sem with Finer Grained Locks

Replacing mmap_sem with Finer Grained Locks

Linux Plumbers Conference via YouTube Direct link

Intro

1 of 10

1 of 10

Intro

Class Central Classrooms beta

YouTube playlists curated by Class Central.

Classroom Contents

Replacing mmap_sem with Finer Grained Locks

Automatically move to the next video in the Classroom when playback concludes

  1. 1 Intro
  2. 2 The problem with mmap_sem • The situation described earlier (rue conflict between fault and munmap) is extremely uncommon! . Correct threaded programs normally avoid having their threads race against…
  3. 3 mmap_sem false conflicts . Some threads allocate or free some (large) memory blocks • Some threads access memory they have already allocated . Some threads are getting spawned (thus requiring new use…
  4. 4 Goals for mmap_sem replacement . Contention should ideally only occur between threads manipulating the same memory . May block on locks protecting shared data structures, as long as they are only hel…
  5. 5 Supporting progressive replacement . Our mmap sem replacement needs to support both coarse lockers (automatically converted from the current mma sem uses) and fine grained lockers (with an associated…
  6. 6 Converting one mmap_sem locker . When the locker is converted to fine grained, it needs to protect against shared data structures being concurrently accessed by another fine grained locker • Add new …
  7. 7 Basic implementation ideas . Use a range locking data structure to represent current and pending range locks • Address ranges may be locked for read or write • Add new lock (mmvma_lock) protecting bo…
  8. 8 Page fault path: acquiring range lock • Examine VMA for the faulting address • Determine appropriate locking range for the address and VMA type (i.e., 2MB range around the address in the anon VMA cas…
  9. 9 Page fault path: faulting the page • Fault the page as usual, based on VMA attributes obtained at the start of the fault. The attributes won't change as the range is read locked. . Note that VMA attr…
  10. 10 Future plans . Grow the number of places we do fine grained locking • Performance comparison • Expect we may have to add speculative faults to bring the performance up • Possibly replace the centrali…

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.