On Sun, Mar 22, 2026 at 9:29 PM Suren Baghdasaryan <[email protected]> wrote: > > On Sun, Mar 22, 2026 at 9:17 AM Andrew Morton <[email protected]> > wrote: > > > > On Sat, 21 Mar 2026 22:43:04 -0700 Suren Baghdasaryan <[email protected]> > > wrote: > > > > > Now that we have vma_start_write_killable() we can replace most of the > > > vma_start_write() calls with it, improving reaction time to the kill > > > signal. > > > > Thanks. Sashiko review raised a few possible issues: > > > > https://sashiko.dev/#/patchset/[email protected] > > Thanks! This Sashiko dude is good :)
Interestingly Sashiko had one false flag: "Does this code leave mm->locked_vm permanently corrupted if vma_start_write_killable() fails?" In mlock_fixup() the path that we call vma_start_write_killable() happens only if both new_vma_flags and old_vma_flags have their VMA_LOCKED_BIT set. In such case nr_pages is 0, so "mm->locked_vm += nr_pages;" does not change the value of mm->locked_vm and we are fine. Perhaps this can be used to improve the model? CC'ing Roman.
