Re: [RFC PATCH v3 1/2] mempinfd: Add new syscall to provide memory pin

2021-02-11 Thread David Hildenbrand
Again in proper SVA it should be quite unlikely to take a fault caused by something like migration, on the same likelyhood as the CPU. If things are faulting so much this is a problem then I think it is a system level problem with doing too much page motion. My point is that single one SVA appl

RE: [RFC PATCH v3 1/2] mempinfd: Add new syscall to provide memory pin

2021-02-10 Thread Song Bao Hua (Barry Song)
ubject: Re: [RFC PATCH v3 1/2] mempinfd: Add new syscall to provide memory > pin > > On Tue, Feb 09, 2021 at 10:22:47PM +, Song Bao Hua (Barry Song) wrote: > > > The problem is that SVA declares we can use any memory of a process > > to do I/O. And in real scenarios, we

Re: [RFC PATCH v3 1/2] mempinfd: Add new syscall to provide memory pin

2021-02-10 Thread Matthew Wilcox
On Tue, Feb 09, 2021 at 08:20:18PM +0800, Zhou Wang wrote: > Agree, will add it in next version. No, don't do another version. Jason is right, this approach is wrong. The point of SVA is that it doesn't require the application to do anything special. If jitter from too-frequent page migration is

Re: [RFC PATCH v3 1/2] mempinfd: Add new syscall to provide memory pin

2021-02-10 Thread Jason Gunthorpe
On Tue, Feb 09, 2021 at 10:22:47PM +, Song Bao Hua (Barry Song) wrote: > The problem is that SVA declares we can use any memory of a process > to do I/O. And in real scenarios, we are unable to customize most > applications to make them use the pool. So we are looking for some > extension gene

RE: [RFC PATCH v3 1/2] mempinfd: Add new syscall to provide memory pin

2021-02-09 Thread Song Bao Hua (Barry Song)
ubject: Re: [RFC PATCH v3 1/2] mempinfd: Add new syscall to provide memory > pin > > On Tue, Feb 09, 2021 at 03:01:42AM +, Song Bao Hua (Barry Song) wrote: > > > On the other hand, wouldn't it be the benefit of hardware accelerators > > to have a lower and mo

Re: [RFC PATCH v3 1/2] mempinfd: Add new syscall to provide memory pin

2021-02-09 Thread Jason Gunthorpe
On Tue, Feb 09, 2021 at 03:01:42AM +, Song Bao Hua (Barry Song) wrote: > On the other hand, wouldn't it be the benefit of hardware accelerators > to have a lower and more stable latency zip/encryption than CPU? No, I don't think so. If this is an important problem then it should apply equall

Re: [RFC PATCH v3 1/2] mempinfd: Add new syscall to provide memory pin

2021-02-09 Thread Zhou Wang
On 2021/2/9 20:01, Greg KH wrote: > On Tue, Feb 09, 2021 at 07:58:15PM +0800, Zhou Wang wrote: >> On 2021/2/9 17:37, Greg KH wrote: >>> On Tue, Feb 09, 2021 at 05:17:46PM +0800, Zhou Wang wrote: On 2021/2/8 6:02, Andy Lutomirski wrote: > > >> On Feb 7, 2021, at 12:31 AM, Zhou Wang

Re: [RFC PATCH v3 1/2] mempinfd: Add new syscall to provide memory pin

