All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jerome Glisse <jglisse@redhat.com>
To: Michal Hocko <mhocko@kernel.org>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Vladimir Davydov <vdavydov.dev@gmail.com>
Subject: Re: [PATCH] mm/memcg: avoid page count check for zone device
Date: Sun, 17 Sep 2017 10:45:34 -0700	[thread overview]
Message-ID: <20170917174534.GC11906@redhat.com> (raw)
In-Reply-To: <20170915070100.2vuxxxk2zf2yceca@dhcp22.suse.cz>

On Fri, Sep 15, 2017 at 09:01:00AM +0200, Michal Hocko wrote:
> On Thu 14-09-17 15:00:11, jglisse@redhat.com wrote:
> > From: Jerome Glisse <jglisse@redhat.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: Jerome Glisse <jglisse@redhat.com>
> > Reported-by: Evgeny Baskakov <ebaskakov@nvidia.com>
> > Cc: Andrew Morton <akpm@linux-foundation.org>
> > Cc: Johannes Weiner <hannes@cmpxchg.org>
> > Cc: Michal Hocko <mhocko@kernel.org>
> > Cc: Vladimir Davydov <vdavydov.dev@gmail.com>
> 
> Acked-by: Michal Hocko <mhocko@suse.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,
Jerome

--
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: Jerome Glisse <jglisse@redhat.com>
To: Michal Hocko <mhocko@kernel.org>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Vladimir Davydov <vdavydov.dev@gmail.com>
Subject: Re: [PATCH] mm/memcg: avoid page count check for zone device
Date: Sun, 17 Sep 2017 10:45:34 -0700	[thread overview]
Message-ID: <20170917174534.GC11906@redhat.com> (raw)
In-Reply-To: <20170915070100.2vuxxxk2zf2yceca@dhcp22.suse.cz>

On Fri, Sep 15, 2017 at 09:01:00AM +0200, Michal Hocko wrote:
> On Thu 14-09-17 15:00:11, jglisse@redhat.com wrote:
> > From: Jérôme Glisse <jglisse@redhat.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@redhat.com>
> > Reported-by: Evgeny Baskakov <ebaskakov@nvidia.com>
> > Cc: Andrew Morton <akpm@linux-foundation.org>
> > Cc: Johannes Weiner <hannes@cmpxchg.org>
> > Cc: Michal Hocko <mhocko@kernel.org>
> > Cc: Vladimir Davydov <vdavydov.dev@gmail.com>
> 
> Acked-by: Michal Hocko <mhocko@suse.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

  reply	other threads:[~2017-09-17 17:45 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-14 19:00 [PATCH] mm/memcg: avoid page count check for zone device jglisse
2017-09-14 19:00 ` jglisse
2017-09-15  7:01 ` Michal Hocko
2017-09-15  7:01   ` Michal Hocko
2017-09-17 17:45   ` Jerome Glisse [this message]
2017-09-17 17:45     ` Jerome Glisse
2017-09-18  6:31     ` Michal Hocko
2017-09-18  6:31       ` Michal Hocko

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=20170917174534.GC11906@redhat.com \
    --to=jglisse@redhat.com \
    --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.dev@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 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.