Skip to content

Commit 984cfe4

Browse files
committed
mm/mmu_notifier: Rename struct mmu_notifier_mm to mmu_notifier_subscriptions
The name mmu_notifier_mm implies that the thing is a mm_struct pointer, and is difficult to abbreviate. The struct is actually holding the interval tree and hlist containing the notifiers subscribed to a mm. Use 'subscriptions' as the variable name for this struct instead of the really terrible and misleading 'mmn_mm'. Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent c79f46a commit 984cfe4

File tree

5 files changed

+184
-170
lines changed

5 files changed

+184
-170
lines changed

include/linux/mm_types.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ struct mm_struct {
490490
/* store ref to file /proc/<pid>/exe symlink points to */
491491
struct file __rcu *exe_file;
492492
#ifdef CONFIG_MMU_NOTIFIER
493-
struct mmu_notifier_mm *mmu_notifier_mm;
493+
struct mmu_notifier_subscriptions *notifier_subscriptions;
494494
#endif
495495
#if defined(CONFIG_TRANSPARENT_HUGEPAGE) && !USE_SPLIT_PMD_PTLOCKS
496496
pgtable_t pmd_huge_pte; /* protected by page_table_lock */

include/linux/mmu_notifier.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#include <linux/srcu.h>
99
#include <linux/interval_tree.h>
1010

11-
struct mmu_notifier_mm;
11+
struct mmu_notifier_subscriptions;
1212
struct mmu_notifier;
1313
struct mmu_notifier_range;
1414
struct mmu_interval_notifier;
@@ -265,7 +265,7 @@ struct mmu_notifier_range {
265265

266266
static inline int mm_has_notifiers(struct mm_struct *mm)
267267
{
268-
return unlikely(mm->mmu_notifier_mm);
268+
return unlikely(mm->notifier_subscriptions);
269269
}
270270

271271
struct mmu_notifier *mmu_notifier_get_locked(const struct mmu_notifier_ops *ops,
@@ -364,7 +364,7 @@ static inline bool mmu_interval_check_retry(struct mmu_interval_notifier *mni,
364364
return READ_ONCE(mni->invalidate_seq) != seq;
365365
}
366366

367-
extern void __mmu_notifier_mm_destroy(struct mm_struct *mm);
367+
extern void __mmu_notifier_subscriptions_destroy(struct mm_struct *mm);
368368
extern void __mmu_notifier_release(struct mm_struct *mm);
369369
extern int __mmu_notifier_clear_flush_young(struct mm_struct *mm,
370370
unsigned long start,
@@ -480,15 +480,15 @@ static inline void mmu_notifier_invalidate_range(struct mm_struct *mm,
480480
__mmu_notifier_invalidate_range(mm, start, end);
481481
}
482482

483-
static inline void mmu_notifier_mm_init(struct mm_struct *mm)
483+
static inline void mmu_notifier_subscriptions_init(struct mm_struct *mm)
484484
{
485-
mm->mmu_notifier_mm = NULL;
485+
mm->notifier_subscriptions = NULL;
486486
}
487487

488-
static inline void mmu_notifier_mm_destroy(struct mm_struct *mm)
488+
static inline void mmu_notifier_subscriptions_destroy(struct mm_struct *mm)
489489
{
490490
if (mm_has_notifiers(mm))
491-
__mmu_notifier_mm_destroy(mm);
491+
__mmu_notifier_subscriptions_destroy(mm);
492492
}
493493

494494

@@ -692,11 +692,11 @@ static inline void mmu_notifier_invalidate_range(struct mm_struct *mm,
692692
{
693693
}
694694

695-
static inline void mmu_notifier_mm_init(struct mm_struct *mm)
695+
static inline void mmu_notifier_subscriptions_init(struct mm_struct *mm)
696696
{
697697
}
698698

699-
static inline void mmu_notifier_mm_destroy(struct mm_struct *mm)
699+
static inline void mmu_notifier_subscriptions_destroy(struct mm_struct *mm)
700700
{
701701
}
702702

kernel/fork.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,7 @@ void __mmdrop(struct mm_struct *mm)
692692
WARN_ON_ONCE(mm == current->active_mm);
693693
mm_free_pgd(mm);
694694
destroy_context(mm);
695-
mmu_notifier_mm_destroy(mm);
695+
mmu_notifier_subscriptions_destroy(mm);
696696
check_mm(mm);
697697
put_user_ns(mm->user_ns);
698698
free_mm(mm);
@@ -1025,7 +1025,7 @@ static struct mm_struct *mm_init(struct mm_struct *mm, struct task_struct *p,
10251025
mm_init_aio(mm);
10261026
mm_init_owner(mm, p);
10271027
RCU_INIT_POINTER(mm->exe_file, NULL);
1028-
mmu_notifier_mm_init(mm);
1028+
mmu_notifier_subscriptions_init(mm);
10291029
init_tlb_flush_pending(mm);
10301030
#if defined(CONFIG_TRANSPARENT_HUGEPAGE) && !USE_SPLIT_PMD_PTLOCKS
10311031
mm->pmd_huge_pte = NULL;

mm/debug.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ void dump_mm(const struct mm_struct *mm)
153153
#endif
154154
"exe_file %px\n"
155155
#ifdef CONFIG_MMU_NOTIFIER
156-
"mmu_notifier_mm %px\n"
156+
"notifier_subscriptions %px\n"
157157
#endif
158158
#ifdef CONFIG_NUMA_BALANCING
159159
"numa_next_scan %lu numa_scan_offset %lu numa_scan_seq %d\n"
@@ -185,7 +185,7 @@ void dump_mm(const struct mm_struct *mm)
185185
#endif
186186
mm->exe_file,
187187
#ifdef CONFIG_MMU_NOTIFIER
188-
mm->mmu_notifier_mm,
188+
mm->notifier_subscriptions,
189189
#endif
190190
#ifdef CONFIG_NUMA_BALANCING
191191
mm->numa_next_scan, mm->numa_scan_offset, mm->numa_scan_seq,

0 commit comments

Comments
 (0)