Yes, it is. Since I just ran into the above splat, so I just did the
minimum change.

1) /proc/*/cmdline only wants to read 4 values atomically,
those 4 values are basically random values and aren't
related to VM part at all (after C/R went in, they are
settable to arbitrary values)

Sorry, I don't get your point here. Could you please elaborate?

I hoped there is some random spinlock those 4 values could be moved to
but no.

2) access_remote_vm() et al will do the same ->mmap_sem, and

Yes, it does. But, __access_remote_vm() is called by access_process_vm()
too, which is used by much more places, i.e. ptrace, so I was not sure
if it is preferred to convert to killable version. So, I leave it untouched.

Yeah, but ->mmap_sem is taken 3 times per /proc/*/cmdline read
and your scalability tests should trigger next backtrace right away.

3) /proc/*/environ and get_cmdline() do the same.

They look suitable to use killable version.

Had a look at get_cmdline() further. It looks it is not necessary to
convert to killable since it is called mainly by audit_exit(), which is
called when process or syscall exit, so it might be preferred to wait
until the mmap_sem is released. So, it sounds pointless to use
down_read_killable().

Thanks,
Yang

BTW, I just realized the code should go to out_free_page instead of
out_mmput. Will rectify in newer version once we decide the extra places
to use killable version.