Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp931441pxb; Tue, 9 Feb 2021 17:06:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJwBd3UH44NihSUcubcIhqbGyVlt7ZTBenq3Pm8+SEqxj2pdbvAJLHqkmb9RzHq3hrVyZCZU X-Received: by 2002:a17:906:76c9:: with SMTP id q9mr446158ejn.484.1612919183163; Tue, 09 Feb 2021 17:06:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612919183; cv=none; d=google.com; s=arc-20160816; b=WfeLb7eaq7oVNfhB/lHbCoFkUFqymPz7Gt8+AgtbyvQdjqBwN7A0m/sLXfesSM6MtX LeUt3JxKvVX1WzcjwaIIdbLfz1HLoBkAu3f8trIzYPT0/qcIF26QgZCgh529EXdb/VN1 ZmS/vySUeMQR9UaVlkqZy0KvDRV91G97ZTT0Zf9zbpUQDUG6mIURgZkM+drNPn7QUaQ1 LApAAbPQqcdzcYHYjqWMUvdga8JBTsqaIFQRJ5mWwd9qqnrBCG007lrQ+pt/TH2af8t5 1NTqHfxc21bkILRPkFA5Kc9OXGk0mWuuTUYBKN1+4+s9LbGOnYAJsokoRjx8bPNZWf6P WJxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from; bh=hPw6J418gRSNZqMMMeH56uuVIfdin/blX8+ByTyX/xk=; b=vKn+Y73LUejxvzqLN/zy33I53DAyyFg6g478NLfd39dgZs/VZh5qSOLl5RfdVIKTiT 7Ja5j4Id6OtEjKqBzkQkUD1FCb/zK7kkdLqPGHnQuB0c7J/Rwl7ygM08hUthtj0RFHH9 +hDNT9Ps1bwebkj4kGoxbo6QLooWs1IeB+I0ik9dFDNd8WzXmuH6PMjXD9L2soPOM44N 7bWCk9OTInBrgmPcHmkBwzdlSLJppsfUJb3eyxEma66mFhPy9AO57bGgZqkOU768apoL OO2ealJonk1yW3gUVqxOV+PSqbJRyjbHuJ+/RL5Lu6mxY1hkCqj1VbkTmgzwXNi4ijRc E+oA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g7si360516edh.31.2021.02.09.17.05.59; Tue, 09 Feb 2021 17:06:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233354AbhBJBEb convert rfc822-to-8bit (ORCPT + 99 others); Tue, 9 Feb 2021 20:04:31 -0500 Received: from szxga03-in.huawei.com ([45.249.212.189]:2895 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234352AbhBIWXs (ORCPT ); Tue, 9 Feb 2021 17:23:48 -0500 Received: from DGGEMM401-HUB.china.huawei.com (unknown [172.30.72.54]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4DZy5p3j1qz5KDt; Wed, 10 Feb 2021 06:21:02 +0800 (CST) Received: from dggpemm500011.china.huawei.com (7.185.36.110) by DGGEMM401-HUB.china.huawei.com (10.3.20.209) with Microsoft SMTP Server (TLS) id 14.3.498.0; Wed, 10 Feb 2021 06:22:48 +0800 Received: from dggemi761-chm.china.huawei.com (10.1.198.147) by dggpemm500011.china.huawei.com (7.185.36.110) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2106.2; Wed, 10 Feb 2021 06:22:47 +0800 Received: from dggemi761-chm.china.huawei.com ([10.9.49.202]) by dggemi761-chm.china.huawei.com ([10.9.49.202]) with mapi id 15.01.2106.006; Wed, 10 Feb 2021 06:22:47 +0800 From: "Song Bao Hua (Barry Song)" To: Jason Gunthorpe CC: David Hildenbrand , "Wangzhou (B)" , "linux-kernel@vger.kernel.org" , "iommu@lists.linux-foundation.org" , "linux-mm@kvack.org" , "linux-arm-kernel@lists.infradead.org" , "linux-api@vger.kernel.org" , Andrew Morton , Alexander Viro , "gregkh@linuxfoundation.org" , "kevin.tian@intel.com" , "jean-philippe@linaro.org" , "eric.auger@redhat.com" , "Liguozhu (Kenneth)" , "zhangfei.gao@linaro.org" , "chensihang (A)" Subject: RE: [RFC PATCH v3 1/2] mempinfd: Add new syscall to provide memory pin Thread-Topic: [RFC PATCH v3 1/2] mempinfd: Add new syscall to provide memory pin Thread-Index: AQHW/SrsWWMRpilf2UC1Pz29QqsBVqpNZGQAgACtCgCAAKKukP//jqmAgADcIzCAADaMgIABCrxA Date: Tue, 9 Feb 2021 22:22:47 +0000 Message-ID: <2527b4ac8df14fa1b427bef65dace719@hisilicon.com> References: <1612685884-19514-1-git-send-email-wangzhou1@hisilicon.com> <1612685884-19514-2-git-send-email-wangzhou1@hisilicon.com> <20210208183348.GV4718@ziepe.ca> <0dca000a6cd34d8183062466ba7d6eaf@hisilicon.com> <20210208213023.GZ4718@ziepe.ca> <0868d209d7424942a46d1238674cf75d@hisilicon.com> <20210209135331.GF4718@ziepe.ca> In-Reply-To: <20210209135331.GF4718@ziepe.ca> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.126.202.77] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > -----Original Message----- > From: Jason Gunthorpe [mailto:jgg@ziepe.ca] > Sent: Wednesday, February 10, 2021 2:54 AM > To: Song Bao Hua (Barry Song) > Cc: David Hildenbrand ; Wangzhou (B) > ; linux-kernel@vger.kernel.org; > iommu@lists.linux-foundation.org; linux-mm@kvack.org; > linux-arm-kernel@lists.infradead.org; linux-api@vger.kernel.org; Andrew > Morton ; Alexander Viro ; > gregkh@linuxfoundation.org; kevin.tian@intel.com; jean-philippe@linaro.org; > eric.auger@redhat.com; Liguozhu (Kenneth) ; > zhangfei.gao@linaro.org; chensihang (A) > 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