From: Vlastimil Babka <vbabka@suse.cz>
To: Michal Hocko <mhocko@kernel.org>,
Vladimir Davydov <vdavydov@virtuozzo.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Johannes Weiner <hannes@cmpxchg.org>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] vmpressure: Fix subtree pressure detection
Date: Thu, 28 Jan 2016 20:24:30 +0100 [thread overview]
Message-ID: <56AA6AEE.30004@suse.cz> (raw)
In-Reply-To: <20160128155531.GE15948@dhcp22.suse.cz>
On 28.1.2016 16:55, Michal Hocko wrote:
> On Wed 27-01-16 19:28:57, Vladimir Davydov wrote:
>> When vmpressure is called for the entire subtree under pressure we
>> mistakenly use vmpressure->scanned instead of vmpressure->tree_scanned
>> when checking if vmpressure work is to be scheduled. This results in
>> suppressing all vmpressure events in the legacy cgroup hierarchy. Fix
>> it.
>>
>> Fixes: 8e8ae645249b ("mm: memcontrol: hook up vmpressure to socket pressure")
>> Signed-off-by: Vladimir Davydov <vdavydov@virtuozzo.com>
>
> a = b += c made me scratch my head for a second but this looks correct
Ugh, it's actually a = b += a
While clever and compact, this will make scratch their head anyone looking at
the code in the future. Is it worth it?
> Acked-by: Michal Hocko <mhocko@suse.com>
>
>> ---
>> mm/vmpressure.c | 3 +--
>> 1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/mm/vmpressure.c b/mm/vmpressure.c
>> index 9a6c0704211c..149fdf6c5c56 100644
>> --- a/mm/vmpressure.c
>> +++ b/mm/vmpressure.c
>> @@ -248,9 +248,8 @@ void vmpressure(gfp_t gfp, struct mem_cgroup *memcg, bool tree,
>>
>> if (tree) {
>> spin_lock(&vmpr->sr_lock);
>> - vmpr->tree_scanned += scanned;
>> + scanned = vmpr->tree_scanned += scanned;
>> vmpr->tree_reclaimed += reclaimed;
>> - scanned = vmpr->scanned;
>> spin_unlock(&vmpr->sr_lock);
>>
>> if (scanned < vmpressure_win)
>> --
>> 2.1.4
>
--
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: Vlastimil Babka <vbabka@suse.cz>
To: Michal Hocko <mhocko@kernel.org>,
Vladimir Davydov <vdavydov@virtuozzo.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Johannes Weiner <hannes@cmpxchg.org>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] vmpressure: Fix subtree pressure detection
Date: Thu, 28 Jan 2016 20:24:30 +0100 [thread overview]
Message-ID: <56AA6AEE.30004@suse.cz> (raw)
In-Reply-To: <20160128155531.GE15948@dhcp22.suse.cz>
On 28.1.2016 16:55, Michal Hocko wrote:
> On Wed 27-01-16 19:28:57, Vladimir Davydov wrote:
>> When vmpressure is called for the entire subtree under pressure we
>> mistakenly use vmpressure->scanned instead of vmpressure->tree_scanned
>> when checking if vmpressure work is to be scheduled. This results in
>> suppressing all vmpressure events in the legacy cgroup hierarchy. Fix
>> it.
>>
>> Fixes: 8e8ae645249b ("mm: memcontrol: hook up vmpressure to socket pressure")
>> Signed-off-by: Vladimir Davydov <vdavydov@virtuozzo.com>
>
> a = b += c made me scratch my head for a second but this looks correct
Ugh, it's actually a = b += a
While clever and compact, this will make scratch their head anyone looking at
the code in the future. Is it worth it?
> Acked-by: Michal Hocko <mhocko@suse.com>
>
>> ---
>> mm/vmpressure.c | 3 +--
>> 1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/mm/vmpressure.c b/mm/vmpressure.c
>> index 9a6c0704211c..149fdf6c5c56 100644
>> --- a/mm/vmpressure.c
>> +++ b/mm/vmpressure.c
>> @@ -248,9 +248,8 @@ void vmpressure(gfp_t gfp, struct mem_cgroup *memcg, bool tree,
>>
>> if (tree) {
>> spin_lock(&vmpr->sr_lock);
>> - vmpr->tree_scanned += scanned;
>> + scanned = vmpr->tree_scanned += scanned;
>> vmpr->tree_reclaimed += reclaimed;
>> - scanned = vmpr->scanned;
>> spin_unlock(&vmpr->sr_lock);
>>
>> if (scanned < vmpressure_win)
>> --
>> 2.1.4
>
next prev parent reply other threads:[~2016-01-28 19:24 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-27 16:28 [PATCH] vmpressure: Fix subtree pressure detection Vladimir Davydov
2016-01-27 16:28 ` Vladimir Davydov
2016-01-27 18:47 ` Johannes Weiner
2016-01-27 18:47 ` Johannes Weiner
2016-01-28 15:55 ` Michal Hocko
2016-01-28 15:55 ` Michal Hocko
2016-01-28 19:24 ` Vlastimil Babka [this message]
2016-01-28 19:24 ` Vlastimil Babka
2016-01-29 8:37 ` Vladimir Davydov
2016-01-29 8:37 ` Vladimir Davydov
2016-02-02 6:32 ` Andrew Morton
2016-02-02 6:32 ` Andrew Morton
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=56AA6AEE.30004@suse.cz \
--to=vbabka@suse.cz \
--cc=akpm@linux-foundation.org \
--cc=hannes@cmpxchg.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@kernel.org \
--cc=vdavydov@virtuozzo.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.