All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@suse.cz>
To: Igor Mammedov <imammedo@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	Hiroyuki Kamezawa <kamezawa.hiroyuki@gmail.com>,
	linux-kernel@vger.kernel.org, balbir@linux.vnet.ibm.com,
	linux-mm@kvack.org, Paul Menage <menage@google.com>,
	Li Zefan <lizf@cn.fujitsu.com>,
	containers@lists.linux-foundation.org,
	Tim Deegan <Tim.Deegan@citrix.com>
Subject: Re: [PATCH] memcg: do not expose uninitialized mem_cgroup_per_node to world
Date: Wed, 27 Jul 2011 11:57:47 +0200	[thread overview]
Message-ID: <20110727095747.GA6430@tiehlicka.suse.cz> (raw)
In-Reply-To: <4E2FDAA0.5020702@redhat.com>

On Wed 27-07-11 11:30:08, Igor Mammedov wrote:
> On 07/27/2011 09:58 AM, Michal Hocko wrote:
> >On Tue 26-07-11 14:17:54, Andrew Morton wrote:
> >>On Fri, 10 Jun 2011 18:57:40 +0200
> >>Igor Mammedov<imammedo@redhat.com>  wrote:
> >>
> >>>On 06/08/2011 11:09 PM, Andrew Morton wrote:
> >>>>The original patch:
> >>>>
> >>>>--- a/mm/memcontrol.c
> >>>>+++ b/mm/memcontrol.c
> >>>>@@ -4707,7 +4707,6 @@ static int alloc_mem_cgroup_per_zone_info(struct mem_cgroup *mem, int node)
> >>>>   	if (!pn)
> >>>>   		return 1;
> >>>>
> >>>>-	mem->info.nodeinfo[node] = pn;
> >>>>   	for (zone = 0; zone<   MAX_NR_ZONES; zone++) {
> >>>>   		mz =&pn->zoneinfo[zone];
> >>>>   		for_each_lru(l)
> >>>>@@ -4716,6 +4715,7 @@ static int alloc_mem_cgroup_per_zone_info(struct mem_cgroup *mem, int node)
> >>>>   		mz->on_tree = false;
> >>>>   		mz->mem = mem;
> >>>>   	}
> >>>>+	mem->info.nodeinfo[node] = pn;
> >>>>   	return 0;
> >>>>   }
> >>>>
> >>>>looks like a really good idea.  But it needs a new changelog and I'd be
> >>>>a bit reluctant to merge it as it appears that the aptch removes our
> >>>>only known way of reproducing a bug.
> >>>>
> >>>>So for now I think I'll queue the patch up unchangelogged so the issue
> >>>>doesn't get forgotten about.
> >>>>
> >>>Problem was in rhel's xen hv.
> >>>It was missing fix for imul emulation.
> >>>Details here
> >>>http://lists.xensource.com/archives/html/xen-devel/2011-06/msg00801.html
> >>>Thanks to Tim Deegan and everyone who was involved in the discussion.
> >>
> >>I really don't want to trawl through a lengthy xen bug report
> >
> >The bug turned out to be Xen specific and this patch just hidden the bug
> >in Xen.
> 
> The problem was in incorrect imul instruction emulation in xen and as
> consequence incorrect attempt to initialize list at invalid memory location.
> 
> >
> >>and write your changelog for you.
> >>
> >>We still have no changelog for this patch.  Please send one.
> >
> >Appart from a better programming style is there any other reason for
> >taking it?  If applied it might hide potential bugs when somebody is
> >touching data too early.
> >
> 
> If it ever happens and somebody is touching data too early, it would be
> a bit easier to diagnose a problem when dereferencing NULL at
> mem->info.nodeinfo[node] than wondering at partly initialized
> mem_cgroup_per_zone. 

Bahh, I have mixed zero initialized with NULL that would blow up. You
are right of course, sorry for confusion.

> Aside from that it is purely cosmetic change.
> 
> Here is proposed change log:
> 
> Subject: Cleanup: memcg: Expose only initialized mem_cgroup_per_node to world
> 
> If somebody is touching data too early, it might be easier to diagnose
> a problem when dereferencing NULL at mem->info.nodeinfo[node] than
> trying to understand why mem_cgroup_per_zone is [un|partly]initialized.
> 
> 
> Michal will you agree with such commit message?

