All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Weiner <hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org>
To: Michal Hocko <mhocko-AlSwsSmVLrQ@public.gmane.org>
Cc: David Rientjes <rientjes-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>,
	Andrew Morton
	<akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>,
	KAMEZAWA Hiroyuki
	<kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org>,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org,
	cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [patch] mm, memcg: add oom killer delay
Date: Mon, 3 Jun 2013 12:51:20 -0400	[thread overview]
Message-ID: <20130603165120.GH15576@cmpxchg.org> (raw)
In-Reply-To: <20130603163012.GA23257-2MMpYkNvuYDjFM9bn6wA6Q@public.gmane.org>

On Mon, Jun 03, 2013 at 06:31:34PM +0200, Michal Hocko wrote:
> On Sat 01-06-13 02:11:51, Johannes Weiner wrote:
> > @@ -2076,6 +2077,7 @@ static void memcg_wakeup_oom(struct mem_cgroup *memcg)
> >  {
> >  	/* for filtering, pass "memcg" as argument. */
> >  	__wake_up(&memcg_oom_waitq, TASK_NORMAL, 0, memcg);
> > +	atomic_inc(&memcg->oom_wakeups);
> >  }
> >  
> >  static void memcg_oom_recover(struct mem_cgroup *memcg)
> [...]
> > +	prepare_to_wait(&memcg_oom_waitq, &owait.wait, TASK_KILLABLE);
> > +	/* Only sleep if we didn't miss any wakeups since OOM */
> > +	if (atomic_read(&memcg->oom_wakeups) == current->memcg_oom.wakeups)
> > +		schedule();
> 
> On the way home it occured to me that the ordering might be wrong here.
> The wake up can be lost here.
> 					__wake_up(memcg_oom_waitq)
> 					<preempted>
> prepare_to_wait
> atomic_read(&memcg->oom_wakeups)
> 					atomic_inc(oom_wakeups)
> 
> I guess we want atomic_inc before __wake_up, right?

I think you are right, thanks for spotting this.  Will be fixed in
version 2.

WARNING: multiple messages have this Message-ID (diff)
From: Johannes Weiner <hannes@cmpxchg.org>
To: Michal Hocko <mhocko@suse.cz>
Cc: David Rientjes <rientjes@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	cgroups@vger.kernel.org
Subject: Re: [patch] mm, memcg: add oom killer delay
Date: Mon, 3 Jun 2013 12:51:20 -0400	[thread overview]
Message-ID: <20130603165120.GH15576@cmpxchg.org> (raw)
In-Reply-To: <20130603163012.GA23257@dhcp22.suse.cz>

On Mon, Jun 03, 2013 at 06:31:34PM +0200, Michal Hocko wrote:
> On Sat 01-06-13 02:11:51, Johannes Weiner wrote:
> > @@ -2076,6 +2077,7 @@ static void memcg_wakeup_oom(struct mem_cgroup *memcg)
> >  {
> >  	/* for filtering, pass "memcg" as argument. */
> >  	__wake_up(&memcg_oom_waitq, TASK_NORMAL, 0, memcg);
> > +	atomic_inc(&memcg->oom_wakeups);
> >  }
> >  
> >  static void memcg_oom_recover(struct mem_cgroup *memcg)
> [...]
> > +	prepare_to_wait(&memcg_oom_waitq, &owait.wait, TASK_KILLABLE);
> > +	/* Only sleep if we didn't miss any wakeups since OOM */
> > +	if (atomic_read(&memcg->oom_wakeups) == current->memcg_oom.wakeups)
> > +		schedule();
> 
> On the way home it occured to me that the ordering might be wrong here.
> The wake up can be lost here.
> 					__wake_up(memcg_oom_waitq)
> 					<preempted>
> prepare_to_wait
> atomic_read(&memcg->oom_wakeups)
> 					atomic_inc(oom_wakeups)
> 
> I guess we want atomic_inc before __wake_up, right?

I think you are right, thanks for spotting this.  Will be fixed in
version 2.

--
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/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

WARNING: multiple messages have this Message-ID (diff)
From: Johannes Weiner <hannes@cmpxchg.org>
To: Michal Hocko <mhocko@suse.cz>
Cc: David Rientjes <rientjes@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	cgroups@vger.kernel.org
Subject: Re: [patch] mm, memcg: add oom killer delay
Date: Mon, 3 Jun 2013 12:51:20 -0400	[thread overview]
Message-ID: <20130603165120.GH15576@cmpxchg.org> (raw)
In-Reply-To: <20130603163012.GA23257@dhcp22.suse.cz>

