From: Ira Weiny <ira.weiny@intel.com>
To: Artemy Kovalyov <artemyko@mellanox.com>
Cc: "john.hubbard@gmail.com" <john.hubbard@gmail.com>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
Andrew Morton <akpm@linux-foundation.org>,
LKML <linux-kernel@vger.kernel.org>,
John Hubbard <jhubbard@nvidia.com>,
Jason Gunthorpe <jgg@ziepe.ca>,
Doug Ledford <dledford@redhat.com>,
"linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>
Subject: Re: [PATCH v2] RDMA/umem: minor bug fix and cleanup in error handling paths
Date: Sun, 3 Mar 2019 08:55:51 -0800 [thread overview]
Message-ID: <20190303165550.GB27123@iweiny-DESK2.sc.intel.com> (raw)
In-Reply-To: <2404c962-8f6d-1f6d-0055-eb82864ca7fc@mellanox.com>
On Sun, Mar 03, 2019 at 11:52:41AM +0200, Artemy Kovalyov wrote:
>
>
> On 02/03/2019 21:44, Ira Weiny wrote:
> >
> > On Sat, Mar 02, 2019 at 12:24:35PM -0800, john.hubbard@gmail.com wrote:
> > > From: John Hubbard <jhubbard@nvidia.com>
> > >
> > > ...
> > > 3. Dead code removal: the check for (user_virt & ~page_mask)
> > > is checking for a condition that can never happen,
> > > because earlier:
> > >
> > > user_virt = user_virt & page_mask;
> > >
> > > ...so, remove that entire phrase.
> > >
> > > bcnt -= min_t(size_t, npages << PAGE_SHIFT, bcnt);
> > > mutex_lock(&umem_odp->umem_mutex);
> > > for (j = 0; j < npages; j++, user_virt += PAGE_SIZE) {
> > > - if (user_virt & ~page_mask) {
> > > - p += PAGE_SIZE;
> > > - if (page_to_phys(local_page_list[j]) != p) {
> > > - ret = -EFAULT;
> > > - break;
> > > - }
> > > - put_page(local_page_list[j]);
> > > - continue;
> > > - }
> > > -
> >
> > I think this is trying to account for compound pages. (ie page_mask could
> > represent more than PAGE_SIZE which is what user_virt is being incrimented by.)
> > But putting the page in that case seems to be the wrong thing to do?
> >
> > Yes this was added by Artemy[1] now cc'ed.
>
> Right, this is for huge pages, please keep it.
> put_page() needed to decrement refcount of the head page.
You mean decrement the refcount of the _non_-head pages?
Ira
>
next prev parent reply other threads:[~2019-03-04 0:57 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-02 3:27 [PATCH 0/1] " john.hubbard
2019-03-02 3:27 ` [PATCH] " john.hubbard
2019-03-02 16:03 ` kbuild test robot
2019-03-02 16:14 ` kbuild test robot
2019-03-02 20:24 ` [PATCH v2] " john.hubbard
2019-03-02 19:44 ` Ira Weiny
2019-03-03 9:52 ` Artemy Kovalyov
2019-03-03 16:55 ` Ira Weiny [this message]
2019-03-04 23:11 ` John Hubbard
2019-03-04 20:13 ` Ira Weiny
2019-03-05 20:10 ` John Hubbard
2019-03-04 23:36 ` John Hubbard
2019-03-05 0:53 ` Jason Gunthorpe
2019-03-03 22:37 ` John Hubbard
2019-03-04 6:44 ` Leon Romanovsky
2019-03-06 1:02 ` Artemy Kovalyov
2019-03-06 1:32 ` Jason Gunthorpe
2019-03-06 1:34 ` John Hubbard
2019-03-06 1:37 ` John Hubbard
2019-03-06 1:51 ` Jason Gunthorpe
2019-03-06 2:04 ` John Hubbard
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=20190303165550.GB27123@iweiny-DESK2.sc.intel.com \
--to=ira.weiny@intel.com \
--cc=akpm@linux-foundation.org \
--cc=artemyko@mellanox.com \
--cc=dledford@redhat.com \
--cc=jgg@ziepe.ca \
--cc=jhubbard@nvidia.com \
--cc=john.hubbard@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-rdma@vger.kernel.org \
/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