Acked-by: Michal Hocko <mhocko@suse.cz>

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

WARNING: multiple messages have this Message-ID (diff)
From: Michal Hocko <mhocko@suse.cz>
To: Igor Mammedov <imammedo@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	Hiroyuki Kamezawa <kamezawa.hiroyuki@gmail.com>,
	linux-kernel@vger.kernel.org, balbir@linux.vnet.ibm.com,
	linux-mm@kvack.org, Paul Menage <menage@google.com>,
	Li Zefan <lizf@cn.fujitsu.com>,
	containers@lists.linux-foundation.org,
	Tim Deegan <Tim.Deegan@citrix.com>
Subject: Re: [PATCH] memcg: do not expose uninitialized mem_cgroup_per_node to world
Date: Wed, 27 Jul 2011 11:57:47 +0200	[thread overview]
Message-ID: <20110727095747.GA6430@tiehlicka.suse.cz> (raw)
In-Reply-To: <4E2FDAA0.5020702@redhat.com>

On Wed 27-07-11 11:30:08, Igor Mammedov wrote:
> On 07/27/2011 09:58 AM, Michal Hocko wrote:
> >On Tue 26-07-11 14:17:54, Andrew Morton wrote:
> >>On Fri, 10 Jun 2011 18:57:40 +0200
> >>Igor Mammedov<imammedo@redhat.com>  wrote:
> >>
> >>>On 06/08/2011 11:09 PM, Andrew Morton wrote:
> >>>>The original patch:
> >>>>
> >>>>--- a/mm/memcontrol.c
> >>>>+++ b/mm/memcontrol.c
> >>>>@@ -4707,7 +4707,6 @@ static int alloc_mem_cgroup_per_zone_info(struct mem_cgroup *mem, int node)
> >>>>   	if (!pn)
> >>>>   		return 1;
> >>>>
> >>>>-	mem->info.nodeinfo[node] = pn;
> >>>>   	for (zone = 0; zone<   MAX_NR_ZONES; zone++) {
> >>>>   		mz =&pn->zoneinfo[zone];
> >>>>   		for_each_lru(l)
> >>>>@@ -4716,6 +4715,7 @@ static int alloc_mem_cgroup_per_zone_info(struct mem_cgroup *mem, int node)
> >>>>   		mz->on_tree = false;
> >>>>   		mz->mem = mem;
> >>>>   	}
> >>>>+	mem->info.nodeinfo[node] = pn;
> >>>>   	return 0;
> >>>>   }
> >>>>
> >>>>looks like a really good idea.  But it needs a new changelog and I'd be
> >>>>a bit reluctant to merge it as it appears that the aptch removes our
> >>>>only known way of reproducing a bug.
> >>>>
> >>>>So for now I think I'll queue the patch up unchangelogged so the issue
> >>>>doesn't get forgotten about.
> >>>>
> >>>Problem was in rhel's xen hv.
> >>>It was missing fix for imul emulation.
> >>>Details here
> >>>http://lists.xensource.com/archives/html/xen-devel/2011-06/msg00801.html
> >>>Thanks to Tim Deegan and everyone who was involved in the discussion.
> >>
> >>I really don't want to trawl through a lengthy xen bug report
> >
> >The bug turned out to be Xen specific and this patch just hidden the bug
> >in Xen.
> 
> The problem was in incorrect imul instruction emulation in xen and as
> consequence incorrect attempt to initialize list at invalid memory location.
> 
> >
> >>and write your changelog for you.
> >>
> >>We still have no changelog for this patch.  Please send one.
> >
> >Appart from a better programming style is there any other reason for
> >taking it?  If applied it might hide potential bugs when somebody is
> >touching data too early.
> >
> 
> If it ever happens and somebody is touching data too early, it would be
> a bit easier to diagnose a problem when dereferencing NULL at
> mem->info.nodeinfo[node] than wondering at partly initialized
> mem_cgroup_per_zone. 

Bahh, I have mixed zero initialized with NULL that would blow up. You
are right of course, sorry for confusion.

