History

futex: Make futex_mm_init() void

Nothing fails there. Mop up the leftovers of the early version of this, which did an allocation. While at it clean up the stubs and the #ifdef comments to make the header file readable.

Thomas Gleixner committed 5 months ago

Commit d7b3f521 parent c1ffc9c3 files · +14 −25Browse files

Showing the changes to kernel (2 of 3 files). Show all

Unified · Split

2 files
  1. kernel/fork.c +2 −6
  2. kernel/futex/core.c +1 −2
kernel/fork.c+2−6
@@ -1101,6 +1101,7 @@ static struct mm_struct *mm_init(struct mm_struct *mm, struct task_struct *p, · 1100 unmodified lines
11011101 #endif
11021102 mm_init_uprobes_state(mm);
11031103 hugetlb_count_init(mm);
1104+ futex_mm_init(mm);
11041105
11051106 mm_flags_clear_all(mm);
11061107 if (current->mm) {
@@ -1113,11 +1114,8 @@ static struct mm_struct *mm_init(struct mm_struct *mm, struct task_struct *p, · 6 unmodified lines
11131114 mm->def_flags = 0;
11141115 }
11151116
1116− if (futex_mm_init(mm))
1117− goto fail_mm_init;
1118−
11191117 if (mm_alloc_pgd(mm))
1120− goto fail_nopgd;
1118+ goto fail_mm_init;
11211119
11221120 if (mm_alloc_id(mm))
11231121 goto fail_noid;
@@ -1144,8 +1142,6 @@ fail_nocontext: · 20 unmodified lines
11441142 mm_free_id(mm);
11451143 fail_noid:
11461144 mm_free_pgd(mm);
1147−fail_nopgd:
1148− futex_hash_free(mm);
11491145 fail_mm_init:
11501146 free_mm(mm);
11511147 return NULL;
kernel/futex/core.c+1−2
@@ -1720,7 +1720,7 @@ static bool futex_ref_is_dead(struct futex_private_hash *fph) · 1719 unmodified lines
17201720 return atomic_long_read(&mm->futex_atomic) == 0;
17211721 }
17221722
1723−int futex_mm_init(struct mm_struct *mm)
1723+void futex_mm_init(struct mm_struct *mm)
17241724 {
17251725 mutex_init(&mm->futex_hash_lock);
17261726 RCU_INIT_POINTER(mm->futex_phash, NULL);
@@ -1729,7 +1729,6 @@ int futex_mm_init(struct mm_struct *mm) · 2 unmodified lines
17291729 mm->futex_ref = NULL;
17301730 atomic_long_set(&mm->futex_atomic, 0);
17311731 mm->futex_batches = get_state_synchronize_rcu();
1732− return 0;
17331732 }
17341733
17351734 void futex_hash_free(struct mm_struct *mm)