On Mon, Jun 03, 2013 at 06:31:34PM +0200, Michal Hocko wrote:
> On Sat 01-06-13 02:11:51, Johannes Weiner wrote:
> > @@ -2076,6 +2077,7 @@ static void memcg_wakeup_oom(struct mem_cgroup *memcg)
> >  {
> >  	/* for filtering, pass "memcg" as argument. */
> >  	__wake_up(&memcg_oom_waitq, TASK_NORMAL, 0, memcg);
> > +	atomic_inc(&memcg->oom_wakeups);
> >  }
> >  
> >  static void memcg_oom_recover(struct mem_cgroup *memcg)
> [...]
> > +	prepare_to_wait(&memcg_oom_waitq, &owait.wait, TASK_KILLABLE);
> > +	/* Only sleep if we didn't miss any wakeups since OOM */
> > +	if (atomic_read(&memcg->oom_wakeups) == current->memcg_oom.wakeups)
> > +		schedule();
> 
> On the way home it occured to me that the ordering might be wrong here.
> The wake up can be lost here.
> 					__wake_up(memcg_oom_waitq)
> 					<preempted>
> prepare_to_wait
> atomic_read(&memcg->oom_wakeups)
> 					atomic_inc(oom_wakeups)
> 
> I guess we want atomic_inc before __wake_up, right?

I think you are right, thanks for spotting this.  Will be fixed in
version 2.

  parent reply	other threads:[~2013-06-03 16:51 UTC|newest]

Thread overview: 107+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-30  1:18 [patch] mm, memcg: add oom killer delay David Rientjes
2013-05-30  1:18 ` David Rientjes
2013-05-30  1:18 ` David Rientjes
2013-05-30 15:07 ` Michal Hocko
2013-05-30 15:07   ` Michal Hocko
2013-05-30 20:47   ` David Rientjes
2013-05-30 20:47     ` David Rientjes
     [not found]     ` <alpine.DEB.2.02.1305301338430.20389-X6Q0R45D7oAcqpCFd4KODRPsWskHk0ljAL8bYrjMMd8@public.gmane.org>
2013-05-31  8:10       ` Michal Hocko
2013-05-31  8:10         ` Michal Hocko
2013-05-31  8:10         ` Michal Hocko
     [not found]         ` <20130531081052.GA32491-2MMpYkNvuYDjFM9bn6wA6Q@public.gmane.org>
2013-05-31 10:22           ` David Rientjes
2013-05-31 10:22             ` David Rientjes
2013-05-31 10:22             ` David Rientjes
2013-05-31 11:02             ` Michal Hocko
2013-05-31 11:02               ` Michal Hocko
     [not found]             ` <alpine.DEB.2.02.1305310316210.27716-X6Q0R45D7oAcqpCFd4KODRPsWskHk0ljAL8bYrjMMd8@public.gmane.org>
2013-05-31 11:21               ` Michal Hocko
2013-05-31 11:21                 ` Michal Hocko
2013-05-31 11:21                 ` Michal Hocko
2013-05-31 19:29                 ` David Rientjes
2013-05-31 19:29                   ` David Rientjes
2013-06-01  6:11                   ` Johannes Weiner
2013-06-01  6:11                     ` Johannes Weiner
2013-06-01 10:29                     ` Michal Hocko
2013-06-01 10:29                       ` Michal Hocko
2013-06-01 15:15                       ` Johannes Weiner
2013-06-01 15:15                         ` Johannes Weiner
2013-06-03 15:34                     ` Michal Hocko
2013-06-03 15:34                       ` Michal Hocko
     [not found]                       ` <20130603153432.GC18588-2MMpYkNvuYDjFM9bn6wA6Q@public.gmane.org>
2013-06-03 16:48                         ` Johannes Weiner
2013-06-03 16:48                           ` Johannes Weiner
2013-06-03 16:48                           ` Johannes Weiner
     [not found]                           ` <20130603164839.GG15576-druUgvl0LCNAfugRpC6u6w@public.gmane.org>
2013-06-03 18:03                             ` Michal Hocko
2013-06-03 18:03                               ` Michal Hocko
2013-06-03 18:03                               ` Michal Hocko
2013-06-03 18:30                           ` Johannes Weiner
2013-06-03 18:30                             ` Johannes Weiner
2013-06-03 21:33                             ` KOSAKI Motohiro
2013-06-03 21:33                               ` KOSAKI Motohiro
2013-06-03 21:33                               ` KOSAKI Motohiro
2013-06-04  9:17                             ` Michal Hocko
2013-06-04  9:17                               ` Michal Hocko
2013-06-04 18:48                               ` Johannes Weiner
2013-06-04 18:48                                 ` Johannes Weiner
2013-06-04 19:27                                 ` Michal Hocko
2013-06-04 19:27                                   ` Michal Hocko
2013-06-05 13:49                                 ` Michal Hocko
2013-06-05 13:49                                   ` Michal Hocko
2013-06-03 16:31                     ` Michal Hocko
2013-06-03 16:31                       ` Michal Hocko
     [not found]                       ` <20130603163012.GA23257-2MMpYkNvuYDjFM9bn6wA6Q@public.gmane.org>