> Aside from that it is purely cosmetic change.
> 
> Here is proposed change log:
> 
> Subject: Cleanup: memcg: Expose only initialized mem_cgroup_per_node to world
> 
> If somebody is touching data too early, it might be easier to diagnose
> a problem when dereferencing NULL at mem->info.nodeinfo[node] than
> trying to understand why mem_cgroup_per_zone is [un|partly]initialized.
> 
> 
> Michal will you agree with such commit message?

Acked-by: Michal Hocko <mhocko@suse.cz>

Thanks.
-- 
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 majordomo@kvack.org.  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:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2011-07-27  9:57 UTC|newest]

Thread overview: 85+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-01 10:44 [PATCH] memcg: do not expose uninitialized mem_cgroup_per_node to world Igor Mammedov
2011-06-01 12:39 ` Michal Hocko
2011-06-01 12:39   ` Michal Hocko
2011-06-01 13:07   ` Igor Mammedov
2011-06-01 13:07     ` Igor Mammedov
     [not found]     ` <4DE6399C.8070802-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2011-06-01 13:41       ` Michal Hocko
2011-06-01 13:41     ` Michal Hocko
2011-06-01 13:41       ` Michal Hocko
     [not found]       ` <20110601134149.GD4266-VqjxzfR4DlwKmadIfiO5sKVXKuFTiq87@public.gmane.org>
2011-06-01 14:39         ` Igor Mammedov
2011-06-01 14:39       ` Igor Mammedov
2011-06-01 14:39         ` Igor Mammedov
2011-06-01 15:20         ` Michal Hocko
2011-06-01 15:20           ` Michal Hocko
     [not found]           ` <20110601152039.GG4266-VqjxzfR4DlwKmadIfiO5sKVXKuFTiq87@public.gmane.org>
2011-06-01 16:42             ` Igor Mammedov
2011-06-01 16:42           ` Igor Mammedov
2011-06-01 23:10             ` Hiroyuki Kamezawa
2011-06-01 23:10               ` Hiroyuki Kamezawa
     [not found]               ` <BANLkTimbqHPeUdue=_Z31KVdPwcXtbLpeg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-06-03 12:35                 ` Igor Mammedov
2011-06-03 12:35               ` Igor Mammedov
2011-06-03 12:35                 ` Igor Mammedov
2011-06-03 13:00                 ` Hiroyuki Kamezawa
2011-06-03 13:00                   ` Hiroyuki Kamezawa
2011-06-07 13:25                   ` Igor Mammedov
2011-06-07 13:25                     ` Igor Mammedov
     [not found]                     ` <4DEE26E7.2060201-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2011-06-08  3:35                       ` KAMEZAWA Hiroyuki
2011-06-08  3:35                     ` KAMEZAWA Hiroyuki
2011-06-08  3:35                       ` KAMEZAWA Hiroyuki
2011-06-08 21:09                       ` Andrew Morton
2011-06-08 21:09                         ` Andrew Morton
2011-06-08 23:44                         ` KAMEZAWA Hiroyuki
2011-06-08 23:44                           ` KAMEZAWA Hiroyuki
     [not found]                         ` <20110608140951.115ab1dd.akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
2011-06-08 23:44                           ` KAMEZAWA Hiroyuki
2011-06-10 16:57                           ` Igor Mammedov
2011-06-10 16:57                         ` Igor Mammedov
2011-06-10 16:57                           ` Igor Mammedov
2011-07-26 21:17                           ` Andrew Morton
2011-07-26 21:17                             ` Andrew Morton
     [not found]                             ` <20110726141754.c69b96c6.akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
2011-07-27  7:58                               ` Michal Hocko
2011-07-27  7:58                             ` Michal Hocko
2011-07-27  7:58                               ` Michal Hocko
2011-07-27  9:30                               ` Igor Mammedov
2011-07-27  9:30                                 ` Igor Mammedov
2011-07-27  9:57                                 ` Michal Hocko [this message]
2011-07-27  9:57                                   ` Michal Hocko
     [not found]                                 ` <4E2FDAA0.5020702-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2011-07-27  9:57                                   ` Michal Hocko
     [not found]                               ` <20110727075845.GA4024-VqjxzfR4DlwKmadIfiO5sKVXKuFTiq87@public.gmane.org>
2011-07-27  9:30                                 ` Igor Mammedov
     [not found]                           ` <4DF24D04.1080802-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2011-07-26 21:17                             ` Andrew Morton
     [not found]                       ` <20110608123527.479e6991.kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
2011-06-08 21:09                         ` Andrew Morton
2011-06-09  8:11                         ` Igor Mammedov
2011-06-09  8:11                       ` Igor Mammedov
2011-06-09  8:11                         ` Igor Mammedov
2011-06-09 12:40                         ` Possible shadow bug (was: Re: [PATCH] memcg: do not expose uninitialized mem_cgroup_per_node to world) Stefano Stabellini
2011-06-09 12:40                           ` Stefano Stabellini
2011-06-09 12:40                           ` Stefano Stabellini
2011-06-09 15:01                           ` [Xen-devel] " Tim Deegan
2011-06-09 15:01                           ` Tim Deegan
2011-06-09 15:01                             ` Tim Deegan
2011-06-09 16:47                             ` [Xen-devel] Possible shadow bug Igor Mammedov
2011-06-09 16:47                               ` Igor Mammedov
2011-06-10 10:01                               ` Tim Deegan
2011-06-10 10:01                                 ` Tim Deegan
2011-06-10 10:10                                 ` Tim Deegan
2011-06-10 10:10                                   ` Tim Deegan
     [not found]                                   ` <20110610101011.GH5098-uBdcGoUfBNNYtxbxJUhB2Dgeux46jI+i@public.gmane.org>
