memcg: fix unused variable warning
Subsystems (5)
PATCH 1/6 memcg: fix unused variable warning
From: "Kirill A. Shutemov" <[email protected]>
mm/memcontrol.c: In function ‘memcg_check_events’:mm/memcontrol.c:784:22: warning: unused variable ‘do_numainfo’ [-Wunused-variable]
--- mm/memcontrol.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-)
mm/memcontrol.c +4 -3
@@ -781,14 +781,15 @@ static void memcg_check_events(struct mem_cgroup *memcg, struct page *page)/* threshold event is triggered in finer grain than soft limit */ if (unlikely (mem_cgroup_event_ratelimit (memcg,MEM_CGROUP_TARGET_THRESH ))) { -bool do_softlimit, do_numainfo; +bool do_softlimit; - do_softlimit =mem_cgroup_event_ratelimit (memcg, -MEM_CGROUP_TARGET_SOFTLIMIT );#if MAX_NUMNODES >1 +bool do_numainfo; do_numainfo =mem_cgroup_event_ratelimit (memcg,MEM_CGROUP_TARGET_NUMAINFO );#endif + do_softlimit =mem_cgroup_event_ratelimit (memcg, +MEM_CGROUP_TARGET_SOFTLIMIT );preempt_enable ();mem_cgroup_threshold (memcg);
Signature · 1 line
1.7.7.3
PATCH 2/6 memcg: mark more functions/variables as static
From: "Kirill A. Shutemov" <[email protected]>
Based on sparse output.
--- mm/memcontrol.c | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-)
mm/memcontrol.c +6 -6
@@ -59,7 +59,7 @@struct cgroup_subsys mem_cgroup_subsys__read_mostly ;#define MEM_CGROUP_RECLAIM_RETRIES 5 -struct mem_cgroup *root_mem_cgroup__read_mostly ; +static struct mem_cgroup *root_mem_cgroup__read_mostly ;#ifdef CONFIG_CGROUP_MEM_RES_CTLR_SWAP /* Turned on only when memory cgroup is enabled && really_do_swap_account = 1 */
@@ -1573,7 +1573,7 @@ int mem_cgroup_select_victim_node(struct mem_cgroup *memcg)* unused nodes. But scan_nodes is lazily updated and may not cotain * enough new information. We need to do double check. */ -bool mem_cgroup_reclaimable (struct mem_cgroup *memcg,bool noswap) +static bool mem_cgroup_reclaimable (struct mem_cgroup *memcg,bool noswap) {int nid;
@@ -1608,7 +1608,7 @@ int mem_cgroup_select_victim_node(struct mem_cgroup *memcg)return 0 ; } -bool mem_cgroup_reclaimable (struct mem_cgroup *memcg,bool noswap) +static bool mem_cgroup_reclaimable (struct mem_cgroup *memcg,bool noswap) {return test_mem_cgroup_node_reclaimable (memcg,0 , noswap); }
@@ -1782,7 +1782,7 @@ static void memcg_oom_recover(struct mem_cgroup *memcg)/* * try to call OOM killer. returns false if we should exit memory-reclaim loop. */ -bool mem_cgroup_handle_oom (struct mem_cgroup *memcg,gfp_t mask) +static bool mem_cgroup_handle_oom (struct mem_cgroup *memcg,gfp_t mask) {struct oom_wait_info owait;bool locked, need_to_kill;
@@ -3765,7 +3765,7 @@ try_to_free: goto move_account; } -int mem_cgroup_force_empty_write (struct cgroup *cont,unsigned int event) +static int mem_cgroup_force_empty_write (struct cgroup *cont,unsigned int event) {return mem_cgroup_force_empty (mem_cgroup_from_cont (cont), true); }
@@ -4044,7 +4044,7 @@ struct mcs_total_stat {s64 stat[NR_MCS_STAT ]; }; -struct { +static struct {char *local_name;char *total_name; } memcg_stat_strings[NR_MCS_STAT ] = {
Signature · 8 lines
1.7.7.3 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Re: [PATCH 2/6] memcg: mark more functions/variables as static
Quoted 5 lines · On Sat, 24 Dec 2011 05:00:15 +0200 "Kirill A. Shutemov"…
From: "Kirill A. Shutemov" <[email protected]>
Based on sparse output.
Signed-off-by Kirill A. Shutemov <[email protected]>
A message that is not in the archive (sent off-list or not yet received): 1324695619-5537-2-git-send-email-kirill-oKw7cIdHH8eLwutG50LtGA@public.gmane.org
KAMEZAWA Hiroyuki
Acked-byRe: [PATCH 2/6] memcg: mark more functions/variables as static
Quoted 5 lines · On Sat, 24 Dec 2011 05:00:15 +0200 "Kirill A. Shutemov"…
From: "Kirill A. Shutemov" <[email protected]>
Based on sparse output.
Signed-off-by Kirill A. Shutemov <[email protected]>
Michal Hocko
Acked-byRe: [PATCH 2/6] memcg: mark more functions/variables as static
In reply to a message not in the archiveQuoted 5 lines · Kirill A. Shutemov
From: "Kirill A. Shutemov" <[email protected]>
Based on sparse output.
Signed-off-by Kirill A. Shutemov <[email protected]>
Looks good.
Thanks
Quoted 65 lines
--- mm/memcontrol.c | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-)mm/memcontrol.c +6
-6@@ -59,7 +59,7 @@struct cgroup_subsys mem_cgroup_subsys__read_mostly ;#define MEM_CGROUP_RECLAIM_RETRIES 5 -struct mem_cgroup *root_mem_cgroup__read_mostly ; +static struct mem_cgroup *root_mem_cgroup__read_mostly ;#ifdef CONFIG_CGROUP_MEM_RES_CTLR_SWAP /* Turned on only when memory cgroup is enabled && really_do_swap_account = 1 */ @@ -1573,7 +1573,7 @@ int mem_cgroup_select_victim_node(struct mem_cgroup *memcg)* unused nodes. But scan_nodes is lazily updated and may not cotain * enough new information. We need to do double check. */ -bool mem_cgroup_reclaimable (struct mem_cgroup *memcg,bool noswap) +static bool mem_cgroup_reclaimable (struct mem_cgroup *memcg,bool noswap) {int nid;@@ -1608,7 +1608,7 @@ int mem_cgroup_select_victim_node(struct mem_cgroup *memcg)return 0 ; } -bool mem_cgroup_reclaimable (struct mem_cgroup *memcg,bool noswap) +static bool mem_cgroup_reclaimable (struct mem_cgroup *memcg,bool noswap) {return test_mem_cgroup_node_reclaimable (memcg,0 , noswap); }@@ -1782,7 +1782,7 @@ static void memcg_oom_recover(struct mem_cgroup *memcg)/* * try to call OOM killer. returns false if we should exit memory-reclaim loop. */ -bool mem_cgroup_handle_oom (struct mem_cgroup *memcg,gfp_t mask) +static bool mem_cgroup_handle_oom (struct mem_cgroup *memcg,gfp_t mask) {struct oom_wait_info owait;bool locked, need_to_kill;@@ -3765,7 +3765,7 @@ try_to_free: goto move_account; } -int mem_cgroup_force_empty_write (struct cgroup *cont,unsigned int event) +static int mem_cgroup_force_empty_write (struct cgroup *cont,unsigned int event) {return mem_cgroup_force_empty (mem_cgroup_from_cont (cont), true); }@@ -4044,7 +4044,7 @@ struct mcs_total_stat {s64 stat[NR_MCS_STAT ]; }; -struct { +static struct {char *local_name;char *total_name; } memcg_stat_strings[NR_MCS_STAT ] = {Signature · 1 line
1.7.7.3
Signature · 6 lines
Michal Hocko SUSE Labs SUSE LINUX s.r.o. Lihovarska 1060/12 190 00 Praha 9 Czech Republic
Re: [PATCH 2/6] memcg: mark more functions/variables as static
In reply to Kirill A. ShutemovQuoted 5 lines · Kirill A. Shutemov
From: "Kirill A. Shutemov" <[email protected]>
Based on sparse output.
Signed-off-by Kirill A. Shutemov <[email protected]>
Looks good.
Thanks
Quoted 65 lines
--- mm/memcontrol.c | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-)mm/memcontrol.c +6
-6@@ -59,7 +59,7 @@struct cgroup_subsys mem_cgroup_subsys__read_mostly ;#define MEM_CGROUP_RECLAIM_RETRIES 5 -struct mem_cgroup *root_mem_cgroup__read_mostly ; +static struct mem_cgroup *root_mem_cgroup__read_mostly ;#ifdef CONFIG_CGROUP_MEM_RES_CTLR_SWAP /* Turned on only when memory cgroup is enabled && really_do_swap_account = 1 */ @@ -1573,7 +1573,7 @@ int mem_cgroup_select_victim_node(struct mem_cgroup *memcg)* unused nodes. But scan_nodes is lazily updated and may not cotain * enough new information. We need to do double check. */ -bool mem_cgroup_reclaimable (struct mem_cgroup *memcg,bool noswap) +static bool mem_cgroup_reclaimable (struct mem_cgroup *memcg,bool noswap) {int nid;@@ -1608,7 +1608,7 @@ int mem_cgroup_select_victim_node(struct mem_cgroup *memcg)return 0 ; } -bool mem_cgroup_reclaimable (struct mem_cgroup *memcg,bool noswap) +static bool mem_cgroup_reclaimable (struct mem_cgroup *memcg,bool noswap) {return test_mem_cgroup_node_reclaimable (memcg,0 , noswap); }@@ -1782,7 +1782,7 @@ static void memcg_oom_recover(struct mem_cgroup *memcg)/* * try to call OOM killer. returns false if we should exit memory-reclaim loop. */ -bool mem_cgroup_handle_oom (struct mem_cgroup *memcg,gfp_t mask) +static bool mem_cgroup_handle_oom (struct mem_cgroup *memcg,gfp_t mask) {struct oom_wait_info owait;bool locked, need_to_kill;@@ -3765,7 +3765,7 @@ try_to_free: goto move_account; } -int mem_cgroup_force_empty_write (struct cgroup *cont,unsigned int event) +static int mem_cgroup_force_empty_write (struct cgroup *cont,unsigned int event) {return mem_cgroup_force_empty (mem_cgroup_from_cont (cont), true); }@@ -4044,7 +4044,7 @@ struct mcs_total_stat {s64 stat[NR_MCS_STAT ]; }; -struct { +static struct {char *local_name;char *total_name; } memcg_stat_strings[NR_MCS_STAT ] = {Signature · 1 line
1.7.7.3
Signature · 6 lines
Michal Hocko SUSE Labs SUSE LINUX s.r.o. Lihovarska 1060/12 190 00 Praha 9 Czech Republic
A message that is not in the archive (sent off-list or not yet received): 1324695619-5537-1-git-send-email-kirill-oKw7cIdHH8eLwutG50LtGA@public.gmane.org
PATCH 2/6 memcg: mark more functions/variables as static
From: "Kirill A. Shutemov" <[email protected]>
Based on sparse output.
--- mm/memcontrol.c | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-)
mm/memcontrol.c +6 -6
@@ -59,7 +59,7 @@struct cgroup_subsys mem_cgroup_subsys__read_mostly ;#define MEM_CGROUP_RECLAIM_RETRIES 5 -struct mem_cgroup *root_mem_cgroup__read_mostly ; +static struct mem_cgroup *root_mem_cgroup__read_mostly ;#ifdef CONFIG_CGROUP_MEM_RES_CTLR_SWAP /* Turned on only when memory cgroup is enabled && really_do_swap_account = 1 */
@@ -1573,7 +1573,7 @@ int mem_cgroup_select_victim_node(struct mem_cgroup *memcg)* unused nodes. But scan_nodes is lazily updated and may not cotain * enough new information. We need to do double check. */ -bool mem_cgroup_reclaimable (struct mem_cgroup *memcg,bool noswap) +static bool mem_cgroup_reclaimable (struct mem_cgroup *memcg,bool noswap) {int nid;
@@ -1608,7 +1608,7 @@ int mem_cgroup_select_victim_node(struct mem_cgroup *memcg)return 0 ; } -bool mem_cgroup_reclaimable (struct mem_cgroup *memcg,bool noswap) +static bool mem_cgroup_reclaimable (struct mem_cgroup *memcg,bool noswap) {return test_mem_cgroup_node_reclaimable (memcg,0 , noswap); }
@@ -1782,7 +1782,7 @@ static void memcg_oom_recover(struct mem_cgroup *memcg)/* * try to call OOM killer. returns false if we should exit memory-reclaim loop. */ -bool mem_cgroup_handle_oom (struct mem_cgroup *memcg,gfp_t mask) +static bool mem_cgroup_handle_oom (struct mem_cgroup *memcg,gfp_t mask) {struct oom_wait_info owait;bool locked, need_to_kill;
@@ -3765,7 +3765,7 @@ try_to_free: goto move_account; } -int mem_cgroup_force_empty_write (struct cgroup *cont,unsigned int event) +static int mem_cgroup_force_empty_write (struct cgroup *cont,unsigned int event) {return mem_cgroup_force_empty (mem_cgroup_from_cont (cont), true); }
@@ -4044,7 +4044,7 @@ struct mcs_total_stat {s64 stat[NR_MCS_STAT ]; }; -struct { +static struct {char *local_name;char *total_name; } memcg_stat_strings[NR_MCS_STAT ] = {
Signature · 1 line
1.7.7.3
PATCH 3/6 memcg: remove unused variable
In reply to a message not in the archiveFrom: "Kirill A. Shutemov" <[email protected]>
mm/memcontrol.c: In function ‘mc_handle_file_pte’:mm/memcontrol.c:5206:16: warning: variable ‘inode’ set but not used [-Wunused-but-set-variable]
--- mm/memcontrol.c | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-)
mm/memcontrol.c +0 -2
@@ -5203,7 +5203,6 @@ static struct page *mc_handle_file_pte(struct vm_area_struct *vma, unsigned long addr, pte_t ptent, swp_entry_t *entry) { struct page *page = NULL; -struct inode *inode;struct address_space *mapping;pgoff_t pgoff;
@@ -5212,7 +5211,6 @@ static struct page *mc_handle_file_pte(struct vm_area_struct *vma,if (!move_file ())return NULL ; - inode = vma->vm_file->f_path.dentry->d_inode; mapping = vma->vm_file->f_mapping;if (pte_none (ptent)) pgoff =linear_page_index (vma, addr);
Signature · 6 lines
1.7.7.3 _______________________________________________ Containers mailing list [email protected] https://lists.linuxfoundation.org/mailman/listinfo/containers
PATCH 4/6 memcg: mark stat field of mem_cgroup struct as __percpu
In reply to a message not in the archiveFrom: "Kirill A. Shutemov" <[email protected]>
It fixes a lot of sparse warnings.
--- mm/memcontrol.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
mm/memcontrol.c +1 -1
@@ -291,7 +291,7 @@ struct mem_cgroup {/* * percpu counter. */ -struct mem_cgroup_stat_cpu *stat; +struct mem_cgroup_stat_cpu __percpu *stat;/* * used when a cpu is offlined or other synchronizations * See mem_cgroup_read_stat().
Signature · 1 line
1.7.7.3
PATCH 5/6 memcg: fix broken boolen expression
In reply to a message not in the archiveFrom: "Kirill A. Shutemov" <[email protected]>
action != CPU_DEAD || action != CPU_DEAD_FROZEN is always true.
--- mm/memcontrol.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
mm/memcontrol.c +1 -1
@@ -2100,7 +2100,7 @@ static int __cpuinit memcg_cpu_hotplug_callback(struct notifier_block *nb,return NOTIFY_OK ; } -if ((action !=CPU_DEAD ) || action !=CPU_DEAD_FROZEN ) +if (action !=CPU_DEAD && action !=CPU_DEAD_FROZEN )return NOTIFY_OK ;for_each_mem_cgroup (iter)
Signature · 1 line
1.7.7.3
PATCH 6/6 memcg: drop redundant brackets
In reply to a message not in the archiveFrom: "Kirill A. Shutemov" <[email protected]>
--- mm/memcontrol.c | 28 ++++++++++++++-------------- 1 files changed, 14 insertions(+), 14 deletions(-)
mm/memcontrol.c +14 -14
@@ -73,7 +73,7 @@ static int really_do_swap_account __initdata = 0;#endif #else -#define do_swap_account (0) +#define do_swap_account 0#endif
@@ -113,9 +113,9 @@ enum mem_cgroup_events_target { MEM_CGROUP_TARGET_NUMAINFO, MEM_CGROUP_NTARGETS, }; -#define THRESHOLDS_EVENTS_TARGET (128) -#define SOFTLIMIT_EVENTS_TARGET (1024) -#define NUMAINFO_EVENTS_TARGET (1024) +#define THRESHOLDS_EVENTS_TARGET 128 +#define SOFTLIMIT_EVENTS_TARGET 1024 +#define NUMAINFO_EVENTS_TARGET 1024struct mem_cgroup_stat_cpu {long count[MEM_CGROUP_STAT_NSTATS ];
@@ -148,7 +148,7 @@ struct mem_cgroup_per_zone {/* use container_of */ };/* Macro for accessing counter */ -#define MEM_CGROUP_ZSTAT (mz, idx) ((mz)->count[(idx)]) +#define MEM_CGROUP_ZSTAT (mz, idx) ((mz)->count[idx])struct mem_cgroup_per_node {struct mem_cgroup_per_zone zoneinfo[MAX_NR_ZONES ];
@@ -346,8 +346,8 @@ static bool move_file(void)* Maximum loops in mem_cgroup_hierarchical_reclaim(), used for soft * limit reclaim to prevent infinite loops, if they ever occur. */ -#define MEM_CGROUP_MAX_RECLAIM_LOOPS (100) -#define MEM_CGROUP_MAX_SOFT_LIMIT_RECLAIM_LOOPS (2) +#define MEM_CGROUP_MAX_RECLAIM_LOOPS 100 +#define MEM_CGROUP_MAX_SOFT_LIMIT_RECLAIM_LOOPS 2enum charge_type {MEM_CGROUP_CHARGE_TYPE_CACHE =0 ,
@@ -368,11 +368,11 @@ enum mem_type { _KMEM, }; -#define MEMFILE_PRIVATE (x, val) (((x) << 16) | (val)) -#define MEMFILE_TYPE (val) (((val) >> 16) & 0xffff) +#define MEMFILE_PRIVATE (x, val) ((x) << 16 | (val)) +#define MEMFILE_TYPE (val) ((val) >> 16 & 0xffff)#define MEMFILE_ATTR (val) ((val) & 0xffff)/* Used for OOM nofiier */ -#define OOM_CONTROL (0) +#define OOM_CONTROL 0/* * Reclaim flags for mem_cgroup_hierarchical_reclaim
@@ -1913,7 +1913,7 @@ struct memcg_stock_pcp {unsigned int nr_pages;struct work_struct work;unsigned long flags; -#define FLUSHING_CACHED_CHARGE (0) +#define FLUSHING_CACHED_CHARGE 0 }; static DEFINE_PER_CPU(struct memcg_stock_pcp, memcg_stock);static DEFINE_MUTEX (percpu_charge_mutex);
@@ -2094,7 +2094,7 @@ static int __cpuinit memcg_cpu_hotplug_callback(struct notifier_block *nb,struct memcg_stock_pcp *stock;struct mem_cgroup *iter; -if ((action ==CPU_ONLINE )) { +if (action ==CPU_ONLINE ) {for_each_mem_cgroup (iter)synchronize_mem_cgroup_on_move (iter, cpu);return NOTIFY_OK ;
@@ -2458,8 +2458,8 @@ static void __mem_cgroup_commit_charge(struct mem_cgroup *memcg,#ifdef CONFIG_TRANSPARENT_HUGEPAGE -#define PCGF_NOCOPY_AT_SPLIT ((1 << PCG_LOCK) | (1 << PCG_MOVE_LOCK) |\ - (1 << PCG_MIGRATION)) +#define PCGF_NOCOPY_AT_SPLIT (1 << PCG_LOCK | 1 << PCG_MOVE_LOCK |\ + 1 << PCG_MIGRATION)/* * Because tail pages are not marked as "used", set it. We're under * zone->lru_lock, 'splitting on pmd' and compound_lock.
Signature · 1 line
1.7.7.3
Quoted 6 lines · On Sat, 24 Dec 2011 05:00:14 +0200 "Kirill A. Shutemov"…
From: "Kirill A. Shutemov" <[email protected]>
mm/memcontrol.c: In function ‘memcg_check_events’:mm/memcontrol.c:784:22: warning: unused variable ‘do_numainfo’ [-Wunused-variable]Signed-off-by Kirill A. Shutemov <[email protected]>
Hmm ? Doesn't this fix cause a new Warning ?
mm/memcontrol.c: In function ?memcg_check_events?:mm/memcontrol.c:789: warning: ISO C90 forbids mixed declarations and code
Thanks,
-Kame
Quoted 30 lines
--- mm/memcontrol.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-)mm/memcontrol.c +4
-3@@ -781,14 +781,15 @@ static void memcg_check_events(struct mem_cgroup *memcg, struct page *page)/* threshold event is triggered in finer grain than soft limit */ if (unlikely (mem_cgroup_event_ratelimit (memcg,MEM_CGROUP_TARGET_THRESH ))) { -bool do_softlimit, do_numainfo; +bool do_softlimit; - do_softlimit =mem_cgroup_event_ratelimit (memcg, -MEM_CGROUP_TARGET_SOFTLIMIT );#if MAX_NUMNODES >1 +bool do_numainfo; do_numainfo =mem_cgroup_event_ratelimit (memcg,MEM_CGROUP_TARGET_NUMAINFO );#endif + do_softlimit =mem_cgroup_event_ratelimit (memcg, +MEM_CGROUP_TARGET_SOFTLIMIT );preempt_enable ();mem_cgroup_threshold (memcg);Signature · 1 line
1.7.7.3
PATCH 1/1 Makefiles: Disable unused-variable warning (was: Re: [PATCH 1/6] memcg: fix unused variable warning)
In reply to a message not in the archiveQuoted 20 lines · Kirill A. Shutemov
From: "Kirill A. Shutemov" <[email protected]>
mm/memcontrol.c: In function ‘memcg_check_events’:mm/memcontrol.c:784:22: warning: unused variable ‘do_numainfo’ [-Wunused-variable]Signed-off-by Kirill A. Shutemov <[email protected]>--- mm/memcontrol.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-)mm/memcontrol.c +1
-1@@ -781,14 +781,15 @@ static void memcg_check_events(struct mem_cgroup *memcg, struct page *page)/* threshold event is triggered in finer grain than soft limit */ if (unlikely (mem_cgroup_event_ratelimit (memcg,MEM_CGROUP_TARGET_THRESH ))) { -bool do_softlimit, do_numainfo; +bool do_softlimit;
mm/memcontrol.c static void memcg_check_events(struct mem_cgroup *memcg, struct page *page) · line 792
Quoted 10 lines
mm/memcontrol.c +3
-2- do_softlimit =mem_cgroup_event_ratelimit (memcg, -MEM_CGROUP_TARGET_SOFTLIMIT );#if MAX_NUMNODES >1 +bool do_numainfo; do_numainfo =mem_cgroup_event_ratelimit (memcg,MEM_CGROUP_TARGET_NUMAINFO );#endif + do_softlimit =mem_cgroup_event_ratelimit (memcg, +MEM_CGROUP_TARGET_SOFTLIMIT );
I don't like this very much. Maybe we should get rid of both do_* and do it with flags? But maybe it is not worth the additional code at all...
Anyway, I am wondering why unused-but-set-variable is disabled while unused-variable is enabled. Shouldn't we just disable it as well rather than workaround this in the code? The warning is just pure noise in this case.
What about something like:
---
From e1136891fe86eacf9212b2144f80ff6b75b10194 Mon Sep 17 00:00:00 2001
From: Michal Hocko <[email protected]>
Date: Tue, 27 Dec 2011 14:53:06 +0100
Subject: [PATCH] Makefiles: Disable unused-variable warning
We are already disabling unused-but-set-variable and Wunused-variable produces some noise as well.
--- Makefile | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
Makefile +1 -0
@@ -578,6 +578,7 @@ endif # This warning generated too much noise in a regular build. # Use make W=1 to enable this warning (see scripts/Makefile.build) KBUILD_CFLAGS += $(call cc-disable-warning, unused-but-set-variable) +KBUILD_CFLAGS += $(call cc-disable-warning, unused-variable) ifdef CONFIG_FRAME_POINTER KBUILD_CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls
Signature · 15 lines
1.7.7.3 -- Michal Hocko SUSE Labs SUSE LINUX s.r.o. Lihovarska 1060/12 190 00 Praha 9 Czech Republic _______________________________________________ Containers mailing list [email protected] https://lists.linuxfoundation.org/mailman/listinfo/containers
PATCH 3/6 memcg: remove unused variable
In reply to Kirill A. ShutemovFrom: "Kirill A. Shutemov" <[email protected]>
mm/memcontrol.c: In function ‘mc_handle_file_pte’:mm/memcontrol.c:5206:16: warning: variable ‘inode’ set but not used [-Wunused-but-set-variable]
--- mm/memcontrol.c | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-)
mm/memcontrol.c +0 -2
@@ -5203,7 +5203,6 @@ static struct page *mc_handle_file_pte(struct vm_area_struct *vma, unsigned long addr, pte_t ptent, swp_entry_t *entry) { struct page *page = NULL; -struct inode *inode;struct address_space *mapping;pgoff_t pgoff;
@@ -5212,7 +5211,6 @@ static struct page *mc_handle_file_pte(struct vm_area_struct *vma,if (!move_file ())return NULL ; - inode = vma->vm_file->f_path.dentry->d_inode; mapping = vma->vm_file->f_mapping;if (pte_none (ptent)) pgoff =linear_page_index (vma, addr);
Signature · 8 lines
1.7.7.3 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Re: [PATCH 3/6] memcg: remove unused variable
Quoted 6 lines · On Sat, 24 Dec 2011 05:00:16 +0200 "Kirill A. Shutemov" <[email protected]>…
From: "Kirill A. Shutemov" <[email protected]>
mm/memcontrol.c: In function ‘mc_handle_file_pte’:mm/memcontrol.c:5206:16: warning: variable ‘inode’ set but not used [-Wunused-but-set-variable]Signed-off-by Kirill A. Shutemov <[email protected]>
nice.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
A message that is not in the archive (sent off-list or not yet received): 1324695619-5537-3-git-send-email-kirill-oKw7cIdHH8eLwutG50LtGA@public.gmane.org
KAMEZAWA Hiroyuki
Acked-byRe: [PATCH 3/6] memcg: remove unused variable
Quoted 6 lines · On Sat, 24 Dec 2011 05:00:16 +0200 "Kirill A. Shutemov"…
From: "Kirill A. Shutemov" <[email protected]>
mm/memcontrol.c: In function ‘mc_handle_file_pte’:mm/memcontrol.c:5206:16: warning: variable ‘inode’ set but not used [-Wunused-but-set-variable]Signed-off-by Kirill A. Shutemov <[email protected]>
nice.
Michal Hocko
Acked-byRe: [PATCH 3/6] memcg: remove unused variable
In reply to a message not in the archiveQuoted 6 lines · Kirill A. Shutemov
From: "Kirill A. Shutemov" <[email protected]>
mm/memcontrol.c: In function ‘mc_handle_file_pte’:mm/memcontrol.c:5206:16: warning: variable ‘inode’ set but not used [-Wunused-but-set-variable]Signed-off-by Kirill A. Shutemov <[email protected]>
Looks good.
Thanks!
Quoted 27 lines
--- mm/memcontrol.c | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-)mm/memcontrol.c +0
-2@@ -5203,7 +5203,6 @@ static struct page *mc_handle_file_pte(struct vm_area_struct *vma, unsigned long addr, pte_t ptent, swp_entry_t *entry) { struct page *page = NULL; -struct inode *inode;struct address_space *mapping;pgoff_t pgoff;@@ -5212,7 +5211,6 @@ static struct page *mc_handle_file_pte(struct vm_area_struct *vma,if (!move_file ())return NULL ; - inode = vma->vm_file->f_path.dentry->d_inode; mapping = vma->vm_file->f_mapping;if (pte_none (ptent)) pgoff =linear_page_index (vma, addr);Signature · 1 line
1.7.7.3
Signature · 10 lines
Michal Hocko SUSE Labs SUSE LINUX s.r.o. Lihovarska 1060/12 190 00 Praha 9 Czech Republic _______________________________________________ Containers mailing list [email protected] https://lists.linuxfoundation.org/mailman/listinfo/containers
Re: [PATCH 3/6] memcg: remove unused variable
In reply to Kirill A. ShutemovQuoted 6 lines · Kirill A. Shutemov
From: "Kirill A. Shutemov" <[email protected]>
mm/memcontrol.c: In function ‘mc_handle_file_pte’:mm/memcontrol.c:5206:16: warning: variable ‘inode’ set but not used [-Wunused-but-set-variable]Signed-off-by Kirill A. Shutemov <[email protected]>
Looks good.
Thanks!
Quoted 27 lines
--- mm/memcontrol.c | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-)mm/memcontrol.c +0
-2@@ -5203,7 +5203,6 @@ static struct page *mc_handle_file_pte(struct vm_area_struct *vma, unsigned long addr, pte_t ptent, swp_entry_t *entry) { struct page *page = NULL; -struct inode *inode;struct address_space *mapping;pgoff_t pgoff;@@ -5212,7 +5211,6 @@ static struct page *mc_handle_file_pte(struct vm_area_struct *vma,if (!move_file ())return NULL ; - inode = vma->vm_file->f_path.dentry->d_inode; mapping = vma->vm_file->f_mapping;if (pte_none (ptent)) pgoff =linear_page_index (vma, addr);Signature · 1 line
1.7.7.3
Signature · 6 lines
Michal Hocko SUSE Labs SUSE LINUX s.r.o. Lihovarska 1060/12 190 00 Praha 9 Czech Republic
PATCH 4/6 memcg: mark stat field of mem_cgroup struct as __percpu
In reply to Kirill A. ShutemovFrom: "Kirill A. Shutemov" <[email protected]>
It fixes a lot of sparse warnings.
--- mm/memcontrol.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
mm/memcontrol.c +1 -1
@@ -291,7 +291,7 @@ struct mem_cgroup {/* * percpu counter. */ -struct mem_cgroup_stat_cpu *stat; +struct mem_cgroup_stat_cpu __percpu *stat;/* * used when a cpu is offlined or other synchronizations * See mem_cgroup_read_stat().
Signature · 8 lines
1.7.7.3 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Re: [PATCH 4/6] memcg: mark stat field of mem_cgroup struct as __percpu
Quoted 5 lines · On Sat, 24 Dec 2011 05:00:17 +0200 "Kirill A. Shutemov"…
From: "Kirill A. Shutemov" <[email protected]>
It fixes a lot of sparse warnings.
Signed-off-by Kirill A. Shutemov <[email protected]>
A message that is not in the archive (sent off-list or not yet received): 1324695619-5537-4-git-send-email-kirill-oKw7cIdHH8eLwutG50LtGA@public.gmane.org
KAMEZAWA Hiroyuki
Acked-byRe: [PATCH 4/6] memcg: mark stat field of mem_cgroup struct as __percpu
Quoted 5 lines · On Sat, 24 Dec 2011 05:00:17 +0200 "Kirill A. Shutemov"…
From: "Kirill A. Shutemov" <[email protected]>
It fixes a lot of sparse warnings.
Signed-off-by Kirill A. Shutemov <[email protected]>
Michal Hocko
Acked-byRe: [PATCH 4/6] memcg: mark stat field of mem_cgroup struct as __percpu
In reply to a message not in the archiveQuoted 5 lines · Kirill A. Shutemov
From: "Kirill A. Shutemov" <[email protected]>
It fixes a lot of sparse warnings.
Signed-off-by Kirill A. Shutemov <[email protected]>
Looks good.
Thanks
Quoted 25 lines
--- mm/memcontrol.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)mm/memcontrol.c +1
-1@@ -291,7 +291,7 @@ struct mem_cgroup {/* * percpu counter. */ -struct mem_cgroup_stat_cpu *stat; +struct mem_cgroup_stat_cpu __percpu *stat;/* * used when a cpu is offlined or other synchronizations * See mem_cgroup_read_stat(). Signature · 7 lines
1.7.7.3 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Signature · 6 lines
Michal Hocko SUSE Labs SUSE LINUX s.r.o. Lihovarska 1060/12 190 00 Praha 9 Czech Republic
Re: [PATCH 4/6] memcg: mark stat field of mem_cgroup struct as __percpu
In reply to Kirill A. ShutemovQuoted 5 lines · Kirill A. Shutemov
From: "Kirill A. Shutemov" <[email protected]>
It fixes a lot of sparse warnings.
Signed-off-by Kirill A. Shutemov <[email protected]>
Looks good.
Thanks
Quoted 25 lines
--- mm/memcontrol.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)mm/memcontrol.c +1
-1@@ -291,7 +291,7 @@ struct mem_cgroup {/* * percpu counter. */ -struct mem_cgroup_stat_cpu *stat; +struct mem_cgroup_stat_cpu __percpu *stat;/* * used when a cpu is offlined or other synchronizations * See mem_cgroup_read_stat(). Signature · 7 lines
1.7.7.3 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Signature · 6 lines
Michal Hocko SUSE Labs SUSE LINUX s.r.o. Lihovarska 1060/12 190 00 Praha 9 Czech Republic
PATCH 5/6 memcg: fix broken boolen expression
In reply to Kirill A. ShutemovFrom: "Kirill A. Shutemov" <[email protected]>
action != CPU_DEAD || action != CPU_DEAD_FROZEN is always true.
--- mm/memcontrol.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
mm/memcontrol.c +1 -1
@@ -2100,7 +2100,7 @@ static int __cpuinit memcg_cpu_hotplug_callback(struct notifier_block *nb,return NOTIFY_OK ; } -if ((action !=CPU_DEAD ) || action !=CPU_DEAD_FROZEN ) +if (action !=CPU_DEAD && action !=CPU_DEAD_FROZEN )return NOTIFY_OK ;for_each_mem_cgroup (iter)
Signature · 8 lines
1.7.7.3 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Re: [PATCH 5/6] memcg: fix broken boolen expression
Quoted 5 lines · On Sat, 24 Dec 2011 05:00:18 +0200 "Kirill A. Shutemov"…
From: "Kirill A. Shutemov" <[email protected]>
action !=
CPU_DEAD|| action !=CPU_DEAD_FROZENis always true.Signed-off-by Kirill A. Shutemov <[email protected]>
maybe this should go stable..
Quoted 24 lines
--- mm/memcontrol.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)mm/memcontrol.c +1
-1@@ -2100,7 +2100,7 @@ static int __cpuinit memcg_cpu_hotplug_callback(struct notifier_block *nb,return NOTIFY_OK ; } -if ((action !=CPU_DEAD ) || action !=CPU_DEAD_FROZEN ) +if (action !=CPU_DEAD && action !=CPU_DEAD_FROZEN )return NOTIFY_OK ;for_each_mem_cgroup (iter)Signature · 6 lines
1.7.7.3 -- 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
Re: [PATCH 5/6] memcg: fix broken boolen expression
Quoted 10 lines · KAMEZAWA Hiroyuki
Quoted 5 lines · On Sat, 24 Dec 2011 05:00:18 +0200 "Kirill A. Shutemov"…
From: "Kirill A. Shutemov" <[email protected]>
action !=
CPU_DEAD|| action !=CPU_DEAD_FROZENis always true.Signed-off-by Kirill A. Shutemov <[email protected]>maybe this should go stable..
CC stable@
Quoted 29 lines
Quoted 24 lines
--- mm/memcontrol.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)mm/memcontrol.c +1
-1@@ -2100,7 +2100,7 @@ static int __cpuinit memcg_cpu_hotplug_callback(struct notifier_block *nb,return NOTIFY_OK ; } -if ((action !=CPU_DEAD ) || action !=CPU_DEAD_FROZEN ) +if (action !=CPU_DEAD && action !=CPU_DEAD_FROZEN )return NOTIFY_OK ;for_each_mem_cgroup (iter)Signature · 6 lines
1.7.7.3 -- 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 · 1 line
Kirill A. Shutemov
Re: [PATCH 5/6] memcg: fix broken boolen expression
Quoted 6 lines · Kirill A. Shutemov
Quoted 5 lines · KAMEZAWA Hiroyuki
Quoted 2 lines · On Sat, 24 Dec 2011 05:00:18 +0200 "Kirill A. Shutemov"…
From: "Kirill A. Shutemov" <[email protected]>
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
action !=
CPU_DEAD|| action !=CPU_DEAD_FROZENis always true.Signed-off-by Kirill A. Shutemov <[email protected]>maybe this should go stable..
CC stable@
<formletter>
This is not the correct way to submit patches for inclusion in the stable kernel tree. Please read Documentation/stable_kernel_rules.txt for how to do this properly.
</formletter>
A message that is not in the archive (sent off-list or not yet received): 1324695619-5537-5-git-send-email-kirill-oKw7cIdHH8eLwutG50LtGA@public.gmane.org
KAMEZAWA Hiroyuki
Acked-byRe: [PATCH 5/6] memcg: fix broken boolen expression
Quoted 5 lines · On Sat, 24 Dec 2011 05:00:18 +0200 "Kirill A. Shutemov"…
From: "Kirill A. Shutemov" <[email protected]>
action !=
CPU_DEAD|| action !=CPU_DEAD_FROZENis always true.Signed-off-by Kirill A. Shutemov <[email protected]>
maybe this should go stable..
Quoted 24 lines
--- mm/memcontrol.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)mm/memcontrol.c +1
-1@@ -2100,7 +2100,7 @@ static int __cpuinit memcg_cpu_hotplug_callback(struct notifier_block *nb,return NOTIFY_OK ; } -if ((action !=CPU_DEAD ) || action !=CPU_DEAD_FROZEN ) +if (action !=CPU_DEAD && action !=CPU_DEAD_FROZEN )return NOTIFY_OK ;for_each_mem_cgroup (iter)Signature · 6 lines
1.7.7.3 -- 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
Re: [PATCH 5/6] memcg: fix broken boolen expression
In reply to Kirill A. ShutemovQuoted 5 lines · Kirill A. Shutemov
From: "Kirill A. Shutemov" <[email protected]>
action !=
CPU_DEAD|| action !=CPU_DEAD_FROZENis always true.Signed-off-by Kirill A. Shutemov <[email protected]>
Thanks!
Quoted 20 lines
--- mm/memcontrol.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)mm/memcontrol.c +1
-1@@ -2100,7 +2100,7 @@ static int __cpuinit memcg_cpu_hotplug_callback(struct notifier_block *nb,return NOTIFY_OK ; } -if ((action !=CPU_DEAD ) || action !=CPU_DEAD_FROZEN ) +if (action !=CPU_DEAD && action !=CPU_DEAD_FROZEN )return NOTIFY_OK ;for_each_mem_cgroup (iter)Signature · 1 line
1.7.7.3
Signature · 6 lines
Michal Hocko SUSE Labs SUSE LINUX s.r.o. Lihovarska 1060/12 190 00 Praha 9 Czech Republic
Andrew Morton
maintainerRe: [PATCH 5/6] memcg: fix broken boolen expression
In reply to Kirill A. ShutemovQuoted 14 lines · On Sat, 24 Dec 2011 05:00:18 +0200 "Kirill A. Shutemov"…
From: "Kirill A. Shutemov" <[email protected]>
action !=
CPU_DEAD|| action !=CPU_DEAD_FROZENis always true.Signed-off-by Kirill A. Shutemov <[email protected]>--- mm/memcontrol.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)mm/memcontrol.c +0
-0
mm/memcontrol.c static int __cpuinit memcg_cpu_hotplug_callback(struct notifier_block *nb, · line 2106
Quoted 8 lines
mm/memcontrol.c +1
-1@@ -2100,7 +2100,7 @@ static int __cpuinit memcg_cpu_hotplug_callback(struct notifier_block *nb,return NOTIFY_OK ; } -if ((action !=CPU_DEAD ) || action !=CPU_DEAD_FROZEN ) +if (action !=CPU_DEAD && action !=CPU_DEAD_FROZEN )return NOTIFY_OK ;for_each_mem_cgroup (iter)
This spent too long in the backlog, sorry.
I don't want to merge this patch into either mainline or -stable until I find out what it does!
afacit the patch will newly cause the kernel to drain various resource counters away from the target CPU when the CPU_DEAD or CPU_DEAD_FROZEN events occur for thet CPU, yes?
So the user-visible effects of the bug whcih was just fixed is that these counters will be somewhat inaccurate after a CPU is taken down, yes?
Why wasn't this bug noticed before? Has anyone tested the patch and confirmed that the numbers are now correct?
Given that this bug has been present for 1.5 years and nobody noticed, I don't think a backport into -stable is warranted?
Re: [PATCH 5/6] memcg: fix broken boolen expression
Quoted 28 lines · Andrew Morton
Quoted 14 lines · On Sat, 24 Dec 2011 05:00:18 +0200 "Kirill A. Shutemov" <[email protected]>…
From: "Kirill A. Shutemov" <[email protected]>
action !=
CPU_DEAD|| action !=CPU_DEAD_FROZENis always true.Signed-off-by Kirill A. Shutemov <[email protected]>--- mm/memcontrol.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)mm/memcontrol.c +0
-0mm/memcontrol.c static int __cpuinit memcg_cpu_hotplug_callback(struct notifier_block *nb, · line 2106
Quoted 8 lines
mm/memcontrol.c +1
-1@@ -2100,7 +2100,7 @@ static int __cpuinit memcg_cpu_hotplug_callback(struct notifier_block *nb,return NOTIFY_OK ; } -if ((action !=CPU_DEAD ) || action !=CPU_DEAD_FROZEN ) +if (action !=CPU_DEAD && action !=CPU_DEAD_FROZEN )return NOTIFY_OK ;for_each_mem_cgroup (iter)This spent too long in the backlog, sorry.
Quoted 6 lines
I don't want to merge this patch into either mainline or -stable until I find out what it does!
afacit the patch will newly cause the kernel to drain various resource counters away from the target CPU when the
CPU_DEADorCPU_DEAD_FROZENevents occur for thet CPU, yes?
Yes.
Quoted 3 lines
So the user-visible effects of the bug whcih was just fixed is that these counters will be somewhat inaccurate after a CPU is taken down, yes?
Correct.
Quoted 1 line
Why wasn't this bug noticed before?
I guess CPU hotplug is not a usual test case for memcg changes. And the result of the bug is inaccurate statistics, but not something dramatic (oops, panic, etc.).
Quoted 2 lines
Has anyone tested the patch and
confirmed that the numbers are now correct?
I haven't. I found the bug with sparse.
Quoted 3 lines
Given that this bug has been present for 1.5 years and nobody noticed, I don't think a backport into -stable is warranted?
Signature · 8 lines
Kirill A. Shutemov -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
A message that is not in the archive (sent off-list or not yet received): 20120404143403.fd05a284.akpm-de/[email protected]
Re: [PATCH 5/6] memcg: fix broken boolen expression
Quoted 28 lines · Andrew Morton
Quoted 14 lines · On Sat, 24 Dec 2011 05:00:18 +0200 "Kirill A. Shutemov"…
From: "Kirill A. Shutemov" <[email protected]>
action !=
CPU_DEAD|| action !=CPU_DEAD_FROZENis always true.Signed-off-by Kirill A. Shutemov <[email protected]>--- mm/memcontrol.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)mm/memcontrol.c +0
-0mm/memcontrol.c static int __cpuinit memcg_cpu_hotplug_callback(struct notifier_block *nb, · line 2106
Quoted 8 lines
mm/memcontrol.c +1
-1@@ -2100,7 +2100,7 @@ static int __cpuinit memcg_cpu_hotplug_callback(struct notifier_block *nb,return NOTIFY_OK ; } -if ((action !=CPU_DEAD ) || action !=CPU_DEAD_FROZEN ) +if (action !=CPU_DEAD && action !=CPU_DEAD_FROZEN )return NOTIFY_OK ;for_each_mem_cgroup (iter)This spent too long in the backlog, sorry.
Quoted 6 lines
I don't want to merge this patch into either mainline or -stable until I find out what it does!
afacit the patch will newly cause the kernel to drain various resource counters away from the target CPU when the
CPU_DEADorCPU_DEAD_FROZENevents occur for thet CPU, yes?
Yes.
Quoted 3 lines
So the user-visible effects of the bug whcih was just fixed is that these counters will be somewhat inaccurate after a CPU is taken down, yes?
Correct.
Quoted 1 line
Why wasn't this bug noticed before?
I guess CPU hotplug is not a usual test case for memcg changes. And the result of the bug is inaccurate statistics, but not something dramatic (oops, panic, etc.).
Quoted 2 lines
Has anyone tested the patch and
confirmed that the numbers are now correct?
I haven't. I found the bug with sparse.
Quoted 3 lines
Given that this bug has been present for 1.5 years and nobody noticed, I don't think a backport into -stable is warranted?
Signature · 1 line
Kirill A. Shutemov
PATCH 6/6 memcg: drop redundant brackets
In reply to Kirill A. ShutemovFrom: "Kirill A. Shutemov" <[email protected]>
--- mm/memcontrol.c | 28 ++++++++++++++-------------- 1 files changed, 14 insertions(+), 14 deletions(-)
mm/memcontrol.c +14 -14
@@ -73,7 +73,7 @@ static int really_do_swap_account __initdata = 0;#endif #else -#define do_swap_account (0) +#define do_swap_account 0#endif
@@ -113,9 +113,9 @@ enum mem_cgroup_events_target { MEM_CGROUP_TARGET_NUMAINFO, MEM_CGROUP_NTARGETS, }; -#define THRESHOLDS_EVENTS_TARGET (128) -#define SOFTLIMIT_EVENTS_TARGET (1024) -#define NUMAINFO_EVENTS_TARGET (1024) +#define THRESHOLDS_EVENTS_TARGET 128 +#define SOFTLIMIT_EVENTS_TARGET 1024 +#define NUMAINFO_EVENTS_TARGET 1024struct mem_cgroup_stat_cpu {long count[MEM_CGROUP_STAT_NSTATS ];
@@ -148,7 +148,7 @@ struct mem_cgroup_per_zone {/* use container_of */ };/* Macro for accessing counter */ -#define MEM_CGROUP_ZSTAT (mz, idx) ((mz)->count[(idx)]) +#define MEM_CGROUP_ZSTAT (mz, idx) ((mz)->count[idx])struct mem_cgroup_per_node {struct mem_cgroup_per_zone zoneinfo[MAX_NR_ZONES ];
@@ -346,8 +346,8 @@ static bool move_file(void)* Maximum loops in mem_cgroup_hierarchical_reclaim(), used for soft * limit reclaim to prevent infinite loops, if they ever occur. */ -#define MEM_CGROUP_MAX_RECLAIM_LOOPS (100) -#define MEM_CGROUP_MAX_SOFT_LIMIT_RECLAIM_LOOPS (2) +#define MEM_CGROUP_MAX_RECLAIM_LOOPS 100 +#define MEM_CGROUP_MAX_SOFT_LIMIT_RECLAIM_LOOPS 2enum charge_type {MEM_CGROUP_CHARGE_TYPE_CACHE =0 ,
@@ -368,11 +368,11 @@ enum mem_type { _KMEM, }; -#define MEMFILE_PRIVATE (x, val) (((x) << 16) | (val)) -#define MEMFILE_TYPE (val) (((val) >> 16) & 0xffff) +#define MEMFILE_PRIVATE (x, val) ((x) << 16 | (val)) +#define MEMFILE_TYPE (val) ((val) >> 16 & 0xffff)#define MEMFILE_ATTR (val) ((val) & 0xffff)/* Used for OOM nofiier */ -#define OOM_CONTROL (0) +#define OOM_CONTROL 0/* * Reclaim flags for mem_cgroup_hierarchical_reclaim
@@ -1913,7 +1913,7 @@ struct memcg_stock_pcp {unsigned int nr_pages;struct work_struct work;unsigned long flags; -#define FLUSHING_CACHED_CHARGE (0) +#define FLUSHING_CACHED_CHARGE 0 }; static DEFINE_PER_CPU(struct memcg_stock_pcp, memcg_stock);static DEFINE_MUTEX (percpu_charge_mutex);
@@ -2094,7 +2094,7 @@ static int __cpuinit memcg_cpu_hotplug_callback(struct notifier_block *nb,struct memcg_stock_pcp *stock;struct mem_cgroup *iter; -if ((action ==CPU_ONLINE )) { +if (action ==CPU_ONLINE ) {for_each_mem_cgroup (iter)synchronize_mem_cgroup_on_move (iter, cpu);return NOTIFY_OK ;
@@ -2458,8 +2458,8 @@ static void __mem_cgroup_commit_charge(struct mem_cgroup *memcg,#ifdef CONFIG_TRANSPARENT_HUGEPAGE -#define PCGF_NOCOPY_AT_SPLIT ((1 << PCG_LOCK) | (1 << PCG_MOVE_LOCK) |\ - (1 << PCG_MIGRATION)) +#define PCGF_NOCOPY_AT_SPLIT (1 << PCG_LOCK | 1 << PCG_MOVE_LOCK |\ + 1 << PCG_MIGRATION)/* * Because tail pages are not marked as "used", set it. We're under * zone->lru_lock, 'splitting on pmd' and compound_lock.
Signature · 8 lines
1.7.7.3 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Re: [PATCH 6/6] memcg: drop redundant brackets
Quoted 3 lines · On Sat, 24 Dec 2011 05:00:19 +0200 "Kirill A. Shutemov" <[email protected]>…
From: "Kirill A. Shutemov" <[email protected]>
Signed-off-by Kirill A. Shutemov <[email protected]>
Maybe I tend to add too many braces at using macro.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
A message that is not in the archive (sent off-list or not yet received): 1324695619-5537-6-git-send-email-kirill-oKw7cIdHH8eLwutG50LtGA@public.gmane.org
KAMEZAWA Hiroyuki
Acked-byRe: [PATCH 6/6] memcg: drop redundant brackets
Quoted 3 lines · On Sat, 24 Dec 2011 05:00:19 +0200 "Kirill A. Shutemov"…
From: "Kirill A. Shutemov" <[email protected]>
Signed-off-by Kirill A. Shutemov <[email protected]>
Maybe I tend to add too many braces at using macro.
Michal Hocko
Acked-byRe: [PATCH 6/6] memcg: drop redundant brackets
In reply to a message not in the archiveQuoted 3 lines · Kirill A. Shutemov
From: "Kirill A. Shutemov" <[email protected]>
Signed-off-by Kirill A. Shutemov <[email protected]>
I wasn't very convinced at first but it makes some sense as we should be consistent. So
Quoted 97 lines
--- mm/memcontrol.c | 28 ++++++++++++++-------------- 1 files changed, 14 insertions(+), 14 deletions(-)mm/memcontrol.c +14
-14@@ -73,7 +73,7 @@ static int really_do_swap_account __initdata = 0;#endif #else -#define do_swap_account (0) +#define do_swap_account 0#endif @@ -113,9 +113,9 @@ enum mem_cgroup_events_target { MEM_CGROUP_TARGET_NUMAINFO, MEM_CGROUP_NTARGETS, }; -#define THRESHOLDS_EVENTS_TARGET (128) -#define SOFTLIMIT_EVENTS_TARGET (1024) -#define NUMAINFO_EVENTS_TARGET (1024) +#define THRESHOLDS_EVENTS_TARGET 128 +#define SOFTLIMIT_EVENTS_TARGET 1024 +#define NUMAINFO_EVENTS_TARGET 1024struct mem_cgroup_stat_cpu {long count[MEM_CGROUP_STAT_NSTATS ];@@ -148,7 +148,7 @@ struct mem_cgroup_per_zone {/* use container_of */ };/* Macro for accessing counter */ -#define MEM_CGROUP_ZSTAT (mz, idx) ((mz)->count[(idx)]) +#define MEM_CGROUP_ZSTAT (mz, idx) ((mz)->count[idx])struct mem_cgroup_per_node {struct mem_cgroup_per_zone zoneinfo[MAX_NR_ZONES ];@@ -346,8 +346,8 @@ static bool move_file(void)* Maximum loops in mem_cgroup_hierarchical_reclaim(), used for soft * limit reclaim to prevent infinite loops, if they ever occur. */ -#define MEM_CGROUP_MAX_RECLAIM_LOOPS (100) -#define MEM_CGROUP_MAX_SOFT_LIMIT_RECLAIM_LOOPS (2) +#define MEM_CGROUP_MAX_RECLAIM_LOOPS 100 +#define MEM_CGROUP_MAX_SOFT_LIMIT_RECLAIM_LOOPS 2enum charge_type {MEM_CGROUP_CHARGE_TYPE_CACHE =0 ,@@ -368,11 +368,11 @@ enum mem_type { _KMEM, }; -#define MEMFILE_PRIVATE (x, val) (((x) << 16) | (val)) -#define MEMFILE_TYPE (val) (((val) >> 16) & 0xffff) +#define MEMFILE_PRIVATE (x, val) ((x) << 16 | (val)) +#define MEMFILE_TYPE (val) ((val) >> 16 & 0xffff)#define MEMFILE_ATTR (val) ((val) & 0xffff)/* Used for OOM nofiier */ -#define OOM_CONTROL (0) +#define OOM_CONTROL 0/* * Reclaim flags for mem_cgroup_hierarchical_reclaim @@ -1913,7 +1913,7 @@ struct memcg_stock_pcp {unsigned int nr_pages;struct work_struct work;unsigned long flags; -#define FLUSHING_CACHED_CHARGE (0) +#define FLUSHING_CACHED_CHARGE 0 }; static DEFINE_PER_CPU(struct memcg_stock_pcp, memcg_stock);static DEFINE_MUTEX (percpu_charge_mutex);@@ -2094,7 +2094,7 @@ static int __cpuinit memcg_cpu_hotplug_callback(struct notifier_block *nb,struct memcg_stock_pcp *stock;struct mem_cgroup *iter; -if ((action ==CPU_ONLINE )) { +if (action ==CPU_ONLINE ) {for_each_mem_cgroup (iter)synchronize_mem_cgroup_on_move (iter, cpu);return NOTIFY_OK ;@@ -2458,8 +2458,8 @@ static void __mem_cgroup_commit_charge(struct mem_cgroup *memcg,#ifdef CONFIG_TRANSPARENT_HUGEPAGE -#define PCGF_NOCOPY_AT_SPLIT ((1 << PCG_LOCK) | (1 << PCG_MOVE_LOCK) |\ - (1 << PCG_MIGRATION)) +#define PCGF_NOCOPY_AT_SPLIT (1 << PCG_LOCK | 1 << PCG_MOVE_LOCK |\ + 1 << PCG_MIGRATION)/* * Because tail pages are not marked as "used", set it. We're under * zone->lru_lock, 'splitting on pmd' and compound_lock. Signature · 1 line
1.7.7.3
Signature · 6 lines
Michal Hocko SUSE Labs SUSE LINUX s.r.o. Lihovarska 1060/12 190 00 Praha 9 Czech Republic
Re: [PATCH 6/6] memcg: drop redundant brackets
In reply to Kirill A. ShutemovQuoted 3 lines · Kirill A. Shutemov
From: "Kirill A. Shutemov" <[email protected]>
Signed-off-by Kirill A. Shutemov <[email protected]>
I wasn't very convinced at first but it makes some sense as we should be consistent. So
Quoted 97 lines
--- mm/memcontrol.c | 28 ++++++++++++++-------------- 1 files changed, 14 insertions(+), 14 deletions(-)mm/memcontrol.c +14
-14@@ -73,7 +73,7 @@ static int really_do_swap_account __initdata = 0;#endif #else -#define do_swap_account (0) +#define do_swap_account 0#endif @@ -113,9 +113,9 @@ enum mem_cgroup_events_target { MEM_CGROUP_TARGET_NUMAINFO, MEM_CGROUP_NTARGETS, }; -#define THRESHOLDS_EVENTS_TARGET (128) -#define SOFTLIMIT_EVENTS_TARGET (1024) -#define NUMAINFO_EVENTS_TARGET (1024) +#define THRESHOLDS_EVENTS_TARGET 128 +#define SOFTLIMIT_EVENTS_TARGET 1024 +#define NUMAINFO_EVENTS_TARGET 1024struct mem_cgroup_stat_cpu {long count[MEM_CGROUP_STAT_NSTATS ];@@ -148,7 +148,7 @@ struct mem_cgroup_per_zone {/* use container_of */ };/* Macro for accessing counter */ -#define MEM_CGROUP_ZSTAT (mz, idx) ((mz)->count[(idx)]) +#define MEM_CGROUP_ZSTAT (mz, idx) ((mz)->count[idx])struct mem_cgroup_per_node {struct mem_cgroup_per_zone zoneinfo[MAX_NR_ZONES ];@@ -346,8 +346,8 @@ static bool move_file(void)* Maximum loops in mem_cgroup_hierarchical_reclaim(), used for soft * limit reclaim to prevent infinite loops, if they ever occur. */ -#define MEM_CGROUP_MAX_RECLAIM_LOOPS (100) -#define MEM_CGROUP_MAX_SOFT_LIMIT_RECLAIM_LOOPS (2) +#define MEM_CGROUP_MAX_RECLAIM_LOOPS 100 +#define MEM_CGROUP_MAX_SOFT_LIMIT_RECLAIM_LOOPS 2enum charge_type {MEM_CGROUP_CHARGE_TYPE_CACHE =0 ,@@ -368,11 +368,11 @@ enum mem_type { _KMEM, }; -#define MEMFILE_PRIVATE (x, val) (((x) << 16) | (val)) -#define MEMFILE_TYPE (val) (((val) >> 16) & 0xffff) +#define MEMFILE_PRIVATE (x, val) ((x) << 16 | (val)) +#define MEMFILE_TYPE (val) ((val) >> 16 & 0xffff)#define MEMFILE_ATTR (val) ((val) & 0xffff)/* Used for OOM nofiier */ -#define OOM_CONTROL (0) +#define OOM_CONTROL 0/* * Reclaim flags for mem_cgroup_hierarchical_reclaim @@ -1913,7 +1913,7 @@ struct memcg_stock_pcp {unsigned int nr_pages;struct work_struct work;unsigned long flags; -#define FLUSHING_CACHED_CHARGE (0) +#define FLUSHING_CACHED_CHARGE 0 }; static DEFINE_PER_CPU(struct memcg_stock_pcp, memcg_stock);static DEFINE_MUTEX (percpu_charge_mutex);@@ -2094,7 +2094,7 @@ static int __cpuinit memcg_cpu_hotplug_callback(struct notifier_block *nb,struct memcg_stock_pcp *stock;struct mem_cgroup *iter; -if ((action ==CPU_ONLINE )) { +if (action ==CPU_ONLINE ) {for_each_mem_cgroup (iter)synchronize_mem_cgroup_on_move (iter, cpu);return NOTIFY_OK ;@@ -2458,8 +2458,8 @@ static void __mem_cgroup_commit_charge(struct mem_cgroup *memcg,#ifdef CONFIG_TRANSPARENT_HUGEPAGE -#define PCGF_NOCOPY_AT_SPLIT ((1 << PCG_LOCK) | (1 << PCG_MOVE_LOCK) |\ - (1 << PCG_MIGRATION)) +#define PCGF_NOCOPY_AT_SPLIT (1 << PCG_LOCK | 1 << PCG_MOVE_LOCK |\ + 1 << PCG_MIGRATION)/* * Because tail pages are not marked as "used", set it. We're under * zone->lru_lock, 'splitting on pmd' and compound_lock. Signature · 1 line
1.7.7.3
Signature · 13 lines
Michal Hocko SUSE Labs SUSE LINUX s.r.o. Lihovarska 1060/12 190 00 Praha 9 Czech Republic -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 6 lines · On Sat, 24 Dec 2011 05:00:14 +0200 "Kirill A. Shutemov" <[email protected]>…
From: "Kirill A. Shutemov" <[email protected]>
mm/memcontrol.c: In function ‘memcg_check_events’:mm/memcontrol.c:784:22: warning: unused variable ‘do_numainfo’ [-Wunused-variable]Signed-off-by Kirill A. Shutemov <[email protected]>
Hmm ? Doesn't this fix cause a new Warning ?
mm/memcontrol.c: In function ?memcg_check_events?:mm/memcontrol.c:789: warning: ISO C90 forbids mixed declarations and code
Thanks,
-Kame
Quoted 30 lines
--- mm/memcontrol.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-)mm/memcontrol.c +4
-3@@ -781,14 +781,15 @@ static void memcg_check_events(struct mem_cgroup *memcg, struct page *page)/* threshold event is triggered in finer grain than soft limit */ if (unlikely (mem_cgroup_event_ratelimit (memcg,MEM_CGROUP_TARGET_THRESH ))) { -bool do_softlimit, do_numainfo; +bool do_softlimit; - do_softlimit =mem_cgroup_event_ratelimit (memcg, -MEM_CGROUP_TARGET_SOFTLIMIT );#if MAX_NUMNODES >1 +bool do_numainfo; do_numainfo =mem_cgroup_event_ratelimit (memcg,MEM_CGROUP_TARGET_NUMAINFO );#endif + do_softlimit =mem_cgroup_event_ratelimit (memcg, +MEM_CGROUP_TARGET_SOFTLIMIT );preempt_enable ();mem_cgroup_threshold (memcg);Signature · 1 line
1.7.7.3
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 8 lines · KAMEZAWA Hiroyuki
Quoted 5 lines · On Sat, 24 Dec 2011 05:00:14 +0200 "Kirill A. Shutemov"…
From: "Kirill A. Shutemov" <[email protected]>
mm/memcontrol.c: In function ‘memcg_check_events’:mm/memcontrol.c:784:22: warning: unused variable ‘do_numainfo’ [-Wunused-variable]
Quoted 6 lines
Quoted 1 line
Signed-off-by Kirill A. Shutemov <[email protected]>Hmm ? Doesn't this fix cause a new Warning ?
mm/memcontrol.c: In function ?memcg_check_events?:mm/memcontrol.c:789: warning: ISO C90 forbids mixed declarations and code
I don't see how. The result code is:
if (unlikely(mem_cgroup_event_ratelimit(memcg,
MEM_CGROUP_TARGET_THRESH))) {
bool do_softlimit;#if MAX_NUMNODES > 1 bool do_numainfo; do_numainfo = mem_cgroup_event_ratelimit(memcg, MEM_CGROUP_TARGET_NUMAINFO); #endif do_softlimit = mem_cgroup_event_ratelimit(memcg, MEM_CGROUP_TARGET_SOFTLIMIT); preempt_enable(); mem_cgroup_threshold(memcg);
Quoted 34 lines
Thanks,
-KameQuoted 30 lines
--- mm/memcontrol.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-)mm/memcontrol.c +4
-3@@ -781,14 +781,15 @@ static void memcg_check_events(struct mem_cgroup *memcg, struct page *page)/* threshold event is triggered in finer grain than soft limit */ if (unlikely (mem_cgroup_event_ratelimit (memcg,MEM_CGROUP_TARGET_THRESH ))) { -bool do_softlimit, do_numainfo; +bool do_softlimit; - do_softlimit =mem_cgroup_event_ratelimit (memcg, -MEM_CGROUP_TARGET_SOFTLIMIT );#if MAX_NUMNODES >1 +bool do_numainfo; do_numainfo =mem_cgroup_event_ratelimit (memcg,MEM_CGROUP_TARGET_NUMAINFO );#endif + do_softlimit =mem_cgroup_event_ratelimit (memcg, +MEM_CGROUP_TARGET_SOFTLIMIT );preempt_enable ();mem_cgroup_threshold (memcg);Signature · 1 line
1.7.7.3
Signature · 1 line
Kirill A. Shutemov
Quoted 22 lines · On Mon, 26 Dec 2011 08:36:52 +0200 "Kirill A. Shutemov"…
Quoted 8 lines · KAMEZAWA Hiroyuki
Quoted 5 lines · On Sat, 24 Dec 2011 05:00:14 +0200 "Kirill A. Shutemov"…
From: "Kirill A. Shutemov" <[email protected]>
mm/memcontrol.c: In function ‘memcg_check_events’:mm/memcontrol.c:784:22: warning: unused variable ‘do_numainfo’ [-Wunused-variable]Quoted 6 lines
Quoted 1 line
Signed-off-by Kirill A. Shutemov <[email protected]>Hmm ? Doesn't this fix cause a new Warning ?
mm/memcontrol.c: In function ?memcg_check_events?:mm/memcontrol.c:789: warning: ISO C90 forbids mixed declarations and codeI don't see how. The result code is:
if (unlikely(mem_cgroup_event_ratelimit(memcg, MEM_CGROUP_TARGET_THRESH))) { bool do_softlimit;
Quoted 11 lines
#if MAX_NUMNODES > 1 bool do_numainfo; do_numainfo = mem_cgroup_event_ratelimit(memcg, MEM_CGROUP_TARGET_NUMAINFO); #endif do_softlimit = mem_cgroup_event_ratelimit(memcg, MEM_CGROUP_TARGET_SOFTLIMIT); preempt_enable(); mem_cgroup_threshold(memcg);
Ah. please see linux-next and rebase onto that.
Thanks,
-Kame
Quoted 34 lines · KAMEZAWA Hiroyuki
Quoted 31 lines · On Mon, 26 Dec 2011 08:36:52 +0200 "Kirill A. Shutemov"…
Quoted 8 lines · KAMEZAWA Hiroyuki
Quoted 5 lines · On Sat, 24 Dec 2011 05:00:14 +0200 "Kirill A. Shutemov"…
From: "Kirill A. Shutemov" <[email protected]>
mm/memcontrol.c: In function ‘memcg_check_events’:mm/memcontrol.c:784:22: warning: unused variable ‘do_numainfo’ [-Wunused-variable]Quoted 6 lines
Quoted 1 line
Signed-off-by Kirill A. Shutemov <[email protected]>Hmm ? Doesn't this fix cause a new Warning ?
mm/memcontrol.c: In function ?memcg_check_events?:mm/memcontrol.c:789: warning: ISO C90 forbids mixed declarations and codeI don't see how. The result code is:
if (unlikely(mem_cgroup_event_ratelimit(memcg, MEM_CGROUP_TARGET_THRESH))) { bool do_softlimit;#if MAX_NUMNODES > 1 bool do_numainfo; do_numainfo = mem_cgroup_event_ratelimit(memcg, MEM_CGROUP_TARGET_NUMAINFO); #endif do_softlimit = mem_cgroup_event_ratelimit(memcg, MEM_CGROUP_TARGET_SOFTLIMIT); preempt_enable();
Quoted 4 lines
Quoted 2 lines
mem_cgroup_threshold(memcg);Ah. please see linux-next and rebase onto that.
The patchset is on top of next-20111222. Have I missed something?
Quoted 4 lines
Thanks,
-Kame
Signature · 1 line
Kirill A. Shutemov
KAMEZAWA Hiroyuki
Acked-byQuoted 35 lines · On Mon, 26 Dec 2011 08:47:34 +0200 "Kirill A. Shutemov"…
Quoted 34 lines · KAMEZAWA Hiroyuki
Quoted 31 lines · On Mon, 26 Dec 2011 08:36:52 +0200 "Kirill A. Shutemov"…
Quoted 8 lines · KAMEZAWA Hiroyuki
Quoted 5 lines · On Sat, 24 Dec 2011 05:00:14 +0200 "Kirill A. Shutemov"…
From: "Kirill A. Shutemov" <[email protected]>
mm/memcontrol.c: In function ‘memcg_check_events’:mm/memcontrol.c:784:22: warning: unused variable ‘do_numainfo’ [-Wunused-variable]Quoted 6 lines
Quoted 1 line
Signed-off-by Kirill A. Shutemov <[email protected]>Hmm ? Doesn't this fix cause a new Warning ?
mm/memcontrol.c: In function ?memcg_check_events?:mm/memcontrol.c:789: warning: ISO C90 forbids mixed declarations and codeI don't see how. The result code is:
if (unlikely(mem_cgroup_event_ratelimit(memcg, MEM_CGROUP_TARGET_THRESH))) { bool do_softlimit;#if MAX_NUMNODES > 1 bool do_numainfo; do_numainfo = mem_cgroup_event_ratelimit(memcg, MEM_CGROUP_TARGET_NUMAINFO); #endif do_softlimit = mem_cgroup_event_ratelimit(memcg, MEM_CGROUP_TARGET_SOFTLIMIT); preempt_enable();
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
mem_cgroup_threshold(memcg);Ah. please see linux-next and rebase onto that.
The patchset is on top of next-20111222. Have I missed something?
Ah, ok. my mistake. Sorry.
A message that is not in the archive (sent off-list or not yet received): [email protected]
KAMEZAWA Hiroyuki
Acked-byQuoted 35 lines · On Mon, 26 Dec 2011 08:47:34 +0200 "Kirill A. Shutemov"…
Quoted 34 lines · KAMEZAWA Hiroyuki
Quoted 31 lines · On Mon, 26 Dec 2011 08:36:52 +0200 "Kirill A. Shutemov"…
Quoted 8 lines · KAMEZAWA Hiroyuki
Quoted 5 lines · On Sat, 24 Dec 2011 05:00:14 +0200 "Kirill A. Shutemov"…
From: "Kirill A. Shutemov" <[email protected]>
mm/memcontrol.c: In function ‘memcg_check_events’:mm/memcontrol.c:784:22: warning: unused variable ‘do_numainfo’ [-Wunused-variable]Quoted 6 lines
Quoted 1 line
Signed-off-by Kirill A. Shutemov <[email protected]>Hmm ? Doesn't this fix cause a new Warning ?
mm/memcontrol.c: In function ?memcg_check_events?:mm/memcontrol.c:789: warning: ISO C90 forbids mixed declarations and codeI don't see how. The result code is:
if (unlikely(mem_cgroup_event_ratelimit(memcg, MEM_CGROUP_TARGET_THRESH))) { bool do_softlimit;#if MAX_NUMNODES > 1 bool do_numainfo; do_numainfo = mem_cgroup_event_ratelimit(memcg, MEM_CGROUP_TARGET_NUMAINFO); #endif do_softlimit = mem_cgroup_event_ratelimit(memcg, MEM_CGROUP_TARGET_SOFTLIMIT); preempt_enable();
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
mem_cgroup_threshold(memcg);Ah. please see linux-next and rebase onto that.
The patchset is on top of next-20111222. Have I missed something?
Ah, ok. my mistake. Sorry.
A message that is not in the archive (sent off-list or not yet received): 20111226154252.d3621532.kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org
Quoted 34 lines · KAMEZAWA Hiroyuki
Quoted 31 lines · On Mon, 26 Dec 2011 08:36:52 +0200 "Kirill A. Shutemov" <[email protected]>…
Quoted 8 lines · KAMEZAWA Hiroyuki
Quoted 5 lines · On Sat, 24 Dec 2011 05:00:14 +0200 "Kirill A. Shutemov" <[email protected]>…
From: "Kirill A. Shutemov" <[email protected]>
mm/memcontrol.c: In function ‘memcg_check_events’:mm/memcontrol.c:784:22: warning: unused variable ‘do_numainfo’ [-Wunused-variable]Quoted 6 lines
Quoted 1 line
Signed-off-by Kirill A. Shutemov <[email protected]>Hmm ? Doesn't this fix cause a new Warning ?
mm/memcontrol.c: In function ?memcg_check_events?:mm/memcontrol.c:789: warning: ISO C90 forbids mixed declarations and codeI don't see how. The result code is:
if (unlikely(mem_cgroup_event_ratelimit(memcg, MEM_CGROUP_TARGET_THRESH))) { bool do_softlimit;#if MAX_NUMNODES > 1 bool do_numainfo; do_numainfo = mem_cgroup_event_ratelimit(memcg, MEM_CGROUP_TARGET_NUMAINFO); #endif do_softlimit = mem_cgroup_event_ratelimit(memcg, MEM_CGROUP_TARGET_SOFTLIMIT); preempt_enable();
Quoted 4 lines
Quoted 2 lines
mem_cgroup_threshold(memcg);Ah. please see linux-next and rebase onto that.
The patchset is on top of next-20111222. Have I missed something?
Quoted 4 lines
Thanks,
-Kame
Signature · 5 lines
Kirill A. Shutemov _______________________________________________ Containers mailing list [email protected] https://lists.linuxfoundation.org/mailman/listinfo/containers
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 22 lines · On Mon, 26 Dec 2011 08:36:52 +0200 "Kirill A. Shutemov"…
Quoted 8 lines · KAMEZAWA Hiroyuki
Quoted 5 lines · On Sat, 24 Dec 2011 05:00:14 +0200 "Kirill A. Shutemov"…
From: "Kirill A. Shutemov" <[email protected]>
mm/memcontrol.c: In function ‘memcg_check_events’:mm/memcontrol.c:784:22: warning: unused variable ‘do_numainfo’ [-Wunused-variable]Quoted 6 lines
Quoted 1 line
Signed-off-by Kirill A. Shutemov <[email protected]>Hmm ? Doesn't this fix cause a new Warning ?
mm/memcontrol.c: In function ?memcg_check_events?:mm/memcontrol.c:789: warning: ISO C90 forbids mixed declarations and codeI don't see how. The result code is:
if (unlikely(mem_cgroup_event_ratelimit(memcg, MEM_CGROUP_TARGET_THRESH))) { bool do_softlimit;
Quoted 11 lines
#if MAX_NUMNODES > 1 bool do_numainfo; do_numainfo = mem_cgroup_event_ratelimit(memcg, MEM_CGROUP_TARGET_NUMAINFO); #endif do_softlimit = mem_cgroup_event_ratelimit(memcg, MEM_CGROUP_TARGET_SOFTLIMIT); preempt_enable(); mem_cgroup_threshold(memcg);
Ah. please see linux-next and rebase onto that.
Thanks,
-Kame
A message that is not in the archive (sent off-list or not yet received): 20111226152531.e0335ec4.kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org
Quoted 8 lines · KAMEZAWA Hiroyuki
Quoted 5 lines · On Sat, 24 Dec 2011 05:00:14 +0200 "Kirill A. Shutemov" <[email protected]>…
From: "Kirill A. Shutemov" <[email protected]>
mm/memcontrol.c: In function ‘memcg_check_events’:mm/memcontrol.c:784:22: warning: unused variable ‘do_numainfo’ [-Wunused-variable]
Quoted 6 lines
Quoted 1 line
Signed-off-by Kirill A. Shutemov <[email protected]>Hmm ? Doesn't this fix cause a new Warning ?
mm/memcontrol.c: In function ?memcg_check_events?:mm/memcontrol.c:789: warning: ISO C90 forbids mixed declarations and code
I don't see how. The result code is:
if (unlikely(mem_cgroup_event_ratelimit(memcg,
MEM_CGROUP_TARGET_THRESH))) {
bool do_softlimit;#if MAX_NUMNODES > 1 bool do_numainfo; do_numainfo = mem_cgroup_event_ratelimit(memcg, MEM_CGROUP_TARGET_NUMAINFO); #endif do_softlimit = mem_cgroup_event_ratelimit(memcg, MEM_CGROUP_TARGET_SOFTLIMIT); preempt_enable(); mem_cgroup_threshold(memcg);
Quoted 34 lines
Thanks,
-KameQuoted 30 lines
--- mm/memcontrol.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-)mm/memcontrol.c +4
-3@@ -781,14 +781,15 @@ static void memcg_check_events(struct mem_cgroup *memcg, struct page *page)/* threshold event is triggered in finer grain than soft limit */ if (unlikely (mem_cgroup_event_ratelimit (memcg,MEM_CGROUP_TARGET_THRESH ))) { -bool do_softlimit, do_numainfo; +bool do_softlimit; - do_softlimit =mem_cgroup_event_ratelimit (memcg, -MEM_CGROUP_TARGET_SOFTLIMIT );#if MAX_NUMNODES >1 +bool do_numainfo; do_numainfo =mem_cgroup_event_ratelimit (memcg,MEM_CGROUP_TARGET_NUMAINFO );#endif + do_softlimit =mem_cgroup_event_ratelimit (memcg, +MEM_CGROUP_TARGET_SOFTLIMIT );preempt_enable ();mem_cgroup_threshold (memcg);Signature · 1 line
1.7.7.3
Signature · 5 lines
Kirill A. Shutemov _______________________________________________ Containers mailing list [email protected] https://lists.linuxfoundation.org/mailman/listinfo/containers
PATCH 1/1 Makefiles: Disable unused-variable warning (was: Re: [PATCH 1/6] memcg: fix unused variable warning)
In reply to Kirill A. ShutemovQuoted 20 lines · Kirill A. Shutemov
From: "Kirill A. Shutemov" <[email protected]>
mm/memcontrol.c: In function ‘memcg_check_events’:mm/memcontrol.c:784:22: warning: unused variable ‘do_numainfo’ [-Wunused-variable]Signed-off-by Kirill A. Shutemov <[email protected]>--- mm/memcontrol.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-)mm/memcontrol.c +1
-1@@ -781,14 +781,15 @@ static void memcg_check_events(struct mem_cgroup *memcg, struct page *page)/* threshold event is triggered in finer grain than soft limit */ if (unlikely (mem_cgroup_event_ratelimit (memcg,MEM_CGROUP_TARGET_THRESH ))) { -bool do_softlimit, do_numainfo; +bool do_softlimit;
mm/memcontrol.c static void memcg_check_events(struct mem_cgroup *memcg, struct page *page) · line 792
Quoted 10 lines
mm/memcontrol.c +3
-2- do_softlimit =mem_cgroup_event_ratelimit (memcg, -MEM_CGROUP_TARGET_SOFTLIMIT );#if MAX_NUMNODES >1 +bool do_numainfo; do_numainfo =mem_cgroup_event_ratelimit (memcg,MEM_CGROUP_TARGET_NUMAINFO );#endif + do_softlimit =mem_cgroup_event_ratelimit (memcg, +MEM_CGROUP_TARGET_SOFTLIMIT );
I don't like this very much. Maybe we should get rid of both do_* and do it with flags? But maybe it is not worth the additional code at all...
Anyway, I am wondering why unused-but-set-variable is disabled while unused-variable is enabled. Shouldn't we just disable it as well rather than workaround this in the code? The warning is just pure noise in this case.
What about something like:
---
From e1136891fe86eacf9212b2144f80ff6b75b10194 Mon Sep 17 00:00:00 2001
From: Michal Hocko <[email protected]>
Date: Tue, 27 Dec 2011 14:53:06 +0100
Subject: [PATCH] Makefiles: Disable unused-variable warning
We are already disabling unused-but-set-variable and Wunused-variable produces some noise as well.
--- Makefile | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
Makefile +1 -0
@@ -578,6 +578,7 @@ endif # This warning generated too much noise in a regular build. # Use make W=1 to enable this warning (see scripts/Makefile.build) KBUILD_CFLAGS += $(call cc-disable-warning, unused-but-set-variable) +KBUILD_CFLAGS += $(call cc-disable-warning, unused-variable) ifdef CONFIG_FRAME_POINTER KBUILD_CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls
Signature · 15 lines
1.7.7.3 -- Michal Hocko SUSE Labs SUSE LINUX s.r.o. Lihovarska 1060/12 190 00 Praha 9 Czech Republic -- To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] Makefiles: Disable unused-variable warning (was: Re: [PATCH 1/6] memcg: fix unused variable warning)
Quoted 22 lines · Michal Hocko
Quoted 21 lines · Kirill A. Shutemov
From: "Kirill A. Shutemov" <[email protected]>
mm/memcontrol.c: In function ‘memcg_check_events’:mm/memcontrol.c:784:22: warning: unused variable ‘do_numainfo’ [-Wunused-variable]Signed-off-by Kirill A. Shutemov <[email protected]>--- mm/memcontrol.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-)mm/memcontrol.c +1
-1@@ -781,14 +781,15 @@ static void memcg_check_events(struct mem_cgroup *memcg, struct page *page)/* threshold event is triggered in finer grain than soft limit */ if (unlikely (mem_cgroup_event_ratelimit (memcg,MEM_CGROUP_TARGET_THRESH ))) { -bool do_softlimit, do_numainfo; +bool do_softlimit;
Quoted 13 lines
mm/memcontrol.c static void memcg_check_events(struct mem_cgroup *memcg, struct page *page) · line 792
Quoted 9 lines
mm/memcontrol.c +3
-2- do_softlimit =mem_cgroup_event_ratelimit (memcg, -MEM_CGROUP_TARGET_SOFTLIMIT );#if MAX_NUMNODES >1 +bool do_numainfo; do_numainfo =mem_cgroup_event_ratelimit (memcg,MEM_CGROUP_TARGET_NUMAINFO );#endif + do_softlimit =mem_cgroup_event_ratelimit (memcg, +MEM_CGROUP_TARGET_SOFTLIMIT );I don't like this very much. Maybe we should get rid of both do_* and do it with flags? But maybe it is not worth the additional code at all...
Something like this (untested):
====
From f57e1a2e1aaaa167c75b963d5bf12fcbdd3331b8 Mon Sep 17 00:00:00 2001
From: "Kirill A. Shutemov" <[email protected]>
Date: Tue, 27 Dec 2011 20:17:13 +0200
Subject: [PATCH] memcg: cleanup memcg_check_events()
--- mm/memcontrol.c | 42 ++++++++++++++++++++++++------------------ 1 files changed, 24 insertions(+), 18 deletions(-)
mm/memcontrol.c +24 -18
@@ -108,11 +108,12 @@ enum mem_cgroup_events_index {* than using jiffies etc. to handle periodic memcg event. */ enum mem_cgroup_events_target { -MEM_CGROUP_TARGET_THRESH , -MEM_CGROUP_TARGET_SOFTLIMIT , -MEM_CGROUP_TARGET_NUMAINFO , -MEM_CGROUP_NTARGETS , +MEM_CGROUP_TARGET_THRESH =BIT (1 ), +MEM_CGROUP_TARGET_SOFTLIMIT =BIT (2 ), +MEM_CGROUP_TARGET_NUMAINFO =BIT (3 ), }; +#define MEM_CGROUP_NTARGETS 3 +#define THRESHOLDS_EVENTS_TARGET (128)#define SOFTLIMIT_EVENTS_TARGET (1024)#define NUMAINFO_EVENTS_TARGET (1024)
@@ -743,7 +744,7 @@ static unsigned long mem_cgroup_nr_lru_pages(struct mem_cgroup *memcg,return total; } -static bool mem_cgroup_event_ratelimit (struct mem_cgroup *memcg, +static int mem_cgroup_event_ratelimit (struct mem_cgroup *memcg,enum mem_cgroup_events_target target) {unsigned long val, next;
@@ -766,9 +767,9 @@ static bool mem_cgroup_event_ratelimit(struct mem_cgroup *memcg,break ; }__this_cpu_write (memcg->stat->targets[target], next); -return true; +return target; } -return false; +return 0 ; }/*
@@ -777,29 +778,34 @@ static bool mem_cgroup_event_ratelimit(struct mem_cgroup *memcg,*/ static void memcg_check_events (struct mem_cgroup *memcg,struct page *page) { +int flags; +preempt_disable (); -/* threshold event is triggered in finer grain than soft limit */ -if (unlikely (mem_cgroup_event_ratelimit (memcg, -MEM_CGROUP_TARGET_THRESH ))) { -bool do_softlimit, do_numainfo; + flags =mem_cgroup_event_ratelimit (memcg,MEM_CGROUP_TARGET_THRESH ); - do_softlimit =mem_cgroup_event_ratelimit (memcg, +/* +* Threshold event is triggered in finer grain than soft limit +* and numainfo +*/ +if (unlikely (flags)) { + flags |=mem_cgroup_event_ratelimit (memcg,MEM_CGROUP_TARGET_SOFTLIMIT );#if MAX_NUMNODES >1 - do_numainfo =mem_cgroup_event_ratelimit (memcg, + flags |=mem_cgroup_event_ratelimit (memcg,MEM_CGROUP_TARGET_NUMAINFO );#endif -preempt_enable (); + } +preempt_enable (); +if (unlikely (flags)) {mem_cgroup_threshold (memcg); -if (unlikely (do_softlimit)) +if (unlikely (flags &MEM_CGROUP_TARGET_SOFTLIMIT ))mem_cgroup_update_tree (memcg, page);#if MAX_NUMNODES >1 -if (unlikely (do_numainfo)) +if (unlikely (flags &MEM_CGROUP_TARGET_NUMAINFO ))atomic_inc (&memcg->numainfo_events);#endif - }else -preempt_enable (); + } }struct mem_cgroup *mem_cgroup_from_cont (struct cgroup *cont)
Signature · 8 lines
1.7.7.3 -- Kirill A. Shutemov -- To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] Makefiles: Disable unused-variable warning (was: Re: [PATCH 1/6] memcg: fix unused variable warning)
Quoted 37 lines · Kirill A. Shutemov
Quoted 22 lines · Michal Hocko
Quoted 21 lines · Kirill A. Shutemov
From: "Kirill A. Shutemov" <[email protected]>
mm/memcontrol.c: In function ‘memcg_check_events’:mm/memcontrol.c:784:22: warning: unused variable ‘do_numainfo’ [-Wunused-variable]Signed-off-by Kirill A. Shutemov <[email protected]>--- mm/memcontrol.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-)mm/memcontrol.c +1
-1@@ -781,14 +781,15 @@ static void memcg_check_events(struct mem_cgroup *memcg, struct page *page)/* threshold event is triggered in finer grain than soft limit */ if (unlikely (mem_cgroup_event_ratelimit (memcg,MEM_CGROUP_TARGET_THRESH ))) { -bool do_softlimit, do_numainfo; +bool do_softlimit;Quoted 13 lines
mm/memcontrol.c static void memcg_check_events(struct mem_cgroup *memcg, struct page *page) · line 792
Quoted 9 lines
mm/memcontrol.c +3
-2- do_softlimit =mem_cgroup_event_ratelimit (memcg, -MEM_CGROUP_TARGET_SOFTLIMIT );#if MAX_NUMNODES >1 +bool do_numainfo; do_numainfo =mem_cgroup_event_ratelimit (memcg,MEM_CGROUP_TARGET_NUMAINFO );#endif + do_softlimit =mem_cgroup_event_ratelimit (memcg, +MEM_CGROUP_TARGET_SOFTLIMIT );I don't like this very much. Maybe we should get rid of both do_* and do it with flags? But maybe it is not worth the additional code at all...
Quoted 8 lines
Something like this (untested):
====
Fromf57e1a2e1aaaa167c75b963d5bf12fcbdd3331b8Mon Sep 17 00:00:00 2001
From: "Kirill A. Shutemov" <[email protected]>
Date: Tue, 27 Dec 2011 20:17:13 +0200
Subject: [PATCH] memcg: cleanupmemcg_check_events()Signed-off-by Kirill A. Shutemov <[email protected]>
The patch looks correct but I am still not sure this is worth fixing in the code rather than disabling Wunused-variable.
Quoted 94 lines
--- mm/memcontrol.c | 42 ++++++++++++++++++++++++------------------ 1 files changed, 24 insertions(+), 18 deletions(-)mm/memcontrol.c +24
-18@@ -108,11 +108,12 @@ enum mem_cgroup_events_index {* than using jiffies etc. to handle periodic memcg event. */ enum mem_cgroup_events_target { -MEM_CGROUP_TARGET_THRESH , -MEM_CGROUP_TARGET_SOFTLIMIT , -MEM_CGROUP_TARGET_NUMAINFO , -MEM_CGROUP_NTARGETS , +MEM_CGROUP_TARGET_THRESH =BIT (1 ), +MEM_CGROUP_TARGET_SOFTLIMIT =BIT (2 ), +MEM_CGROUP_TARGET_NUMAINFO =BIT (3 ), }; +#define MEM_CGROUP_NTARGETS 3 +#define THRESHOLDS_EVENTS_TARGET (128)#define SOFTLIMIT_EVENTS_TARGET (1024)#define NUMAINFO_EVENTS_TARGET (1024)@@ -743,7 +744,7 @@ static unsigned long mem_cgroup_nr_lru_pages(struct mem_cgroup *memcg,return total; } -static bool mem_cgroup_event_ratelimit (struct mem_cgroup *memcg, +static int mem_cgroup_event_ratelimit (struct mem_cgroup *memcg,enum mem_cgroup_events_target target) {unsigned long val, next;@@ -766,9 +767,9 @@ static bool mem_cgroup_event_ratelimit(struct mem_cgroup *memcg,break ; }__this_cpu_write (memcg->stat->targets[target], next); -return true; +return target; } -return false; +return 0 ; }/* @@ -777,29 +778,34 @@ static bool mem_cgroup_event_ratelimit(struct mem_cgroup *memcg,*/ static void memcg_check_events (struct mem_cgroup *memcg,struct page *page) { +int flags; +preempt_disable (); -/* threshold event is triggered in finer grain than soft limit */ -if (unlikely (mem_cgroup_event_ratelimit (memcg, -MEM_CGROUP_TARGET_THRESH ))) { -bool do_softlimit, do_numainfo; + flags =mem_cgroup_event_ratelimit (memcg,MEM_CGROUP_TARGET_THRESH ); - do_softlimit =mem_cgroup_event_ratelimit (memcg, +/* +* Threshold event is triggered in finer grain than soft limit +* and numainfo +*/ +if (unlikely (flags)) { + flags |=mem_cgroup_event_ratelimit (memcg,MEM_CGROUP_TARGET_SOFTLIMIT );#if MAX_NUMNODES >1 - do_numainfo =mem_cgroup_event_ratelimit (memcg, + flags |=mem_cgroup_event_ratelimit (memcg,MEM_CGROUP_TARGET_NUMAINFO );#endif -preempt_enable (); + } +preempt_enable (); +if (unlikely (flags)) {mem_cgroup_threshold (memcg); -if (unlikely (do_softlimit)) +if (unlikely (flags &MEM_CGROUP_TARGET_SOFTLIMIT ))mem_cgroup_update_tree (memcg, page);#if MAX_NUMNODES >1 -if (unlikely (do_numainfo)) +if (unlikely (flags &MEM_CGROUP_TARGET_NUMAINFO ))atomic_inc (&memcg->numainfo_events);#endif - }else -preempt_enable (); + } }struct mem_cgroup *mem_cgroup_from_cont (struct cgroup *cont)Signature · 1 line
1.7.7.3
Signature · 6 lines
Michal Hocko SUSE Labs SUSE LINUX s.r.o. Lihovarska 1060/12 190 00 Praha 9 Czech Republic
Re: [PATCH] Makefiles: Disable unused-variable warning (was: Re: [PATCH 1/6] memcg: fix unused variable warning)
Quoted 45 lines · Michal Hocko
Quoted 44 lines · Kirill A. Shutemov
Quoted 22 lines · Michal Hocko
Quoted 21 lines · Kirill A. Shutemov
From: "Kirill A. Shutemov" <[email protected]>
mm/memcontrol.c: In function ‘memcg_check_events’:mm/memcontrol.c:784:22: warning: unused variable ‘do_numainfo’ [-Wunused-variable]Signed-off-by Kirill A. Shutemov <[email protected]>--- mm/memcontrol.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-)mm/memcontrol.c +1
-1@@ -781,14 +781,15 @@ static void memcg_check_events(struct mem_cgroup *memcg, struct page *page)/* threshold event is triggered in finer grain than soft limit */ if (unlikely (mem_cgroup_event_ratelimit (memcg,MEM_CGROUP_TARGET_THRESH ))) { -bool do_softlimit, do_numainfo; +bool do_softlimit;Quoted 13 lines
mm/memcontrol.c static void memcg_check_events(struct mem_cgroup *memcg, struct page *page) · line 792
Quoted 9 lines
mm/memcontrol.c +3
-2- do_softlimit =mem_cgroup_event_ratelimit (memcg, -MEM_CGROUP_TARGET_SOFTLIMIT );#if MAX_NUMNODES >1 +bool do_numainfo; do_numainfo =mem_cgroup_event_ratelimit (memcg,MEM_CGROUP_TARGET_NUMAINFO );#endif + do_softlimit =mem_cgroup_event_ratelimit (memcg, +MEM_CGROUP_TARGET_SOFTLIMIT );I don't like this very much. Maybe we should get rid of both do_* and do it with flags? But maybe it is not worth the additional code at all...
Something like this (untested):
====
Fromf57e1a2e1aaaa167c75b963d5bf12fcbdd3331b8Mon Sep 17 00:00:00 2001
From: "Kirill A. Shutemov" <[email protected]>
Date: Tue, 27 Dec 2011 20:17:13 +0200
Subject: [PATCH] memcg: cleanupmemcg_check_events()
Quoted 4 lines
Quoted 1 line
Signed-off-by Kirill A. Shutemov <[email protected]>The patch looks correct but I am still not sure this is worth fixing in the code rather than disabling Wunused-variable.
Does it look better then original code from your POV?
It's a bit cleaner, I think.
Quoted 103 lines
Quoted 95 lines
--- mm/memcontrol.c | 42 ++++++++++++++++++++++++------------------ 1 files changed, 24 insertions(+), 18 deletions(-)mm/memcontrol.c +24
-18@@ -108,11 +108,12 @@ enum mem_cgroup_events_index {* than using jiffies etc. to handle periodic memcg event. */ enum mem_cgroup_events_target { -MEM_CGROUP_TARGET_THRESH , -MEM_CGROUP_TARGET_SOFTLIMIT , -MEM_CGROUP_TARGET_NUMAINFO , -MEM_CGROUP_NTARGETS , +MEM_CGROUP_TARGET_THRESH =BIT (1 ), +MEM_CGROUP_TARGET_SOFTLIMIT =BIT (2 ), +MEM_CGROUP_TARGET_NUMAINFO =BIT (3 ), }; +#define MEM_CGROUP_NTARGETS 3 +#define THRESHOLDS_EVENTS_TARGET (128)#define SOFTLIMIT_EVENTS_TARGET (1024)#define NUMAINFO_EVENTS_TARGET (1024)@@ -743,7 +744,7 @@ static unsigned long mem_cgroup_nr_lru_pages(struct mem_cgroup *memcg,return total; } -static bool mem_cgroup_event_ratelimit (struct mem_cgroup *memcg, +static int mem_cgroup_event_ratelimit (struct mem_cgroup *memcg,enum mem_cgroup_events_target target) {unsigned long val, next;@@ -766,9 +767,9 @@ static bool mem_cgroup_event_ratelimit(struct mem_cgroup *memcg,break ; }__this_cpu_write (memcg->stat->targets[target], next); -return true; +return target; } -return false; +return 0 ; }/* @@ -777,29 +778,34 @@ static bool mem_cgroup_event_ratelimit(struct mem_cgroup *memcg,*/ static void memcg_check_events (struct mem_cgroup *memcg,struct page *page) { +int flags; +preempt_disable (); -/* threshold event is triggered in finer grain than soft limit */ -if (unlikely (mem_cgroup_event_ratelimit (memcg, -MEM_CGROUP_TARGET_THRESH ))) { -bool do_softlimit, do_numainfo; + flags =mem_cgroup_event_ratelimit (memcg,MEM_CGROUP_TARGET_THRESH ); - do_softlimit =mem_cgroup_event_ratelimit (memcg, +/* +* Threshold event is triggered in finer grain than soft limit +* and numainfo +*/ +if (unlikely (flags)) { + flags |=mem_cgroup_event_ratelimit (memcg,MEM_CGROUP_TARGET_SOFTLIMIT );#if MAX_NUMNODES >1 - do_numainfo =mem_cgroup_event_ratelimit (memcg, + flags |=mem_cgroup_event_ratelimit (memcg,MEM_CGROUP_TARGET_NUMAINFO );#endif -preempt_enable (); + } +preempt_enable (); +if (unlikely (flags)) {mem_cgroup_threshold (memcg); -if (unlikely (do_softlimit)) +if (unlikely (flags &MEM_CGROUP_TARGET_SOFTLIMIT ))mem_cgroup_update_tree (memcg, page);#if MAX_NUMNODES >1 -if (unlikely (do_numainfo)) +if (unlikely (flags &MEM_CGROUP_TARGET_NUMAINFO ))atomic_inc (&memcg->numainfo_events);#endif - }else -preempt_enable (); + } }struct mem_cgroup *mem_cgroup_from_cont (struct cgroup *cont)Signature · 1 line
1.7.7.3Signature · 6 lines
Michal Hocko SUSE Labs SUSE LINUX s.r.o. Lihovarska 1060/12 190 00 Praha 9 Czech Republic
Signature · 5 lines
Kirill A. Shutemov -- To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] Makefiles: Disable unused-variable warning (was: Re: [PATCH 1/6] memcg: fix unused variable warning)
Quoted 46 lines · Kirill A. Shutemov
Quoted 45 lines · Michal Hocko
Quoted 44 lines · Kirill A. Shutemov
Quoted 22 lines · Michal Hocko
Quoted 21 lines · Kirill A. Shutemov
From: "Kirill A. Shutemov" <[email protected]>
mm/memcontrol.c: In function ‘memcg_check_events’:mm/memcontrol.c:784:22: warning: unused variable ‘do_numainfo’ [-Wunused-variable]Signed-off-by Kirill A. Shutemov <[email protected]>--- mm/memcontrol.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-)mm/memcontrol.c +1
-1@@ -781,14 +781,15 @@ static void memcg_check_events(struct mem_cgroup *memcg, struct page *page)/* threshold event is triggered in finer grain than soft limit */ if (unlikely (mem_cgroup_event_ratelimit (memcg,MEM_CGROUP_TARGET_THRESH ))) { -bool do_softlimit, do_numainfo; +bool do_softlimit;Quoted 13 lines
mm/memcontrol.c static void memcg_check_events(struct mem_cgroup *memcg, struct page *page) · line 792
Quoted 9 lines
mm/memcontrol.c +3
-2- do_softlimit =mem_cgroup_event_ratelimit (memcg, -MEM_CGROUP_TARGET_SOFTLIMIT );#if MAX_NUMNODES >1 +bool do_numainfo; do_numainfo =mem_cgroup_event_ratelimit (memcg,MEM_CGROUP_TARGET_NUMAINFO );#endif + do_softlimit =mem_cgroup_event_ratelimit (memcg, +MEM_CGROUP_TARGET_SOFTLIMIT );I don't like this very much. Maybe we should get rid of both do_* and do it with flags? But maybe it is not worth the additional code at all...
Something like this (untested):
====
Fromf57e1a2e1aaaa167c75b963d5bf12fcbdd3331b8Mon Sep 17 00:00:00 2001
From: "Kirill A. Shutemov" <[email protected]>
Date: Tue, 27 Dec 2011 20:17:13 +0200
Subject: [PATCH] memcg: cleanupmemcg_check_events()
Quoted 8 lines
Quoted 4 lines
Quoted 1 line
Signed-off-by Kirill A. Shutemov <[email protected]>The patch looks correct but I am still not sure this is worth fixing in the code rather than disabling Wunused-variable.
Does it look better then original code from your POV?
It's a bit cleaner, I think.
Yes it is less hakish than the previous one which relied on having #ifdef block before any other code in the block.
Quoted 111 lines
Quoted 104 lines
Quoted 96 lines
--- mm/memcontrol.c | 42 ++++++++++++++++++++++++------------------ 1 files changed, 24 insertions(+), 18 deletions(-)mm/memcontrol.c +24
-18@@ -108,11 +108,12 @@ enum mem_cgroup_events_index {* than using jiffies etc. to handle periodic memcg event. */ enum mem_cgroup_events_target { -MEM_CGROUP_TARGET_THRESH , -MEM_CGROUP_TARGET_SOFTLIMIT , -MEM_CGROUP_TARGET_NUMAINFO , -MEM_CGROUP_NTARGETS , +MEM_CGROUP_TARGET_THRESH =BIT (1 ), +MEM_CGROUP_TARGET_SOFTLIMIT =BIT (2 ), +MEM_CGROUP_TARGET_NUMAINFO =BIT (3 ), }; +#define MEM_CGROUP_NTARGETS 3 +#define THRESHOLDS_EVENTS_TARGET (128)#define SOFTLIMIT_EVENTS_TARGET (1024)#define NUMAINFO_EVENTS_TARGET (1024)@@ -743,7 +744,7 @@ static unsigned long mem_cgroup_nr_lru_pages(struct mem_cgroup *memcg,return total; } -static bool mem_cgroup_event_ratelimit (struct mem_cgroup *memcg, +static int mem_cgroup_event_ratelimit (struct mem_cgroup *memcg,enum mem_cgroup_events_target target) {unsigned long val, next;@@ -766,9 +767,9 @@ static bool mem_cgroup_event_ratelimit(struct mem_cgroup *memcg,break ; }__this_cpu_write (memcg->stat->targets[target], next); -return true; +return target; } -return false; +return 0 ; }/* @@ -777,29 +778,34 @@ static bool mem_cgroup_event_ratelimit(struct mem_cgroup *memcg,*/ static void memcg_check_events (struct mem_cgroup *memcg,struct page *page) { +int flags; +preempt_disable (); -/* threshold event is triggered in finer grain than soft limit */ -if (unlikely (mem_cgroup_event_ratelimit (memcg, -MEM_CGROUP_TARGET_THRESH ))) { -bool do_softlimit, do_numainfo; + flags =mem_cgroup_event_ratelimit (memcg,MEM_CGROUP_TARGET_THRESH ); - do_softlimit =mem_cgroup_event_ratelimit (memcg, +/* +* Threshold event is triggered in finer grain than soft limit +* and numainfo +*/ +if (unlikely (flags)) { + flags |=mem_cgroup_event_ratelimit (memcg,MEM_CGROUP_TARGET_SOFTLIMIT );#if MAX_NUMNODES >1 - do_numainfo =mem_cgroup_event_ratelimit (memcg, + flags |=mem_cgroup_event_ratelimit (memcg,MEM_CGROUP_TARGET_NUMAINFO );#endif -preempt_enable (); + } +preempt_enable (); +if (unlikely (flags)) {mem_cgroup_threshold (memcg); -if (unlikely (do_softlimit)) +if (unlikely (flags &MEM_CGROUP_TARGET_SOFTLIMIT ))mem_cgroup_update_tree (memcg, page);#if MAX_NUMNODES >1 -if (unlikely (do_numainfo)) +if (unlikely (flags &MEM_CGROUP_TARGET_NUMAINFO ))atomic_inc (&memcg->numainfo_events);#endif - }else -preempt_enable (); + } }struct mem_cgroup *mem_cgroup_from_cont (struct cgroup *cont)Signature · 1 line
1.7.7.3Signature · 6 lines
Michal Hocko SUSE Labs SUSE LINUX s.r.o. Lihovarska 1060/12 190 00 Praha 9 Czech RepublicSignature · 5 lines
Kirill A. Shutemov -- 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
A message that is not in the archive (sent off-list or not yet received): [email protected]
Re: [PATCH] Makefiles: Disable unused-variable warning (was: Re: [PATCH 1/6] memcg: fix unused variable warning)
Quoted 46 lines · Kirill A. Shutemov
Quoted 45 lines · Michal Hocko
Quoted 44 lines · Kirill A. Shutemov
Quoted 22 lines · Michal Hocko
Quoted 21 lines · Kirill A. Shutemov
From: "Kirill A. Shutemov" <[email protected]>
mm/memcontrol.c: In function ‘memcg_check_events’:mm/memcontrol.c:784:22: warning: unused variable ‘do_numainfo’ [-Wunused-variable]Signed-off-by Kirill A. Shutemov <[email protected]>--- mm/memcontrol.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-)mm/memcontrol.c +1
-1@@ -781,14 +781,15 @@ static void memcg_check_events(struct mem_cgroup *memcg, struct page *page)/* threshold event is triggered in finer grain than soft limit */ if (unlikely (mem_cgroup_event_ratelimit (memcg,MEM_CGROUP_TARGET_THRESH ))) { -bool do_softlimit, do_numainfo; +bool do_softlimit;Quoted 13 lines
mm/memcontrol.c static void memcg_check_events(struct mem_cgroup *memcg, struct page *page) · line 792
Quoted 9 lines
mm/memcontrol.c +3
-2- do_softlimit =mem_cgroup_event_ratelimit (memcg, -MEM_CGROUP_TARGET_SOFTLIMIT );#if MAX_NUMNODES >1 +bool do_numainfo; do_numainfo =mem_cgroup_event_ratelimit (memcg,MEM_CGROUP_TARGET_NUMAINFO );#endif + do_softlimit =mem_cgroup_event_ratelimit (memcg, +MEM_CGROUP_TARGET_SOFTLIMIT );I don't like this very much. Maybe we should get rid of both do_* and do it with flags? But maybe it is not worth the additional code at all...
Something like this (untested):
====
Fromf57e1a2e1aaaa167c75b963d5bf12fcbdd3331b8Mon Sep 17 00:00:00 2001
From: "Kirill A. Shutemov" <[email protected]>
Date: Tue, 27 Dec 2011 20:17:13 +0200
Subject: [PATCH] memcg: cleanupmemcg_check_events()
Quoted 8 lines
Quoted 4 lines
Quoted 1 line
Signed-off-by Kirill A. Shutemov <[email protected]>The patch looks correct but I am still not sure this is worth fixing in the code rather than disabling Wunused-variable.
Does it look better then original code from your POV?
It's a bit cleaner, I think.
Yes it is less hakish than the previous one which relied on having #ifdef block before any other code in the block.
Quoted 111 lines
Quoted 104 lines
Quoted 96 lines
--- mm/memcontrol.c | 42 ++++++++++++++++++++++++------------------ 1 files changed, 24 insertions(+), 18 deletions(-)mm/memcontrol.c +24
-18@@ -108,11 +108,12 @@ enum mem_cgroup_events_index {* than using jiffies etc. to handle periodic memcg event. */ enum mem_cgroup_events_target { -MEM_CGROUP_TARGET_THRESH , -MEM_CGROUP_TARGET_SOFTLIMIT , -MEM_CGROUP_TARGET_NUMAINFO , -MEM_CGROUP_NTARGETS , +MEM_CGROUP_TARGET_THRESH =BIT (1 ), +MEM_CGROUP_TARGET_SOFTLIMIT =BIT (2 ), +MEM_CGROUP_TARGET_NUMAINFO =BIT (3 ), }; +#define MEM_CGROUP_NTARGETS 3 +#define THRESHOLDS_EVENTS_TARGET (128)#define SOFTLIMIT_EVENTS_TARGET (1024)#define NUMAINFO_EVENTS_TARGET (1024)@@ -743,7 +744,7 @@ static unsigned long mem_cgroup_nr_lru_pages(struct mem_cgroup *memcg,return total; } -static bool mem_cgroup_event_ratelimit (struct mem_cgroup *memcg, +static int mem_cgroup_event_ratelimit (struct mem_cgroup *memcg,enum mem_cgroup_events_target target) {unsigned long val, next;@@ -766,9 +767,9 @@ static bool mem_cgroup_event_ratelimit(struct mem_cgroup *memcg,break ; }__this_cpu_write (memcg->stat->targets[target], next); -return true; +return target; } -return false; +return 0 ; }/* @@ -777,29 +778,34 @@ static bool mem_cgroup_event_ratelimit(struct mem_cgroup *memcg,*/ static void memcg_check_events (struct mem_cgroup *memcg,struct page *page) { +int flags; +preempt_disable (); -/* threshold event is triggered in finer grain than soft limit */ -if (unlikely (mem_cgroup_event_ratelimit (memcg, -MEM_CGROUP_TARGET_THRESH ))) { -bool do_softlimit, do_numainfo; + flags =mem_cgroup_event_ratelimit (memcg,MEM_CGROUP_TARGET_THRESH ); - do_softlimit =mem_cgroup_event_ratelimit (memcg, +/* +* Threshold event is triggered in finer grain than soft limit +* and numainfo +*/ +if (unlikely (flags)) { + flags |=mem_cgroup_event_ratelimit (memcg,MEM_CGROUP_TARGET_SOFTLIMIT );#if MAX_NUMNODES >1 - do_numainfo =mem_cgroup_event_ratelimit (memcg, + flags |=mem_cgroup_event_ratelimit (memcg,MEM_CGROUP_TARGET_NUMAINFO );#endif -preempt_enable (); + } +preempt_enable (); +if (unlikely (flags)) {mem_cgroup_threshold (memcg); -if (unlikely (do_softlimit)) +if (unlikely (flags &MEM_CGROUP_TARGET_SOFTLIMIT ))mem_cgroup_update_tree (memcg, page);#if MAX_NUMNODES >1 -if (unlikely (do_numainfo)) +if (unlikely (flags &MEM_CGROUP_TARGET_NUMAINFO ))atomic_inc (&memcg->numainfo_events);#endif - }else -preempt_enable (); + } }struct mem_cgroup *mem_cgroup_from_cont (struct cgroup *cont)Signature · 1 line
1.7.7.3Signature · 6 lines
Michal Hocko SUSE Labs SUSE LINUX s.r.o. Lihovarska 1060/12 190 00 Praha 9 Czech RepublicSignature · 5 lines
Kirill A. Shutemov -- 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 · 10 lines
Michal Hocko SUSE Labs SUSE LINUX s.r.o. Lihovarska 1060/12 190 00 Praha 9 Czech Republic _______________________________________________ Containers mailing list [email protected] https://lists.linuxfoundation.org/mailman/listinfo/containers
A message that is not in the archive (sent off-list or not yet received): 20111229104230.GA20854-VqjxzfR4DlwKmadIfiO5sKVXKuFTiq87@public.gmane.org
Re: [PATCH] Makefiles: Disable unused-variable warning (was: Re: [PATCH 1/6] memcg: fix unused variable warning)
Quoted 45 lines · Michal Hocko
Quoted 44 lines · Kirill A. Shutemov
Quoted 22 lines · Michal Hocko
Quoted 21 lines · Kirill A. Shutemov
From: "Kirill A. Shutemov" <[email protected]>
mm/memcontrol.c: In function ‘memcg_check_events’:mm/memcontrol.c:784:22: warning: unused variable ‘do_numainfo’ [-Wunused-variable]Signed-off-by Kirill A. Shutemov <[email protected]>--- mm/memcontrol.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-)mm/memcontrol.c +1
-1@@ -781,14 +781,15 @@ static void memcg_check_events(struct mem_cgroup *memcg, struct page *page)/* threshold event is triggered in finer grain than soft limit */ if (unlikely (mem_cgroup_event_ratelimit (memcg,MEM_CGROUP_TARGET_THRESH ))) { -bool do_softlimit, do_numainfo; +bool do_softlimit;Quoted 13 lines
mm/memcontrol.c static void memcg_check_events(struct mem_cgroup *memcg, struct page *page) · line 792
Quoted 9 lines
mm/memcontrol.c +3
-2- do_softlimit =mem_cgroup_event_ratelimit (memcg, -MEM_CGROUP_TARGET_SOFTLIMIT );#if MAX_NUMNODES >1 +bool do_numainfo; do_numainfo =mem_cgroup_event_ratelimit (memcg,MEM_CGROUP_TARGET_NUMAINFO );#endif + do_softlimit =mem_cgroup_event_ratelimit (memcg, +MEM_CGROUP_TARGET_SOFTLIMIT );I don't like this very much. Maybe we should get rid of both do_* and do it with flags? But maybe it is not worth the additional code at all...
Something like this (untested):
====
Fromf57e1a2e1aaaa167c75b963d5bf12fcbdd3331b8Mon Sep 17 00:00:00 2001
From: "Kirill A. Shutemov" <[email protected]>
Date: Tue, 27 Dec 2011 20:17:13 +0200
Subject: [PATCH] memcg: cleanupmemcg_check_events()
Quoted 4 lines
Quoted 1 line
Signed-off-by Kirill A. Shutemov <[email protected]>The patch looks correct but I am still not sure this is worth fixing in the code rather than disabling Wunused-variable.
Does it look better then original code from your POV?
It's a bit cleaner, I think.
Quoted 103 lines
Quoted 95 lines
--- mm/memcontrol.c | 42 ++++++++++++++++++++++++------------------ 1 files changed, 24 insertions(+), 18 deletions(-)mm/memcontrol.c +24
-18@@ -108,11 +108,12 @@ enum mem_cgroup_events_index {* than using jiffies etc. to handle periodic memcg event. */ enum mem_cgroup_events_target { -MEM_CGROUP_TARGET_THRESH , -MEM_CGROUP_TARGET_SOFTLIMIT , -MEM_CGROUP_TARGET_NUMAINFO , -MEM_CGROUP_NTARGETS , +MEM_CGROUP_TARGET_THRESH =BIT (1 ), +MEM_CGROUP_TARGET_SOFTLIMIT =BIT (2 ), +MEM_CGROUP_TARGET_NUMAINFO =BIT (3 ), }; +#define MEM_CGROUP_NTARGETS 3 +#define THRESHOLDS_EVENTS_TARGET (128)#define SOFTLIMIT_EVENTS_TARGET (1024)#define NUMAINFO_EVENTS_TARGET (1024)@@ -743,7 +744,7 @@ static unsigned long mem_cgroup_nr_lru_pages(struct mem_cgroup *memcg,return total; } -static bool mem_cgroup_event_ratelimit (struct mem_cgroup *memcg, +static int mem_cgroup_event_ratelimit (struct mem_cgroup *memcg,enum mem_cgroup_events_target target) {unsigned long val, next;@@ -766,9 +767,9 @@ static bool mem_cgroup_event_ratelimit(struct mem_cgroup *memcg,break ; }__this_cpu_write (memcg->stat->targets[target], next); -return true; +return target; } -return false; +return 0 ; }/* @@ -777,29 +778,34 @@ static bool mem_cgroup_event_ratelimit(struct mem_cgroup *memcg,*/ static void memcg_check_events (struct mem_cgroup *memcg,struct page *page) { +int flags; +preempt_disable (); -/* threshold event is triggered in finer grain than soft limit */ -if (unlikely (mem_cgroup_event_ratelimit (memcg, -MEM_CGROUP_TARGET_THRESH ))) { -bool do_softlimit, do_numainfo; + flags =mem_cgroup_event_ratelimit (memcg,MEM_CGROUP_TARGET_THRESH ); - do_softlimit =mem_cgroup_event_ratelimit (memcg, +/* +* Threshold event is triggered in finer grain than soft limit +* and numainfo +*/ +if (unlikely (flags)) { + flags |=mem_cgroup_event_ratelimit (memcg,MEM_CGROUP_TARGET_SOFTLIMIT );#if MAX_NUMNODES >1 - do_numainfo =mem_cgroup_event_ratelimit (memcg, + flags |=mem_cgroup_event_ratelimit (memcg,MEM_CGROUP_TARGET_NUMAINFO );#endif -preempt_enable (); + } +preempt_enable (); +if (unlikely (flags)) {mem_cgroup_threshold (memcg); -if (unlikely (do_softlimit)) +if (unlikely (flags &MEM_CGROUP_TARGET_SOFTLIMIT ))mem_cgroup_update_tree (memcg, page);#if MAX_NUMNODES >1 -if (unlikely (do_numainfo)) +if (unlikely (flags &MEM_CGROUP_TARGET_NUMAINFO ))atomic_inc (&memcg->numainfo_events);#endif - }else -preempt_enable (); + } }struct mem_cgroup *mem_cgroup_from_cont (struct cgroup *cont)Signature · 1 line
1.7.7.3Signature · 6 lines
Michal Hocko SUSE Labs SUSE LINUX s.r.o. Lihovarska 1060/12 190 00 Praha 9 Czech Republic
Signature · 5 lines
Kirill A. Shutemov _______________________________________________ Containers mailing list [email protected] https://lists.linuxfoundation.org/mailman/listinfo/containers
A message that is not in the archive (sent off-list or not yet received): [email protected]
Re: [PATCH] Makefiles: Disable unused-variable warning (was: Re: [PATCH 1/6] memcg: fix unused variable warning)
Quoted 37 lines · Kirill A. Shutemov
Quoted 22 lines · Michal Hocko
Quoted 21 lines · Kirill A. Shutemov
From: "Kirill A. Shutemov" <[email protected]>
mm/memcontrol.c: In function ‘memcg_check_events’:mm/memcontrol.c:784:22: warning: unused variable ‘do_numainfo’ [-Wunused-variable]Signed-off-by Kirill A. Shutemov <[email protected]>--- mm/memcontrol.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-)mm/memcontrol.c +1
-1@@ -781,14 +781,15 @@ static void memcg_check_events(struct mem_cgroup *memcg, struct page *page)/* threshold event is triggered in finer grain than soft limit */ if (unlikely (mem_cgroup_event_ratelimit (memcg,MEM_CGROUP_TARGET_THRESH ))) { -bool do_softlimit, do_numainfo; +bool do_softlimit;Quoted 13 lines
mm/memcontrol.c static void memcg_check_events(struct mem_cgroup *memcg, struct page *page) · line 792
Quoted 9 lines
mm/memcontrol.c +3
-2- do_softlimit =mem_cgroup_event_ratelimit (memcg, -MEM_CGROUP_TARGET_SOFTLIMIT );#if MAX_NUMNODES >1 +bool do_numainfo; do_numainfo =mem_cgroup_event_ratelimit (memcg,MEM_CGROUP_TARGET_NUMAINFO );#endif + do_softlimit =mem_cgroup_event_ratelimit (memcg, +MEM_CGROUP_TARGET_SOFTLIMIT );I don't like this very much. Maybe we should get rid of both do_* and do it with flags? But maybe it is not worth the additional code at all...
Quoted 8 lines
Something like this (untested):
====
Fromf57e1a2e1aaaa167c75b963d5bf12fcbdd3331b8Mon Sep 17 00:00:00 2001
From: "Kirill A. Shutemov" <[email protected]>
Date: Tue, 27 Dec 2011 20:17:13 +0200
Subject: [PATCH] memcg: cleanupmemcg_check_events()Signed-off-by Kirill A. Shutemov <[email protected]>
The patch looks correct but I am still not sure this is worth fixing in the code rather than disabling Wunused-variable.
Quoted 94 lines
--- mm/memcontrol.c | 42 ++++++++++++++++++++++++------------------ 1 files changed, 24 insertions(+), 18 deletions(-)mm/memcontrol.c +24
-18@@ -108,11 +108,12 @@ enum mem_cgroup_events_index {* than using jiffies etc. to handle periodic memcg event. */ enum mem_cgroup_events_target { -MEM_CGROUP_TARGET_THRESH , -MEM_CGROUP_TARGET_SOFTLIMIT , -MEM_CGROUP_TARGET_NUMAINFO , -MEM_CGROUP_NTARGETS , +MEM_CGROUP_TARGET_THRESH =BIT (1 ), +MEM_CGROUP_TARGET_SOFTLIMIT =BIT (2 ), +MEM_CGROUP_TARGET_NUMAINFO =BIT (3 ), }; +#define MEM_CGROUP_NTARGETS 3 +#define THRESHOLDS_EVENTS_TARGET (128)#define SOFTLIMIT_EVENTS_TARGET (1024)#define NUMAINFO_EVENTS_TARGET (1024)@@ -743,7 +744,7 @@ static unsigned long mem_cgroup_nr_lru_pages(struct mem_cgroup *memcg,return total; } -static bool mem_cgroup_event_ratelimit (struct mem_cgroup *memcg, +static int mem_cgroup_event_ratelimit (struct mem_cgroup *memcg,enum mem_cgroup_events_target target) {unsigned long val, next;@@ -766,9 +767,9 @@ static bool mem_cgroup_event_ratelimit(struct mem_cgroup *memcg,break ; }__this_cpu_write (memcg->stat->targets[target], next); -return true; +return target; } -return false; +return 0 ; }/* @@ -777,29 +778,34 @@ static bool mem_cgroup_event_ratelimit(struct mem_cgroup *memcg,*/ static void memcg_check_events (struct mem_cgroup *memcg,struct page *page) { +int flags; +preempt_disable (); -/* threshold event is triggered in finer grain than soft limit */ -if (unlikely (mem_cgroup_event_ratelimit (memcg, -MEM_CGROUP_TARGET_THRESH ))) { -bool do_softlimit, do_numainfo; + flags =mem_cgroup_event_ratelimit (memcg,MEM_CGROUP_TARGET_THRESH ); - do_softlimit =mem_cgroup_event_ratelimit (memcg, +/* +* Threshold event is triggered in finer grain than soft limit +* and numainfo +*/ +if (unlikely (flags)) { + flags |=mem_cgroup_event_ratelimit (memcg,MEM_CGROUP_TARGET_SOFTLIMIT );#if MAX_NUMNODES >1 - do_numainfo =mem_cgroup_event_ratelimit (memcg, + flags |=mem_cgroup_event_ratelimit (memcg,MEM_CGROUP_TARGET_NUMAINFO );#endif -preempt_enable (); + } +preempt_enable (); +if (unlikely (flags)) {mem_cgroup_threshold (memcg); -if (unlikely (do_softlimit)) +if (unlikely (flags &MEM_CGROUP_TARGET_SOFTLIMIT ))mem_cgroup_update_tree (memcg, page);#if MAX_NUMNODES >1 -if (unlikely (do_numainfo)) +if (unlikely (flags &MEM_CGROUP_TARGET_NUMAINFO ))atomic_inc (&memcg->numainfo_events);#endif - }else -preempt_enable (); + } }struct mem_cgroup *mem_cgroup_from_cont (struct cgroup *cont)Signature · 1 line
1.7.7.3
Signature · 10 lines
Michal Hocko SUSE Labs SUSE LINUX s.r.o. Lihovarska 1060/12 190 00 Praha 9 Czech Republic _______________________________________________ Containers mailing list [email protected] https://lists.linuxfoundation.org/mailman/listinfo/containers
A message that is not in the archive (sent off-list or not yet received): 20111227135752.GK5344-VqjxzfR4DlwKmadIfiO5sKVXKuFTiq87@public.gmane.org
Re: [PATCH] Makefiles: Disable unused-variable warning (was: Re: [PATCH 1/6] memcg: fix unused variable warning)
Quoted 22 lines · Michal Hocko
Quoted 21 lines · Kirill A. Shutemov
From: "Kirill A. Shutemov" <[email protected]>
mm/memcontrol.c: In function ‘memcg_check_events’:mm/memcontrol.c:784:22: warning: unused variable ‘do_numainfo’ [-Wunused-variable]Signed-off-by Kirill A. Shutemov <[email protected]>--- mm/memcontrol.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-)mm/memcontrol.c +1
-1@@ -781,14 +781,15 @@ static void memcg_check_events(struct mem_cgroup *memcg, struct page *page)/* threshold event is triggered in finer grain than soft limit */ if (unlikely (mem_cgroup_event_ratelimit (memcg,MEM_CGROUP_TARGET_THRESH ))) { -bool do_softlimit, do_numainfo; +bool do_softlimit;
Quoted 13 lines
mm/memcontrol.c static void memcg_check_events(struct mem_cgroup *memcg, struct page *page) · line 792
Quoted 9 lines
mm/memcontrol.c +3
-2- do_softlimit =mem_cgroup_event_ratelimit (memcg, -MEM_CGROUP_TARGET_SOFTLIMIT );#if MAX_NUMNODES >1 +bool do_numainfo; do_numainfo =mem_cgroup_event_ratelimit (memcg,MEM_CGROUP_TARGET_NUMAINFO );#endif + do_softlimit =mem_cgroup_event_ratelimit (memcg, +MEM_CGROUP_TARGET_SOFTLIMIT );I don't like this very much. Maybe we should get rid of both do_* and do it with flags? But maybe it is not worth the additional code at all...
Something like this (untested):
====
From f57e1a2e1aaaa167c75b963d5bf12fcbdd3331b8 Mon Sep 17 00:00:00 2001
From: "Kirill A. Shutemov" <[email protected]>
Date: Tue, 27 Dec 2011 20:17:13 +0200
Subject: [PATCH] memcg: cleanup memcg_check_events()
--- mm/memcontrol.c | 42 ++++++++++++++++++++++++------------------ 1 files changed, 24 insertions(+), 18 deletions(-)
mm/memcontrol.c +24 -18
@@ -108,11 +108,12 @@ enum mem_cgroup_events_index {* than using jiffies etc. to handle periodic memcg event. */ enum mem_cgroup_events_target { -MEM_CGROUP_TARGET_THRESH , -MEM_CGROUP_TARGET_SOFTLIMIT , -MEM_CGROUP_TARGET_NUMAINFO , -MEM_CGROUP_NTARGETS , +MEM_CGROUP_TARGET_THRESH =BIT (1 ), +MEM_CGROUP_TARGET_SOFTLIMIT =BIT (2 ), +MEM_CGROUP_TARGET_NUMAINFO =BIT (3 ), }; +#define MEM_CGROUP_NTARGETS 3 +#define THRESHOLDS_EVENTS_TARGET (128)#define SOFTLIMIT_EVENTS_TARGET (1024)#define NUMAINFO_EVENTS_TARGET (1024)
@@ -743,7 +744,7 @@ static unsigned long mem_cgroup_nr_lru_pages(struct mem_cgroup *memcg,return total; } -static bool mem_cgroup_event_ratelimit (struct mem_cgroup *memcg, +static int mem_cgroup_event_ratelimit (struct mem_cgroup *memcg,enum mem_cgroup_events_target target) {unsigned long val, next;
@@ -766,9 +767,9 @@ static bool mem_cgroup_event_ratelimit(struct mem_cgroup *memcg,break ; }__this_cpu_write (memcg->stat->targets[target], next); -return true; +return target; } -return false; +return 0 ; }/*
@@ -777,29 +778,34 @@ static bool mem_cgroup_event_ratelimit(struct mem_cgroup *memcg,*/ static void memcg_check_events (struct mem_cgroup *memcg,struct page *page) { +int flags; +preempt_disable (); -/* threshold event is triggered in finer grain than soft limit */ -if (unlikely (mem_cgroup_event_ratelimit (memcg, -MEM_CGROUP_TARGET_THRESH ))) { -bool do_softlimit, do_numainfo; + flags =mem_cgroup_event_ratelimit (memcg,MEM_CGROUP_TARGET_THRESH ); - do_softlimit =mem_cgroup_event_ratelimit (memcg, +/* +* Threshold event is triggered in finer grain than soft limit +* and numainfo +*/ +if (unlikely (flags)) { + flags |=mem_cgroup_event_ratelimit (memcg,MEM_CGROUP_TARGET_SOFTLIMIT );#if MAX_NUMNODES >1 - do_numainfo =mem_cgroup_event_ratelimit (memcg, + flags |=mem_cgroup_event_ratelimit (memcg,MEM_CGROUP_TARGET_NUMAINFO );#endif -preempt_enable (); + } +preempt_enable (); +if (unlikely (flags)) {mem_cgroup_threshold (memcg); -if (unlikely (do_softlimit)) +if (unlikely (flags &MEM_CGROUP_TARGET_SOFTLIMIT ))mem_cgroup_update_tree (memcg, page);#if MAX_NUMNODES >1 -if (unlikely (do_numainfo)) +if (unlikely (flags &MEM_CGROUP_TARGET_NUMAINFO ))atomic_inc (&memcg->numainfo_events);#endif - }else -preempt_enable (); + } }struct mem_cgroup *mem_cgroup_from_cont (struct cgroup *cont)
Signature · 8 lines
1.7.7.3 -- Kirill A. Shutemov _______________________________________________ Containers mailing list [email protected] https://lists.linuxfoundation.org/mailman/listinfo/containers
Re: [PATCH] Makefiles: Disable unused-variable warning
In reply to a message not in the archiveDne 27.12.2011 14:57, Michal Hocko napsal(a):
Quoted 2 lines
Anyway, I am wondering why unused-but-set-variable is disabled while unused-variable is enabled.
unused-but-set-variable was disabled, because it was a new warning in gcc 4.6 and produced too much noise relatively to its severity. A make W=1 build of x86_64_defconfig gives:
$ grep -c 'Wunused-but-set-variable' log 77 $ grep -c 'Wunused-variable' log 0
More exotic configuration will probably result in a couple of unused variable warnings, but that IMO no reason to disable them globally.
Quoted 3 lines
Shouldn't we just disable it as well rather
than workaround this in the code? The warning is just pure noise in this case.
If it's noise in a particular case, there is always the option to add
CFLAGS_memcontrol.o := $(call cc-disable-warning, unused-variable)
to the respective Makefile.
Michal
Re: [PATCH] Makefiles: Disable unused-variable warning
In reply to Michal HockoDne 27.12.2011 14:57, Michal Hocko napsal(a):
Quoted 2 lines
Anyway, I am wondering why unused-but-set-variable is disabled while unused-variable is enabled.
unused-but-set-variable was disabled, because it was a new warning in gcc 4.6 and produced too much noise relatively to its severity. A make W=1 build of x86_64_defconfig gives:
$ grep -c 'Wunused-but-set-variable' log 77 $ grep -c 'Wunused-variable' log 0
More exotic configuration will probably result in a couple of unused variable warnings, but that IMO no reason to disable them globally.
Quoted 3 lines
Shouldn't we just disable it as well rather
than workaround this in the code? The warning is just pure noise in this case.
If it's noise in a particular case, there is always the option to add
CFLAGS_memcontrol.o := $(call cc-disable-warning, unused-variable)
to the respective Makefile.
Michal
Re: [PATCH] Makefiles: Disable unused-variable warning
Quoted 7 lines · Michal Marek
Dne 27.12.2011 14:57, Michal Hocko napsal(a):
Quoted 2 lines
Anyway, I am wondering why unused-but-set-variable is disabled while unused-variable is enabled.
unused-but-set-variable was disabled, because it was a new warning in gcc 4.6 and produced too much noise relatively to its severity. A make W=1 build of
x86_64_defconfiggives:
Quoted 7 lines
$ grep -c 'Wunused-but-set-variable' log 77 $ grep -c 'Wunused-variable' log 0More exotic configuration will probably result in a couple of unused variable warnings, but that IMO no reason to disable them globally.
OK.
Quoted 7 lines
Quoted 3 lines
Shouldn't we just disable it as well rather
than workaround this in the code? The warning is just pure noise in this case.If it's noise in a particular case, there is always the option to add
CFLAGS_memcontrol.o := $(call cc-disable-warning, unused-variable)
I would like to prevent from local cflags hacks. Moreover the code will go away so I guess it doesn't make much sense to play tricks here.
Quoted 4 lines
to the respective
Makefile.Michal
Thanks
Signature · 13 lines
Michal Hocko SUSE Labs SUSE LINUX s.r.o. Lihovarska 1060/12 190 00 Praha 9 Czech Republic -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
A message that is not in the archive (sent off-list or not yet received): [email protected]
Re: [PATCH] Makefiles: Disable unused-variable warning
Quoted 7 lines · Michal Marek
Dne 27.12.2011 14:57, Michal Hocko napsal(a):
Quoted 2 lines
Anyway, I am wondering why unused-but-set-variable is disabled while unused-variable is enabled.
unused-but-set-variable was disabled, because it was a new warning in gcc 4.6 and produced too much noise relatively to its severity. A make W=1 build of
x86_64_defconfiggives:
Quoted 7 lines
$ grep -c 'Wunused-but-set-variable' log 77 $ grep -c 'Wunused-variable' log 0More exotic configuration will probably result in a couple of unused variable warnings, but that IMO no reason to disable them globally.
OK.
Quoted 7 lines
Quoted 3 lines
Shouldn't we just disable it as well rather
than workaround this in the code? The warning is just pure noise in this case.If it's noise in a particular case, there is always the option to add
CFLAGS_memcontrol.o := $(call cc-disable-warning, unused-variable)
I would like to prevent from local cflags hacks. Moreover the code will go away so I guess it doesn't make much sense to play tricks here.
Quoted 4 lines
to the respective
Makefile.Michal
Thanks
Signature · 6 lines
Michal Hocko SUSE Labs SUSE LINUX s.r.o. Lihovarska 1060/12 190 00 Praha 9 Czech Republic