From: Christoph Hellwig <hch@lst.de>
To: john.hubbard@gmail.com
Cc: "Andrew Morton" <akpm@linux-foundation.org>,
"Alexander Viro" <viro@zeniv.linux.org.uk>,
"Björn Töpel" <bjorn.topel@intel.com>,
"Boaz Harrosh" <boaz@plexistor.com>,
"Christoph Hellwig" <hch@lst.de>,
"Daniel Vetter" <daniel@ffwll.ch>,
"Dan Williams" <dan.j.williams@intel.com>,
"Dave Chinner" <david@fromorbit.com>,
"David Airlie" <airlied@linux.ie>,
"David S . Miller" <davem@davemloft.net>,
"Ilya Dryomov" <idryomov@gmail.com>, "Jan Kara" <jack@suse.cz>,
"Jason Gunthorpe" <jgg@ziepe.ca>, "Jens Axboe" <axboe@kernel.dk>,
"Jérôme Glisse" <jglisse@redhat.com>,
"Johannes Thumshirn" <jthumshirn@suse.de>,
"Magnus Karlsson" <magnus.karlsson@intel.com>,
"Matthew Wilcox" <willy@infradead.org>,
"Miklos Szeredi" <miklos@szeredi.hu>,
"Ming Lei" <ming.lei@redhat.com>, "Sage Weil" <sage@redhat.com>,
"Santosh Shilimkar" <santosh.shilimkar@oracle.com>,
"Yan Zheng" <zyan@redhat.com>,
netdev@vger.kernel.org, dri-devel@lists.freedesktop.org,
linux-mm@kvack.org, linux-rdma@vger.kernel.org,
bpf@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>,
"John Hubbard" <jhubbard@nvidia.com>
Subject: Re: [PATCH 1/3] drivers/gpu/drm/via: convert put_page() to put_user_page*()
Date: Mon, 22 Jul 2019 11:33:55 +0200 [thread overview]
Message-ID: <20190722093355.GB29538@lst.de> (raw)
In-Reply-To: <20190722043012.22945-2-jhubbard@nvidia.com>
On Sun, Jul 21, 2019 at 09:30:10PM -0700, john.hubbard@gmail.com wrote:
> for (i = 0; i < vsg->num_pages; ++i) {
> if (NULL != (page = vsg->pages[i])) {
> if (!PageReserved(page) && (DMA_FROM_DEVICE == vsg->direction))
> - SetPageDirty(page);
> - put_page(page);
> + put_user_pages_dirty(&page, 1);
> + else
> + put_user_page(page);
> }
Can't just pass a dirty argument to put_user_pages? Also do we really
need a separate put_user_page for the single page case?
put_user_pages_dirty?
Also the PageReserved check looks bogus, as I can't see how a reserved
page can end up here. So IMHO the above snippled should really look
something like this:
put_user_pages(vsg->pages[i], vsg->num_pages,
vsg->direction == DMA_FROM_DEVICE);
in the end.
WARNING: multiple messages have this Message-ID (diff)
From: Christoph Hellwig <hch@lst.de>
To: john.hubbard@gmail.com
Cc: "Andrew Morton" <akpm@linux-foundation.org>,
"Alexander Viro" <viro@zeniv.linux.org.uk>,
"Björn Töpel" <bjorn.topel@intel.com>,
"Boaz Harrosh" <boaz@plexistor.com>,
"Christoph Hellwig" <hch@lst.de>,
"Daniel Vetter" <daniel@ffwll.ch>,
"Dan Williams" <dan.j.williams@intel.com>,
"Dave Chinner" <david@fromorbit.com>,
"David Airlie" <airlied@linux.ie>,
"David S . Miller" <davem@davemloft.net>,
"Ilya Dryomov" <idryomov@gmail.com>, "Jan Kara" <jack@suse.cz>,
"Jason Gunthorpe" <jgg@ziepe.ca>, "Jens Axboe" <axboe@kernel.dk>,
"Jérôme Glisse" <jglisse@redhat.com>,
"Johannes Thumshirn" <jthumshirn@suse.de>,
"Magnus Karlsson" <magnus.karlsson@intel.com>,
"Matthew Wilcox" <willy@infradead.org>,
"Miklos Szeredi" <miklos@szeredi.hu>,
"Ming Lei" <ming.lei@redhat.co>
Subject: Re: [PATCH 1/3] drivers/gpu/drm/via: convert put_page() to put_user_page*()
Date: Mon, 22 Jul 2019 11:33:55 +0200 [thread overview]
Message-ID: <20190722093355.GB29538@lst.de> (raw)
In-Reply-To: <20190722043012.22945-2-jhubbard@nvidia.com>
On Sun, Jul 21, 2019 at 09:30:10PM -0700, john.hubbard@gmail.com wrote:
> for (i = 0; i < vsg->num_pages; ++i) {
> if (NULL != (page = vsg->pages[i])) {
> if (!PageReserved(page) && (DMA_FROM_DEVICE == vsg->direction))
> - SetPageDirty(page);
> - put_page(page);
> + put_user_pages_dirty(&page, 1);
> + else
> + put_user_page(page);
> }
Can't just pass a dirty argument to put_user_pages? Also do we really
need a separate put_user_page for the single page case?
put_user_pages_dirty?
Also the PageReserved check looks bogus, as I can't see how a reserved
page can end up here. So IMHO the above snippled should really look
something like this:
put_user_pages(vsg->pages[i], vsg->num_pages,
vsg->direction == DMA_FROM_DEVICE);
in the end.
next prev parent reply other threads:[~2019-07-22 9:34 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-22 4:30 [PATCH 0/4] put_user_page: new put_user_page_dirty*() helpers john.hubbard
2019-07-22 4:30 ` john.hubbard
2019-07-22 4:30 ` [PATCH 1/3] drivers/gpu/drm/via: convert put_page() to put_user_page*() john.hubbard
2019-07-22 4:30 ` john.hubbard
2019-07-22 9:33 ` Christoph Hellwig [this message]
2019-07-22 9:33 ` Christoph Hellwig
2019-07-22 18:53 ` John Hubbard
2019-07-22 18:53 ` John Hubbard
2019-07-22 19:07 ` Matthew Wilcox
2019-07-22 19:07 ` Matthew Wilcox
2019-07-22 19:10 ` John Hubbard
2019-07-22 19:10 ` John Hubbard
2019-07-22 4:30 ` [PATCH 2/3] net/xdp: " john.hubbard
2019-07-22 4:30 ` john.hubbard
2019-07-22 9:34 ` Christoph Hellwig
2019-07-22 9:34 ` Christoph Hellwig
2019-07-22 4:30 ` [PATCH 3/3] gup: new put_user_page_dirty*() helpers john.hubbard
2019-07-22 4:30 ` john.hubbard
2019-07-22 19:05 ` John Hubbard
2019-07-22 19:05 ` 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=20190722093355.GB29538@lst.de \
--to=hch@lst.de \
--cc=airlied@linux.ie \
--cc=akpm@linux-foundation.org \
--cc=axboe@kernel.dk \
--cc=bjorn.topel@intel.com \
--cc=boaz@plexistor.com \
--cc=bpf@vger.kernel.org \
--cc=dan.j.williams@intel.com \
--cc=daniel@ffwll.ch \
--cc=davem@davemloft.net \
--cc=david@fromorbit.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=idryomov@gmail.com \
--cc=jack@suse.cz \
--cc=jgg@ziepe.ca \
--cc=jglisse@redhat.com \
--cc=jhubbard@nvidia.com \
--cc=john.hubbard@gmail.com \
--cc=jthumshirn@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-rdma@vger.kernel.org \
--cc=magnus.karlsson@intel.com \
--cc=miklos@szeredi.hu \
--cc=ming.lei@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=sage@redhat.com \
--cc=santosh.shilimkar@oracle.com \
--cc=viro@zeniv.linux.org.uk \
--cc=willy@infradead.org \
--cc=zyan@redhat.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.