[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170917174534.GC11906@redhat.com>
Date: Sun, 17 Sep 2017 10:45:34 -0700
From: Jerome Glisse <jglisse@...hat.com>
To: Michal Hocko <mhocko@...nel.org>
Cc: linux-mm@...ck.org, linux-kernel@...r.kernel.org,
Andrew Morton <akpm@...ux-foundation.org>,
Johannes Weiner <hannes@...xchg.org>,
Vladimir Davydov <vdavydov.dev@...il.com>
Subject: Re: [PATCH] mm/memcg: avoid page count check for zone device
On Fri, Sep 15, 2017 at 09:01:00AM +0200, Michal Hocko wrote:
> On Thu 14-09-17 15:00:11, jglisse@...hat.com wrote:
> > From: Jérôme Glisse <jglisse@...hat.com>
> >
> > Fix for 4.14, zone device page always have an elevated refcount
> > of one and thus page count sanity check in uncharge_page() is
> > inappropriate for them.
> >
> > Signed-off-by: Jérôme Glisse <jglisse@...hat.com>
> > Reported-by: Evgeny Baskakov <ebaskakov@...dia.com>
> > Cc: Andrew Morton <akpm@...ux-foundation.org>
> > Cc: Johannes Weiner <hannes@...xchg.org>
> > Cc: Michal Hocko <mhocko@...nel.org>
> > Cc: Vladimir Davydov <vdavydov.dev@...il.com>
>
> Acked-by: Michal Hocko <mhocko@...e.com>
>
> Side note. Wouldn't it be better to re-organize the check a bit? It is
> true that this is VM_BUG so it is not usually compiled in but when it
> preferably checks for unlikely cases first while the ref count will be
> 0 in the prevailing cases. So can we have
> VM_BUG_ON_PAGE(page_count(page) && !is_zone_device_page(page) &&
> !PageHWPoison(page), page);
>
> I would simply fold this nano optimization into the patch as you are
> touching it already. Not sure it is worth a separate commit.
I am traveling sorry for late answer. This nano optimization make sense
Andrew do you want me to respin or should we leave it be ? I don't mind
either way.
Cheers,
Jérôme
Powered by blists - more mailing lists