linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Vladimir Davydov <vdavydov@virtuozzo.com>
To: Li RongQing <roy.qing.li@gmail.com>
Cc: Michal Hocko <mhocko@kernel.org>,
	cgroups@vger.kernel.org, linux-mm@kvack.org,
	Johannes Weiner <hannes@cmpxchg.org>
Subject: Re: [PATCH] mm: memcontrol: fix the return in mem_cgroup_margin
Date: Mon, 23 May 2016 13:37:58 +0300	[thread overview]
Message-ID: <20160523103758.GB7917@esperanza> (raw)
In-Reply-To: <CAJFZqHwFtZa-Ec_0bie6ORTrgoW1kqGsq49-=ojsT-uyNUBhwg@mail.gmail.com>

On Thu, May 19, 2016 at 09:44:53AM +0800, Li RongQing wrote:
> On Wed, May 18, 2016 at 3:32 PM, Michal Hocko <mhocko@kernel.org> wrote:
> > count should always be smaller than memsw.limit (this is a hard limit).
> > Even if we have some temporary breach then the code should work as
> > expected because margin is initialized to 0 and memsw.limit >= limit.
> 
> is it possible for this case? for example
> 
> memory count is 500, memory limit is 600; the margin is set to 100 firstly,
> then check memory+swap limit, its count(1100) is bigger than its limit(1000),
> then the margin 100 is returned wrongly.

I guess it is possible, because try_charge forces charging __GFP_NOFAIL
allocations, which may result in memsw.limit excess. If we are below
memory.limit and there's nothing to reclaim to reduce memsw.usage, we
might end up looping in try_charge forever. I've never seen that happen
in practice, but I still think the patch is worth applying.

Acked-by: Vladimir Davydov <vdavydov@virtuozzo.com>

--
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>

  reply	other threads:[~2016-05-23 10:38 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-18  7:24 roy.qing.li
2016-05-18  7:32 ` Michal Hocko
2016-05-18  7:39   ` Li RongQing
2016-05-19  1:44   ` Li RongQing
2016-05-23 10:37     ` Vladimir Davydov [this message]
2016-05-23 12:06       ` Michal Hocko
2016-05-23 12:08         ` Michal Hocko
2016-05-24  3:07         ` Li RongQing

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=20160523103758.GB7917@esperanza \
    --to=vdavydov@virtuozzo.com \
    --cc=cgroups@vger.kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.org \
    --cc=roy.qing.li@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox