Re: [PATCH v4 08/10] mmap locking API: add MMAP_LOCK_INITIALIZER

From: Matthew Wilcox
Date: Mon Apr 20 2020 - 15:28:12 EST


On Tue, Apr 14, 2020 at 05:43:51PM -0700, Michel Lespinasse wrote:
> @@ -90,7 +90,7 @@ static struct mm_struct tboot_mm = {
^^^^^^^^
> .pgd = swapper_pg_dir,
> .mm_users = ATOMIC_INIT(2),
> .mm_count = ATOMIC_INIT(1),
> - .mmap_sem = __RWSEM_INITIALIZER(init_mm.mmap_sem),
> + .mmap_sem = MMAP_LOCK_INITIALIZER(init_mm.mmap_sem),
^^^^^^^

Shome mishtake, shirley?

I don't see that this particular patch buys us much. The name 'mmap_sem'
is still used, and I appreciate we abstract away the type of the lock,
but wouldn't this be better?

- .mmap_sem = __RWSEM_INITIALIZER(init_mm.mmap_sem),
+ MMAP_LOCK_INITIALIZER(tboot_mm),