Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[PATCH 2/6] memcg: cleanup useless LRU_ALL_EVICTABLE

1 view
Skip to first unread message

Wanpeng Li

unread,
Jun 23, 2012, 2:16:50 AM6/23/12
to linu...@kvack.org, Michal Hocko, Johannes Weiner, Balbir Singh, KAMEZAWA Hiroyuki, Andrew Morton, Mel Gorman, Minchan Kim, linux-...@vger.kernel.org, cgr...@vger.kernel.org, Gavin Shan, Wanpeng Li
From: Wanpeng Li <li...@linux.vnet.ibm.com>

Since LRU_ALL_EVICTABLE is useless, just remove it.
Add LRU_ALL_UNEVICTABLE to mask unevictable pages.

Signed-off-by: Wanpeng Li <liwp....@gmail.com>
---
include/linux/mmzone.h | 2 +-
mm/memcontrol.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index 68c569f..5873620 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -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 */
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 724bd02..ccda728 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -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');
--
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majo...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Wanpeng Li

unread,
Jun 25, 2012, 2:06:09 AM6/25/12
to Michal Hocko, Johannes Weiner, KAMEZAWA Hiroyuki, Balbir Singh, Andrew Morton, Eric Dumazet, Mike Frysinger, Arun Sharma, linux-...@vger.kernel.org, cgr...@vger.kernel.org, Wanpeng Li

Wanpeng Li

unread,
Jun 25, 2012, 4:43:49 AM6/25/12
to Michal Hocko, Johannes Weiner, KAMEZAWA Hiroyuki, Balbir Singh, Andrew Morton, Eric Dumazet, Mike Frysinger, Arun Sharma, linux-...@vger.kernel.org, cgr...@vger.kernel.org, Wanpeng Li

Michal Hocko

unread,
Jun 25, 2012, 5:33:39 AM6/25/12
to Wanpeng Li, Johannes Weiner, KAMEZAWA Hiroyuki, Balbir Singh, Andrew Morton, Eric Dumazet, Mike Frysinger, Arun Sharma, linux-...@vger.kernel.org, cgr...@vger.kernel.org
Marking this patch as memcg is quite misleading. mm is more suitable.

On Mon 25-06-12 16:43:32, Wanpeng Li wrote:
> From: Wanpeng Li <li...@linux.vnet.ibm.com>
>
> Since LRU_ALL_EVICTABLE is 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.

> Add LRU_ALL_UNEVICTABLE to mask unevictable pages.

Does it really make sense to introduce just for two uses in a single
function?
> To unsubscribe from this list: send the line "unsubscribe cgroups" in
> the body of a message to majo...@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html

--
Michal Hocko
SUSE Labs
SUSE LINUX s.r.o.
Lihovarska 1060/12
190 00 Praha 9
Czech Republic

Kamezawa Hiroyuki

unread,
Jun 25, 2012, 6:02:06 AM6/25/12
to Michal Hocko, Wanpeng Li, Johannes Weiner, Balbir Singh, Andrew Morton, Eric Dumazet, Mike Frysinger, Arun Sharma, linux-...@vger.kernel.org, cgr...@vger.kernel.org
(2012/06/25 18:33), Michal Hocko wrote:
> Marking this patch as memcg is quite misleading. mm is more suitable.
>
> On Mon 25-06-12 16:43:32, Wanpeng Li wrote:
>> From: Wanpeng Li <li...@linux.vnet.ibm.com>
>>
>> Since LRU_ALL_EVICTABLE is 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.
>
>> Add LRU_ALL_UNEVICTABLE to 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

Wanpeng Li

unread,
Jun 25, 2012, 7:15:49 AM6/25/12
to Michal Hocko, Johannes Weiner, KAMEZAWA Hiroyuki, Balbir Singh, Andrew Morton, linux-...@vger.kernel.org, cgr...@vger.kernel.org, Wanpeng Li
From: Wanpeng Li <li...@linux.vnet.ibm.com>

Since LRU_ALL_EVICTABLE is useless, just remove it.

Signed-off-by: Wanpeng Li <liwp....@gmail.com>
---
include/linux/mmzone.h | 1 -
1 file changed, 1 deletion(-)

diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index 68c569f..8b10c35 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -209,7 +209,6 @@ 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 ((1 << NR_LRU_LISTS) - 1)

/* Isolate clean file */
--
1.7.9.5

Kamezawa Hiroyuki

unread,
Jun 26, 2012, 1:27:35 AM6/26/12
to Wanpeng Li, Michal Hocko, Johannes Weiner, Balbir Singh, Andrew Morton, linux-...@vger.kernel.org, cgr...@vger.kernel.org
(2012/06/25 20:15), Wanpeng Li wrote:
> From: Wanpeng Li <li...@linux.vnet.ibm.com>
>
> Since LRU_ALL_EVICTABLE is useless, just remove it.
>
> Signed-off-by: Wanpeng Li <liwp....@gmail.com>

Thank you for your patience.

Acked-by: KAMEZAWA Hiroyuki <kamezaw...@jp.fujitsu.com>

hmm..but this may noe be related to memcg ;)


> ---
> include/linux/mmzone.h | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
> index 68c569f..8b10c35 100644
> --- a/include/linux/mmzone.h
> +++ b/include/linux/mmzone.h
> @@ -209,7 +209,6 @@ 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 ((1 << NR_LRU_LISTS) - 1)
>
> /* Isolate clean file */
>



--
0 new messages