2011-06-10 11:48                                     ` Pasi Kärkkäinen
2011-06-10 13:55                                     ` Igor Mammedov
2011-06-10 11:48                                   ` Pasi Kärkkäinen
2011-06-10 11:48                                     ` Pasi Kärkkäinen
2011-06-10 12:40                                     ` Tim Deegan
2011-06-10 12:40                                       ` Tim Deegan
2011-06-10 15:38                                       ` Igor Mammedov
2011-06-10 15:38                                         ` Igor Mammedov
     [not found]                                       ` <20110610124034.GI5098-uBdcGoUfBNNYtxbxJUhB2Dgeux46jI+i@public.gmane.org>
2011-06-10 15:38                                         ` Igor Mammedov
     [not found]                                     ` <20110610114821.GB32595-GxtO3QLqHcLR7s880joybQ@public.gmane.org>
2011-06-10 12:40                                       ` Tim Deegan
2011-06-10 13:55                                   ` Igor Mammedov
2011-06-10 13:55                                     ` Igor Mammedov
     [not found]                                 ` <20110610100139.GG5098-uBdcGoUfBNNYtxbxJUhB2Dgeux46jI+i@public.gmane.org>
2011-06-10 10:10                                   ` Tim Deegan
     [not found]                               ` <4DF0F90D.4010900-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2011-06-10 10:01                                 ` Tim Deegan
     [not found]                             ` <20110609150133.GF5098-uBdcGoUfBNNYtxbxJUhB2Dgeux46jI+i@public.gmane.org>
2011-06-09 16:47                               ` Igor Mammedov
     [not found]                         ` <4DF0801F.9050908-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2011-06-09 12:40                           ` Possible shadow bug (was: Re: [PATCH] memcg: do not expose uninitialized mem_cgroup_per_node to world) Stefano Stabellini
     [not found]                   ` <BANLkTinMamg_qesEffGxKu3QkT=zyQ2MRQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-06-07 13:25                     ` [PATCH] memcg: do not expose uninitialized mem_cgroup_per_node to world Igor Mammedov
     [not found]                 ` <4DE8D50F.1090406-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2011-06-03 13:00                   ` Hiroyuki Kamezawa
     [not found]             ` <4DE66BEB.7040502-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2011-06-01 23:10               ` Hiroyuki Kamezawa
     [not found]         ` <4DE64F0C.3050203-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2011-06-01 15:20           ` Michal Hocko
2011-06-01 13:49   ` Igor Mammedov
2011-06-01 13:49     ` Igor Mammedov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110727095747.GA6430@tiehlicka.suse.cz \
    --to=mhocko@suse.cz \
    --cc=Tim.Deegan@citrix.com \
    --cc=akpm@linux-foundation.org \
    --cc=balbir@linux.vnet.ibm.com \
    --cc=containers@lists.linux-foundation.org \
    --cc=imammedo@redhat.com \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=kamezawa.hiroyuki@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lizf@cn.fujitsu.com \
    --cc=menage@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.