Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1320821 > unrolled thread
| Started by | Michal Hocko <mhocko@kernel.org> |
|---|---|
| First post | 2016-01-28 17:00 +0100 |
| Last post | 2016-02-02 07:30 +0100 |
| Articles | 4 — 4 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: [PATCH] vmpressure: Fix subtree pressure detection Michal Hocko <mhocko@kernel.org> - 2016-01-28 17:00 +0100
Re: [PATCH] vmpressure: Fix subtree pressure detection Vlastimil Babka <vbabka@suse.cz> - 2016-01-28 20:30 +0100
Re: [PATCH] vmpressure: Fix subtree pressure detection Vladimir Davydov <vdavydov@virtuozzo.com> - 2016-01-29 09:40 +0100
Re: [PATCH] vmpressure: Fix subtree pressure detection Andrew Morton <akpm@linux-foundation.org> - 2016-02-02 07:30 +0100
| From | Michal Hocko <mhocko@kernel.org> |
|---|---|
| Date | 2016-01-28 17:00 +0100 |
| Subject | Re: [PATCH] vmpressure: Fix subtree pressure detection |
| Message-ID | <qVX9g-5Ao-27@gated-at.bofh.it> |
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
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
--
Michal Hocko
SUSE Labs
[toc] | [next] | [standalone]
| From | Vlastimil Babka <vbabka@suse.cz> |
|---|---|
| Date | 2016-01-28 20:30 +0100 |
| Message-ID | <qW0qu-841-5@gated-at.bofh.it> |
| In reply to | #1320821 |
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
>
[toc] | [prev] | [next] | [standalone]
| From | Vladimir Davydov <vdavydov@virtuozzo.com> |
|---|---|
| Date | 2016-01-29 09:40 +0100 |
| Message-ID | <qWcL0-5o-19@gated-at.bofh.it> |
| In reply to | #1320960 |
On Thu, Jan 28, 2016 at 08:24:30PM +0100, Vlastimil Babka wrote:
> 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?
I'm just trying to be consistend with the !tree case, where we do
exactly the same.
Thanks,
Vladimir
[toc] | [prev] | [next] | [standalone]
| From | Andrew Morton <akpm@linux-foundation.org> |
|---|---|
| Date | 2016-02-02 07:30 +0100 |
| Message-ID | <qXCDp-6Jl-21@gated-at.bofh.it> |
| In reply to | #1321559 |
On Fri, 29 Jan 2016 11:37:49 +0300 Vladimir Davydov <vdavydov@virtuozzo.com> wrote:
> On Thu, Jan 28, 2016 at 08:24:30PM +0100, Vlastimil Babka wrote:
> > 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?
>
> I'm just trying to be consistend with the !tree case, where we do
> exactly the same.
I stared suspiciously at it for a while, decided to let it go.
Possibly we can remove local `scanned' altogether. No matter, someone
will clean it all up sometime.
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web