Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3e4dd75

Browse files
oleg-nesterovhnaz
authored andcommitted
memcg: kill CONFIG_MM_OWNER
CONFIG_MM_OWNER makes no sense. It is not user-selectable, it is only selected by CONFIG_MEMCG automatically. So we can kill this option in init/Kconfig and do s/CONFIG_MM_OWNER/CONFIG_MEMCG/ globally. Signed-off-by: Oleg Nesterov <[email protected]> Acked-by: Michal Hocko <[email protected]> Acked-by: Johannes Weiner <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent d31fa4e commit 3e4dd75

File tree

5 files changed

+7
-14
lines changed

5 files changed

+7
-14
lines changed

include/linux/mm_types.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ struct mm_struct {
406406
spinlock_t ioctx_lock;
407407
struct kioctx_table __rcu *ioctx_table;
408408
#endif
409-
#ifdef CONFIG_MM_OWNER
409+
#ifdef CONFIG_MEMCG
410410
/*
411411
* "owner" points to a task that is regarded as the canonical
412412
* user/owner of this mm. All of the following must be true in

include/linux/sched.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2956,7 +2956,7 @@ static inline void inc_syscw(struct task_struct *tsk)
29562956
#define TASK_SIZE_OF(tsk) TASK_SIZE
29572957
#endif
29582958

2959-
#ifdef CONFIG_MM_OWNER
2959+
#ifdef CONFIG_MEMCG
29602960
extern void mm_update_next_owner(struct mm_struct *mm);
29612961
extern void mm_init_owner(struct mm_struct *mm, struct task_struct *p);
29622962
#else
@@ -2967,7 +2967,7 @@ static inline void mm_update_next_owner(struct mm_struct *mm)
29672967
static inline void mm_init_owner(struct mm_struct *mm, struct task_struct *p)
29682968
{
29692969
}
2970-
#endif /* CONFIG_MM_OWNER */
2970+
#endif /* CONFIG_MEMCG */
29712971

29722972
static inline unsigned long task_rlimit(const struct task_struct *tsk,
29732973
unsigned int limit)

init/Kconfig

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -933,7 +933,6 @@ config RESOURCE_COUNTERS
933933
config MEMCG
934934
bool "Memory Resource Controller for Control Groups"
935935
depends on RESOURCE_COUNTERS
936-
select MM_OWNER
937936
select EVENTFD
938937
help
939938
Provides a memory resource controller that manages both anonymous
@@ -951,9 +950,6 @@ config MEMCG
951950
disable memory resource controller and you can avoid overheads.
952951
(and lose benefits of memory resource controller)
953952

954-
This config option also selects MM_OWNER config option, which
955-
could in turn add some fork/exit overhead.
956-
957953
config MEMCG_SWAP
958954
bool "Memory Resource Controller Swap Extension"
959955
depends on MEMCG && SWAP
@@ -1179,9 +1175,6 @@ config SCHED_AUTOGROUP
11791175
desktop applications. Task group autogeneration is currently based
11801176
upon task session.
11811177

1182-
config MM_OWNER
1183-
bool
1184-
11851178
config SYSFS_DEPRECATED
11861179
bool "Enable deprecated sysfs features to support old userspace tools"
11871180
depends on SYSFS

kernel/exit.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ int disallow_signal(int sig)
352352

353353
EXPORT_SYMBOL(disallow_signal);
354354

355-
#ifdef CONFIG_MM_OWNER
355+
#ifdef CONFIG_MEMCG
356356
/*
357357
* A task is exiting. If it owned this mm, find a new owner for the mm.
358358
*/
@@ -434,7 +434,7 @@ void mm_update_next_owner(struct mm_struct *mm)
434434
task_unlock(c);
435435
put_task_struct(c);
436436
}
437-
#endif /* CONFIG_MM_OWNER */
437+
#endif /* CONFIG_MEMCG */
438438

439439
/*
440440
* Turn us into a lazy TLB process if we

kernel/fork.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1099,12 +1099,12 @@ static void rt_mutex_init_task(struct task_struct *p)
10991099
#endif
11001100
}
11011101

1102-
#ifdef CONFIG_MM_OWNER
1102+
#ifdef CONFIG_MEMCG
11031103
void mm_init_owner(struct mm_struct *mm, struct task_struct *p)
11041104
{
11051105
mm->owner = p;
11061106
}
1107-
#endif /* CONFIG_MM_OWNER */
1107+
#endif /* CONFIG_MEMCG */
11081108

11091109
/*
11101110
* Initialize POSIX timer handling for a single task.

0 commit comments

Comments
 (0)