On Fri, 15 Nov 2019 08:36:56 -0800, Andrii Nakryiko wrote: > Alternatively we can use spinlock. I don't think it's too ugly, tbh. See below. > > From 0da495b911adad495857f1c0fc3596f1d06a705f Mon Sep 17 00:00:00 2001 > From: Andrii Nakryiko <andriin@xxxxxx> > Date: Fri, 15 Nov 2019 08:32:43 -0800 > Subject: [PATCH bpf-next] bpf: switch freeze locking to use spin_lock and save > space > > Switch to spin_lock in favor of mutex. Due to mmap-ing itself happening not > under spinlock, there needs to be an extra "correction" step for writecnt, if > mapping fails. FWIW I was pondering that too, and thought your initial design was nicer, the transient errors sometimes become a major PITA.