memcg: cleanup useless LRU_ALL_EVICTABLE
Subsystems (5)
PATCH v3 1/4 memcg: cleanup useless LRU_ALL_EVICTABLE
From: Wanpeng Li <[email protected]>
Since LRU_ALL_EVICTABLE is useless, just remove it. Add LRU_ALL_UNEVICTABLE to mask unevictable pages.
--- include/linux/mmzone.h | 2 +- mm/memcontrol.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
include/linux/mmzone.h +1 -1
@@ -209,7 +209,7 @@ struct lruvec {/* Mask used at gathering information at once (see memcontrol.c) */ #define LRU_ALL_FILE (BIT(LRU_INACTIVE_FILE) | BIT(LRU_ACTIVE_FILE))#define LRU_ALL_ANON (BIT(LRU_INACTIVE_ANON) | BIT(LRU_ACTIVE_ANON)) -#define LRU_ALL_EVICTABLE (LRU_ALL_FILE | LRU_ALL_ANON) +#define LRU_ALL_UNEVICTABLE (BIT(LRU_UNEVICTABLE))#define LRU_ALL ((1 << NR_LRU_LISTS) - 1)/* Isolate clean file */
mm/memcontrol.c +2 -2
@@ -4033,11 +4033,11 @@ static int mem_control_numa_stat_show(struct cgroup *cont, struct cftype *cft, }seq_putc (m,'\n' ); - unevictable_nr =mem_cgroup_nr_lru_pages (memcg,BIT (LRU_UNEVICTABLE )); + unevictable_nr =mem_cgroup_nr_lru_pages (memcg,LRU_ALL_UNEVICTABLE );seq_printf (m,"unevictable=%lu" , unevictable_nr);for_each_node_state (nid,N_HIGH_MEMORY ) { node_nr =mem_cgroup_node_nr_lru_pages (memcg, nid, -BIT (LRU_UNEVICTABLE )); +LRU_ALL_UNEVICTABLE );seq_printf (m," N%d=%lu" , nid, node_nr); }seq_putc (m,'\n' );
Signature · 1 line
1.7.9.5
Marking this patch as memcg is quite misleading. mm is more suitable.
Quoted 3 lines · Wanpeng Li
From: Wanpeng Li <[email protected]>
Since
LRU_ALL_EVICTABLEis useless, just remove it.
It's really strange but I do not see any usage of this except for it's introduction. So agreed to remove it.
Quoted 1 line
Add
LRU_ALL_UNEVICTABLEto mask unevictable pages.
Does it really make sense to introduce just for two uses in a single function?
Quoted 45 lines
Signed-off-by Wanpeng Li <[email protected]>--- include/linux/mmzone.h | 2 +- mm/memcontrol.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)include/linux/mmzone.h +1
-1@@ -209,7 +209,7 @@ struct lruvec {/* Mask used at gathering information at once (see memcontrol.c) */ #define LRU_ALL_FILE (BIT(LRU_INACTIVE_FILE) | BIT(LRU_ACTIVE_FILE))#define LRU_ALL_ANON (BIT(LRU_INACTIVE_ANON) | BIT(LRU_ACTIVE_ANON)) -#define LRU_ALL_EVICTABLE (LRU_ALL_FILE | LRU_ALL_ANON) +#define LRU_ALL_UNEVICTABLE (BIT(LRU_UNEVICTABLE))#define LRU_ALL ((1 << NR_LRU_LISTS) - 1)/* Isolate clean file */ mm/memcontrol.c +2
-2@@ -4033,11 +4033,11 @@ static int mem_control_numa_stat_show(struct cgroup *cont, struct cftype *cft, }seq_putc (m,'\n' ); - unevictable_nr =mem_cgroup_nr_lru_pages (memcg,BIT (LRU_UNEVICTABLE )); + unevictable_nr =mem_cgroup_nr_lru_pages (memcg,LRU_ALL_UNEVICTABLE );seq_printf (m,"unevictable=%lu" , unevictable_nr);for_each_node_state (nid,N_HIGH_MEMORY ) { node_nr =mem_cgroup_node_nr_lru_pages (memcg, nid, -BIT (LRU_UNEVICTABLE )); +LRU_ALL_UNEVICTABLE );seq_printf (m," N%d=%lu" , nid, node_nr); }seq_putc (m,'\n' );Signature · 6 lines
1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe cgroups" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 6 lines
Michal Hocko SUSE Labs SUSE LINUX s.r.o. Lihovarska 1060/12 190 00 Praha 9 Czech Republic
Quoted 7 lines · Michal Hocko
Marking this patch as memcg is quite misleading. mm is more suitable.
Quoted 3 lines · Wanpeng Li
From: Wanpeng Li <[email protected]>
Since
LRU_ALL_EVICTABLEis useless, just remove it.
Quoted 8 lines
It's really strange but I do not see any usage of this except for it's introduction. So agreed to remove it.
Quoted 1 line
Add
LRU_ALL_UNEVICTABLEto mask unevictable pages.Does it really make sense to introduce just for two uses in a single function?
I don't think so.
I doubt LRU_ALL_UNEVICTABLE implies there are other UNEVICTABLE LRUS other than LRU_UNEVICTABLE.
For example, LRU_ALL_UNEVICTABLE means
if total_swap==0, UNEVICTABLE+ANON if total_swap!=0, UNEVICTABLE,
This will have its own meanings...but I don't see there are any users.
Thanks,
-Kame