2013-06-03 16:51                         ` Johannes Weiner [this message]
2013-06-03 16:51                           ` Johannes Weiner
2013-06-03 16:51                           ` Johannes Weiner
2013-06-01 10:20                   ` Michal Hocko
2013-06-01 10:20                     ` Michal Hocko
2013-06-03 18:18                     ` David Rientjes
2013-06-03 18:18                       ` David Rientjes
     [not found]                       ` <alpine.DEB.2.02.1306031102480.7956-X6Q0R45D7oAcqpCFd4KODRPsWskHk0ljAL8bYrjMMd8@public.gmane.org>
2013-06-03 18:54                         ` Johannes Weiner
2013-06-03 18:54                           ` Johannes Weiner
2013-06-03 18:54                           ` Johannes Weiner
2013-06-03 19:09                           ` David Rientjes
2013-06-03 19:09                             ` David Rientjes
     [not found]                             ` <alpine.DEB.2.02.1306031159060.7956-X6Q0R45D7oAcqpCFd4KODRPsWskHk0ljAL8bYrjMMd8@public.gmane.org>
2013-06-03 21:43                               ` Johannes Weiner
2013-06-03 21:43                                 ` Johannes Weiner
2013-06-03 21:43                                 ` Johannes Weiner
2013-06-03 19:31                       ` Michal Hocko
2013-06-03 19:31                         ` Michal Hocko
2013-06-03 21:17                         ` David Rientjes
2013-06-03 21:17                           ` David Rientjes
2013-06-04  9:55                           ` Michal Hocko
2013-06-04  9:55                             ` Michal Hocko
2013-06-05  6:40                             ` David Rientjes
2013-06-05  6:40                               ` David Rientjes
     [not found]                               ` <alpine.DEB.2.02.1306042329320.20610-X6Q0R45D7oAcqpCFd4KODRPsWskHk0ljAL8bYrjMMd8@public.gmane.org>
2013-06-05  9:39                                 ` Michal Hocko
2013-06-05  9:39                                   ` Michal Hocko
2013-06-05  9:39                                   ` Michal Hocko
2013-06-06  0:09                                   ` David Rientjes
2013-06-06  0:09                                     ` David Rientjes
2013-06-10 14:23                                     ` Michal Hocko
2013-06-10 14:23                                       ` Michal Hocko
2013-06-11 20:33                                       ` David Rientjes
2013-06-11 20:33                                         ` David Rientjes
     [not found]                                         ` <alpine.DEB.2.02.1306111321360.32688-X6Q0R45D7oAcqpCFd4KODRPsWskHk0ljAL8bYrjMMd8@public.gmane.org>
2013-06-12 20:23                                           ` Michal Hocko
2013-06-12 20:23                                             ` Michal Hocko
2013-06-12 20:23                                             ` Michal Hocko
2013-06-12 21:27                                             ` David Rientjes
2013-06-12 21:27                                               ` David Rientjes
2013-06-13 15:16                                               ` Michal Hocko
2013-06-13 15:16                                                 ` Michal Hocko
2013-06-13 22:25                                                 ` David Rientjes
2013-06-13 22:25                                                   ` David Rientjes
2013-06-14  0:56                                                   ` Kamezawa Hiroyuki
2013-06-14  0:56                                                     ` Kamezawa Hiroyuki
2013-06-14 10:12                                                     ` David Rientjes
2013-06-14 10:12                                                       ` David Rientjes
2013-06-19 21:30                                                       ` David Rientjes
2013-06-19 21:30                                                         ` David Rientjes
     [not found]                                                       ` <alpine.DEB.2.02.1306140254590.8780-X6Q0R45D7oAcqpCFd4KODRPsWskHk0ljAL8bYrjMMd8@public.gmane.org>
2013-06-25  1:39                                                         ` Kamezawa Hiroyuki
2013-06-25  1:39                                                           ` Kamezawa Hiroyuki
2013-06-25  1:39                                                           ` Kamezawa Hiroyuki
2013-06-26 23:18                                                           ` David Rientjes
2013-06-26 23:18                                                             ` David Rientjes
2013-07-10 11:23                                                       ` Michal Hocko
2013-07-10 11:23                                                         ` Michal Hocko
2013-05-31 21:46 ` Andrew Morton
2013-05-31 21:46   ` Andrew Morton
2013-06-03 18:00   ` David Rientjes
2013-06-03 18:00     ` David Rientjes

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=20130603165120.GH15576@cmpxchg.org \
    --to=hannes-druugvl0lcnafugrpc6u6w@public.gmane.org \
    --cc=akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org \
    --cc=cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org \
    --cc=mhocko-AlSwsSmVLrQ@public.gmane.org \
    --cc=rientjes-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
    /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.