2021-02-09 Thread Greg KH
On Tue, Feb 09, 2021 at 07:58:15PM +0800, Zhou Wang wrote: > On 2021/2/9 17:37, Greg KH wrote: > > On Tue, Feb 09, 2021 at 05:17:46PM +0800, Zhou Wang wrote: > >> On 2021/2/8 6:02, Andy Lutomirski wrote: > >>> > >>> > On Feb 7, 2021, at 12:31 AM, Zhou Wang wrote: > > SVA(share virt

Re: [RFC PATCH v3 1/2] mempinfd: Add new syscall to provide memory pin

2021-02-09 Thread Zhou Wang
On 2021/2/9 17:37, Greg KH wrote: > On Tue, Feb 09, 2021 at 05:17:46PM +0800, Zhou Wang wrote: >> On 2021/2/8 6:02, Andy Lutomirski wrote: >>> >>> On Feb 7, 2021, at 12:31 AM, Zhou Wang wrote: SVA(share virtual address) offers a way for device to share process virtual ad

Re: [RFC PATCH v3 1/2] mempinfd: Add new syscall to provide memory pin

2021-02-09 Thread Greg KH
On Tue, Feb 09, 2021 at 05:17:46PM +0800, Zhou Wang wrote: > On 2021/2/8 6:02, Andy Lutomirski wrote: > > > > > >> On Feb 7, 2021, at 12:31 AM, Zhou Wang wrote: > >> > >> SVA(share virtual address) offers a way for device to share process > >> virtual > >> address space safely, which makes mor

Re: [RFC PATCH v3 1/2] mempinfd: Add new syscall to provide memory pin

2021-02-09 Thread Zhou Wang
On 2021/2/8 5:51, Arnd Bergmann wrote: > On Sun, Feb 7, 2021 at 9:18 AM Zhou Wang wrote: > >> diff --git a/arch/arm64/include/asm/unistd32.h >> b/arch/arm64/include/asm/unistd32.h >> index cccfbbe..3f49529 100644 >> --- a/arch/arm64/include/asm/unistd32.h >> +++ b/arch/arm64/include/asm/unistd32

Re: [RFC PATCH v3 1/2] mempinfd: Add new syscall to provide memory pin

2021-02-09 Thread Zhou Wang
On 2021/2/8 6:02, Andy Lutomirski wrote: > > >> On Feb 7, 2021, at 12:31 AM, Zhou Wang wrote: >> >> SVA(share virtual address) offers a way for device to share process virtual >> address space safely, which makes more convenient for user space device >> driver coding. However, IO page faults ma

RE: [RFC PATCH v3 1/2] mempinfd: Add new syscall to provide memory pin

2021-02-08 Thread Song Bao Hua (Barry Song)
gt; ; > > > gre...@linuxfoundation.org; Song Bao Hua (Barry Song) > > > ; kevin.t...@intel.com; > > > jean-phili...@linaro.org; eric.au...@redhat.com; Liguozhu (Kenneth) > > > ; zhangfei@linaro.org; chensihang (A) > > > > > > Subject: Re:

Re: [RFC PATCH v3 1/2] mempinfd: Add new syscall to provide memory pin

2021-02-08 Thread Jason Gunthorpe
...@linaro.org; eric.au...@redhat.com; Liguozhu (Kenneth) > > ; zhangfei....@linaro.org; chensihang (A) > > > > Subject: Re: [RFC PATCH v3 1/2] mempinfd: Add new syscall to provide memory > > pin > > > > On Mon, Feb 08, 2021 at 09:14:28AM +0100, David Hildenbran

RE: [RFC PATCH v3 1/2] mempinfd: Add new syscall to provide memory pin

2021-02-08 Thread Song Bao Hua (Barry Song)
linux...@kvack.org; > >> linux-arm-ker...@lists.infradead.org; linux-...@vger.kernel.org; Andrew > >> Morton ; Alexander Viro > ; > >> gre...@linuxfoundation.org; j...@ziepe.ca; kevin.t...@intel.com; > >> jean-phili...@linaro.org; eric.au...@redhat.com; Liguozhu (Ke

RE: [RFC PATCH v3 1/2] mempinfd: Add new syscall to provide memory pin

2021-02-08 Thread Song Bao Hua (Barry Song)
; Subject: Re: [RFC PATCH v3 1/2] mempinfd: Add new syscall to provide memory > pin > > On Mon, Feb 08, 2021 at 09:14:28AM +0100, David Hildenbrand wrote: > > > People are constantly struggling with the effects of long term pinnings > > under user space control, like we al

Re: [RFC PATCH v3 1/2] mempinfd: Add new syscall to provide memory pin

2021-02-08 Thread Jason Gunthorpe
On Mon, Feb 08, 2021 at 09:14:28AM +0100, David Hildenbrand wrote: > People are constantly struggling with the effects of long term pinnings > under user space control, like we already have with vfio and RDMA. > > And here we are, adding yet another, easier way to mess with core MM in the > same

Re: [RFC PATCH v3 1/2] mempinfd: Add new syscall to provide memory pin

2021-02-08 Thread David Hildenbrand
(Kenneth) ; zhangfei@linaro.org; chensihang (A) Subject: Re: [RFC PATCH v3 1/2] mempinfd: Add new syscall to provide memory pin On 08.02.21 03:27, Song Bao Hua (Barry Song) wrote: -Original Message- From: owner-linux...@kvack.org [mailto:owner-linux...@kvack.org] On Behalf Of Matthew

RE: [RFC PATCH v3 1/2] mempinfd: Add new syscall to provide memory pin

2021-02-08 Thread Song Bao Hua (Barry Song)
Kenneth) > ; zhangfei@linaro.org; chensihang (A) > > Subject: Re: [RFC PATCH v3 1/2] mempinfd: Add new syscall to provide memory > pin > > On 08.02.21 03:27, Song Bao Hua (Barry Song) wrote: > > > > > >> -Original Message- > >> From: ow

Re: [RFC PATCH v3 1/2] mempinfd: Add new syscall to provide memory pin

2021-02-08 Thread David Hildenbrand
@linaro.org; chensihang (A) Subject: Re: [RFC PATCH v3 1/2] mempinfd: Add new syscall to provide memory pin On Sun, Feb 07, 2021 at 10:24:28PM +, Song Bao Hua (Barry Song) wrote: In high-performance I/O cases, accelerators might want to perform I/O on a memory without IO page faults which can

Re: [RFC PATCH v3 1/2] mempinfd: Add new syscall to provide memory pin

2021-02-08 Thread David Hildenbrand
On 07.02.21 09:18, Zhou Wang wrote: SVA(share virtual address) offers a way for device to share process virtual address space safely, which makes more convenient for user space device driver coding. However, IO page faults may happen when doing DMA operations. As the latency of IO page fault is r

RE: [RFC PATCH v3 1/2] mempinfd: Add new syscall to provide memory pin

2021-02-07 Thread Song Bao Hua (Barry Song)
(A) > > Subject: RE: [RFC PATCH v3 1/2] mempinfd: Add new syscall to provide memory > pin > > On Sun, 7 Feb 2021, Song Bao Hua (Barry Song) wrote: > > > NUMA balancer is just one of many reasons for page migration. Even one > > simple alloc_pages() can cause memory

RE: [RFC PATCH v3 1/2] mempinfd: Add new syscall to provide memory pin

2021-02-07 Thread Song Bao Hua (Barry Song)
angfei@linaro.org; chensihang (A) > > Subject: Re: [RFC PATCH v3 1/2] mempinfd: Add new syscall to provide memory > pin > > On Sun, Feb 07, 2021 at 10:24:28PM +, Song Bao Hua (Barry Song) wrote: > > > > In high-performance I/O cases, accelerators might want to perform

RE: [RFC PATCH v3 1/2] mempinfd: Add new syscall to provide memory pin

2021-02-07 Thread David Rientjes via iommu
On Sun, 7 Feb 2021, Song Bao Hua (Barry Song) wrote: > NUMA balancer is just one of many reasons for page migration. Even one > simple alloc_pages() can cause memory migration in just single NUMA > node or UMA system. > > The other reasons for page migration include but are not limited to: > * me

Re: [RFC PATCH v3 1/2] mempinfd: Add new syscall to provide memory pin

2021-02-07 Thread Matthew Wilcox
On Sun, Feb 07, 2021 at 10:24:28PM +, Song Bao Hua (Barry Song) wrote: > > > In high-performance I/O cases, accelerators might want to perform > > > I/O on a memory without IO page faults which can result in dramatically > > > increased latency. Current memory related APIs could not achieve thi

Re: [RFC PATCH v3 1/2] mempinfd: Add new syscall to provide memory pin

2021-02-07 Thread Andy Lutomirski
> On Feb 7, 2021, at 12:31 AM, Zhou Wang wrote: > > SVA(share virtual address) offers a way for device to share process virtual > address space safely, which makes more convenient for user space device > driver coding. However, IO page faults may happen when doing DMA > operations. As the late

RE: [RFC PATCH v3 1/2] mempinfd: Add new syscall to provide memory pin

2021-02-07 Thread Song Bao Hua (Barry Song)
ubject: Re: [RFC PATCH v3 1/2] mempinfd: Add new syscall to provide memory > pin > > On Sun, Feb 07, 2021 at 04:18:03PM +0800, Zhou Wang wrote: > > SVA(share virtual address) offers a way for device to share process virtual > > address space safely, which makes more convenient for

Re: [RFC PATCH v3 1/2] mempinfd: Add new syscall to provide memory pin

2021-02-07 Thread Arnd Bergmann
On Sun, Feb 7, 2021 at 9:18 AM Zhou Wang wrote: > diff --git a/arch/arm64/include/asm/unistd32.h > b/arch/arm64/include/asm/unistd32.h > index cccfbbe..3f49529 100644 > --- a/arch/arm64/include/asm/unistd32.h > +++ b/arch/arm64/include/asm/unistd32.h > @@ -891,6 +891,8 @@ __SYSCALL(__NR_faccessa

Re: [RFC PATCH v3 1/2] mempinfd: Add new syscall to provide memory pin

2021-02-07 Thread Matthew Wilcox
On Sun, Feb 07, 2021 at 04:18:03PM +0800, Zhou Wang wrote: > SVA(share virtual address) offers a way for device to share process virtual > address space safely, which makes more convenient for user space device > driver coding. However, IO page faults may happen when doing DMA > operations. As the

[RFC PATCH v3 1/2] mempinfd: Add new syscall to provide memory pin

2021-02-07 Thread Zhou Wang
SVA(share virtual address) offers a way for device to share process virtual address space safely, which makes more convenient for user space device driver coding. However, IO page faults may happen when doing DMA operations. As the latency of IO page fault is relatively big, DMA performance will be