Re: [PATCH 2/5] vfio/spapr_tce: use pinned_vm instead of locked_vm to account pinned pages

2019-02-12 Thread Alexey Kardashevskiy
On 13/02/2019 04:18, Daniel Jordan wrote: > On Tue, Feb 12, 2019 at 04:50:11PM +, Christopher Lameter wrote: >> On Tue, 12 Feb 2019, Alexey Kardashevskiy wrote: >> >>> Now it is 3 independent accesses (actually 4 but the last one is >>> diagnostic) with no locking around them. Why do not we

Re: [PATCH 2/5] vfio/spapr_tce: use pinned_vm instead of locked_vm to account pinned pages

2019-02-12 Thread Alexey Kardashevskiy
On 13/02/2019 05:56, Alex Williamson wrote: > On Tue, 12 Feb 2019 17:56:18 +1100 > Alexey Kardashevskiy wrote: > >> On 12/02/2019 09:44, Daniel Jordan wrote: >>> Beginning with bc3e53f682d9 ("mm: distinguish between mlocked and pinned >>> pages"), locked and pinned pages are accounted

Re: [PATCH 2/5] vfio/spapr_tce: use pinned_vm instead of locked_vm to account pinned pages

2019-02-12 Thread Alex Williamson
On Tue, 12 Feb 2019 17:56:18 +1100 Alexey Kardashevskiy wrote: > On 12/02/2019 09:44, Daniel Jordan wrote: > > Beginning with bc3e53f682d9 ("mm: distinguish between mlocked and pinned > > pages"), locked and pinned pages are accounted separately. The SPAPR > > TCE VFIO IOMMU driver accounts

Re: [PATCH 2/5] vfio/spapr_tce: use pinned_vm instead of locked_vm to account pinned pages

2019-02-12 Thread Daniel Jordan
On Tue, Feb 12, 2019 at 04:50:11PM +, Christopher Lameter wrote: > On Tue, 12 Feb 2019, Alexey Kardashevskiy wrote: > > > Now it is 3 independent accesses (actually 4 but the last one is > > diagnostic) with no locking around them. Why do not we need a lock > > anymore precisely? Thanks, > >

Re: [PATCH 2/5] vfio/spapr_tce: use pinned_vm instead of locked_vm to account pinned pages

2019-02-12 Thread Christopher Lameter
On Tue, 12 Feb 2019, Alexey Kardashevskiy wrote: > Now it is 3 independent accesses (actually 4 but the last one is > diagnostic) with no locking around them. Why do not we need a lock > anymore precisely? Thanks, Updating a regular counter is racy and requires a lock. It was converted to be an

Re: [PATCH 2/5] vfio/spapr_tce: use pinned_vm instead of locked_vm to account pinned pages

2019-02-11 Thread Alexey Kardashevskiy
On 12/02/2019 09:44, Daniel Jordan wrote: > Beginning with bc3e53f682d9 ("mm: distinguish between mlocked and pinned > pages"), locked and pinned pages are accounted separately. The SPAPR > TCE VFIO IOMMU driver accounts pinned pages to locked_vm; use pinned_vm > instead. > > pinned_vm