[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Xen-devel] [PATCH V2 3/7] mm/gup: Change GUP fast to use flags rather than a write 'bool'
- To: ira.weiny@xxxxxxxxx
- From: Jason Gunthorpe <jgg@xxxxxxxx>
- Date: Wed, 13 Feb 2019 16:11:10 -0700
- Cc: Martin Brandenburg <martin@xxxxxxxxxxxx>, linux-fbdev@xxxxxxxxxxxxxxx, Rich Felker <dalias@xxxxxxxx>, kvm@xxxxxxxxxxxxxxx, linux-sh@xxxxxxxxxxxxxxx, David Airlie <airlied@xxxxxxxx>, linux-fpga@xxxxxxxxxxxxxxx, dri-devel@xxxxxxxxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, linux-mm@xxxxxxxxx, Michal Hocko <mhocko@xxxxxxxx>, sparclinux@xxxxxxxxxxxxxxx, Thomas Gleixner <tglx@xxxxxxxxxxxxx>, devel@xxxxxxxxxxxxxxxxxxxx, linux-s390@xxxxxxxxxxxxxxx, rds-devel@xxxxxxxxxxxxxx, Mauro Carvalho Chehab <mchehab@xxxxxxxxxx>, linux-scsi@xxxxxxxxxxxxxxx, linux-rdma@xxxxxxxxxxxxxxx, Joerg Roedel <joro@xxxxxxxxxx>, David Hildenbrand <david@xxxxxxxxxx>, Rob Springer <rspringer@xxxxxxxxxx>, Peter Zijlstra <peterz@xxxxxxxxxxxxx>, Ingo Molnar <mingo@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx, Matt Porter <mporter@xxxxxxxxxxxxxxxxxxx>, Jason Wang <jasowang@xxxxxxxxxx>, devel@xxxxxxxxxxxxxxxxxx, linux-media@xxxxxxxxxxxxxxx, Ben Chan <benchan@xxxxxxxxxxxx>, Alan Tull <atull@xxxxxxxxxx>, Bartlomiej Zolnierkiewicz <b.zolnierkie@xxxxxxxxxxx>, John Hubbard <jhubbard@xxxxxxxxxx>, "James E.J. Bottomley" <jejb@xxxxxxxxxxxxx>, kvm-ppc@xxxxxxxxxxxxxxx, Alex Williamson <alex.williamson@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Borislav Petkov <bp@xxxxxxxxx>, Alexander Viro <viro@xxxxxxxxxxxxxxxxxx>, ceph-devel@xxxxxxxxxxxxxxx, virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx, Kai Mäkisara <Kai.Makisara@xxxxxxxxxxx>, Yoshinori Sato <ysato@xxxxxxxxxxxxxxxxxxxx>, "Martin K. Petersen" <martin.petersen@xxxxxxxxxx>, netdev@xxxxxxxxxxxxxxx, Dennis Dalessandro <dennis.dalessandro@xxxxxxxxx>, Cornelia Huck <cohuck@xxxxxxxxxx>, linux-mips@xxxxxxxxxxxxxxx, Jens Wiklander <jens.wiklander@xxxxxxxxxx>, Alexandre Bounine <alex.bou9@xxxxxxxxx>, Todd Poynor <toddpoynor@xxxxxxxxxx>, "Michael S. Tsirkin" <mst@xxxxxxxxxx>, Daniel Vetter <daniel@xxxxxxxx>, Moritz Fischer <mdf@xxxxxxxxxx>, Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>, Wu Hao <hao.wu@xxxxxxxxx>, linuxppc-dev@xxxxxxxxxxxxxxxx, "David S. Miller" <davem@xxxxxxxxxxxxx>, "Kirill A. Shutemov" <kirill.shutemov@xxxxxxxxxxxxxxx>, Christian Benvenuti <benve@xxxxxxxxx>
- Delivery-date: Wed, 13 Feb 2019 23:11:29 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On Wed, Feb 13, 2019 at 03:04:51PM -0800, ira.weiny@xxxxxxxxx wrote:
> From: Ira Weiny <ira.weiny@xxxxxxxxx>
>
> To facilitate additional options to get_user_pages_fast() change the
> singular write parameter to be gup_flags.
So now we have:
long get_user_pages_unlocked(unsigned long start, unsigned long nr_pages,
struct page **pages, unsigned int gup_flags);
and
int get_user_pages_fast(unsigned long start, int nr_pages,
unsigned int gup_flags, struct page **pages)
Does this make any sense? At least the arguments should be in the same
order, I think.
Also this comment:
/*
* get_user_pages_unlocked() is suitable to replace the form:
*
* down_read(&mm->mmap_sem);
* get_user_pages(tsk, mm, ..., pages, NULL);
* up_read(&mm->mmap_sem);
*
* with:
*
* get_user_pages_unlocked(tsk, mm, ..., pages);
*
* It is functionally equivalent to get_user_pages_fast so
* get_user_pages_fast should be used instead if specific gup_flags
* (e.g. FOLL_FORCE) are not required.
*/
Needs some attention as the recommendation is now nonsense.
Honestly a proper explanation of why two functions exist would be
great at this point :)
Jason
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel
|