Re: [PATCH v3 10/10] mmap locking API: rename mmap_sem to mmap_lock

From: Peter Zijlstra
Date: Wed Apr 01 2020 - 09:49:11 EST


On Fri, Mar 27, 2020 at 03:51:02PM -0700, Michel Lespinasse wrote:
> Rename the mmap_sem field to mmap_lock. Any new uses of this lock
> should now go through the new mmap locking api. The mmap_lock is
> still implemented as a rwsem, though this could change in the future.

> diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
> index c28911c3afa8..a168d13b5c44 100644
> --- a/include/linux/mm_types.h
> +++ b/include/linux/mm_types.h
> @@ -431,7 +431,7 @@ struct mm_struct {
> spinlock_t page_table_lock; /* Protects page tables and some
> * counters
> */
> - struct rw_semaphore mmap_sem;
> + struct rw_semaphore mmap_lock;

It would be best if you change the type too.

>
> struct list_head mmlist; /* List of maybe swapped mm's. These
> * are globally strung together off