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

Song Bao Hua (Barry Song) song.bao.hua at hisilicon.com
Tue Feb 9 17:22:47 EST 2021



> -----Original Message-----
> From: Jason Gunthorpe [mailto:jgg at ziepe.ca]
> Sent: Wednesday, February 10, 2021 2:54 AM
> To: Song Bao Hua (Barry Song) <song.bao.hua at hisilicon.com>
> Cc: David Hildenbrand <david at redhat.com>; Wangzhou (B)
> <wangzhou1 at hisilicon.com>; linux-kernel at vger.kernel.org;
> iommu at lists.linux-foundation.org; linux-mm at kvack.org;
> linux-arm-kernel at lists.infradead.org; linux-api at vger.kernel.org; Andrew
> Morton <akpm at linux-foundation.org>; Alexander Viro <viro at zeniv.linux.org.uk>;
> gregkh at linuxfoundation.org; kevin.tian at intel.com; jean-philippe at linaro.org;
> eric.auger at redhat.com; Liguozhu (Kenneth) <liguozhu at hisilicon.com>;
> zhangfei.gao at linaro.org; chensihang (A) <chensihang1 at hisilicon.com>
> Subject: Re: [RFC PATCH v3 1/2] mempinfd: Add new syscall to provide memory
> pin
> 
> On Tue, Feb 09, 2021 at 03:01:42AM +0000, 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.

Fortunately or unfortunately, I think my people have this target to have
a lower-latency and more stable zip/encryption by using accelerators,
otherwise, they are going to use CPU directly if there is no advantage
of accelerators.

> 
> If this is an important problem then it should apply equally to CPU
> and IO jitter.
> 
> Honestly I find the idea that occasional migration jitters CPU and DMA
> to not be very compelling. Such specialized applications should
> allocate special pages to avoid this, not adding an API to be able to
> lock down any page

That is exactly what we have done to provide a hugeTLB pool so that
applications can allocate memory from this pool.

+-------------------------------------------+
 |                                           |
 |applications using accelerators            |
 +-------------------------------------------+


     alloc from pool             free to pool
           +                      ++
           |                       |
           |                       |
           |                       |
           |                       |
           |                       |
           |                       |
           |                       |
+----------+-----------------------+---------+
|                                            |
|                                            |
|      HugeTLB memory pool                   |
|                                            |
|                                            |
+--------------------------------------------+

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 generically for applications such as Nginx, Ceph.

I am also thinking about leveraging vm.compact_unevictable_allowed
which David suggested and making an extension on it, for example,
permit users to disable compaction and numa balancing on unevictable
pages of SVA process,  which might be a smaller deal.

> 
> Jason

Thanks
Barry




More information about the linux-arm-kernel mailing list