Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3406401pxb; Mon, 25 Jan 2021 15:38:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJxxwLn2+loGmXO2+MrlCnJy9Zp4miO4/rpfn80nX6jRI2J51OZTVwUzMgunvbdUfqUt5kgg X-Received: by 2002:a50:852a:: with SMTP id 39mr2492527edr.114.1611617893468; Mon, 25 Jan 2021 15:38:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611617893; cv=none; d=google.com; s=arc-20160816; b=StXtgfGsc1mcSx8yzam7OzqfibEMwO9AmQL/7Go4GJF60ED3Y/FfUYcbwzl7FGPdqt kYYSrYwfpodb2CtjdzIvWhlcutHbdtsx60MfL2kcblvmxZ/Xzh6dqBjzVycfoofLi5Di cE0RvhgrUWKbB0VQEsB+rN41NifZf2KHsjN5ZZXu2AOXDwS21GAoJ7v/2W7Virv0BQ+w bY2xx5784t2PO8SBfnQeuuAFLR/WvrfSRix9BqqYSGCwhVV3OfPjbVY/p/UHMxYHOsBc m7oBdhqAiLPJ2lT8799uv1AAfMZOp3QdsLYwlkPYMt7qI8ijmSTieNBFYlChkP6jQ4kp x2tA== 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=hNJtHAvNQHxPS4o+dbfK9nIR9AHzAlHjUQmOYYhtqTE=; b=L1l1ufPWw7qAugQ1udjJyMm5X7tbt6GWqB91rovut8sV8XpPsfOvR+/ipS7brvuBZL blU6aTn5sHEQdSG/p4Ud7CKQzb2r+ZVf5dJGeVOwDJxS2GZrD3GprOvEA+NzFwHd7HM3 w/uqapGlGikwKqAXEbGFijRygIiCtFElqMwkd91W9GBPqWBcMDMbgxYG5YH48KkwxBzD gFs+PyPw9nQbcjyeinKLEjBvBKKsPL5cTfrcoE2GZOr2SY6DXx/O0zTBo/H5Xq+W0UYJ P39d6dVRWpN5WCWK6OnlAjSBG4yH8/OUu3reIBXIHi5oV0B1lxAXEvdmcG/mC6jwRVNH dH1Q== 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 k18si227334eds.608.2021.01.25.15.37.48; Mon, 25 Jan 2021 15:38:13 -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 S1732670AbhAYXgw convert rfc822-to-8bit (ORCPT + 99 others); Mon, 25 Jan 2021 18:36:52 -0500 Received: from szxga02-in.huawei.com ([45.249.212.188]:2990 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732939AbhAYXgh (ORCPT ); Mon, 25 Jan 2021 18:36:37 -0500 Received: from DGGEMM404-HUB.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4DPmRG2ZPfzR7MJ; Tue, 26 Jan 2021 07:34:18 +0800 (CST) Received: from dggpemm100010.china.huawei.com (7.185.36.24) by DGGEMM404-HUB.china.huawei.com (10.3.20.212) with Microsoft SMTP Server (TLS) id 14.3.498.0; Tue, 26 Jan 2021 07:35:23 +0800 Received: from dggemi761-chm.china.huawei.com (10.1.198.147) by dggpemm100010.china.huawei.com (7.185.36.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2106.2; Tue, 26 Jan 2021 07:35:22 +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; Tue, 26 Jan 2021 07:35:22 +0800 From: "Song Bao Hua (Barry Song)" To: Jason Gunthorpe CC: "Wangzhou (B)" , Greg Kroah-Hartman , Arnd Bergmann , Zhangfei Gao , "linux-accelerators@lists.ozlabs.org" , "linux-kernel@vger.kernel.org" , "iommu@lists.linux-foundation.org" , "linux-mm@kvack.org" , "Liguozhu (Kenneth)" , "chensihang (A)" Subject: RE: [RFC PATCH v2] uacce: Add uacce_ctrl misc device Thread-Topic: [RFC PATCH v2] uacce: Add uacce_ctrl misc device Thread-Index: AQHW8vWniUnMS+RFOU2UJJCa8sDlvKo39q+AgADtcaD//5AFgIAAh9tQ Date: Mon, 25 Jan 2021 23:35:22 +0000 Message-ID: <5f64a68042c64f37b5cba74028bd2189@hisilicon.com> References: <1611563696-235269-1-git-send-email-wangzhou1@hisilicon.com> <20210125154717.GW4605@ziepe.ca> <96b655ade2534a65974a378bb68383ee@hisilicon.com> <20210125231619.GY4605@ziepe.ca> In-Reply-To: <20210125231619.GY4605@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.203.227] 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: owner-linux-mm@kvack.org [mailto:owner-linux-mm@kvack.org] On Behalf Of > Jason Gunthorpe > Sent: Tuesday, January 26, 2021 12:16 PM > To: Song Bao Hua (Barry Song) > Cc: Wangzhou (B) ; Greg Kroah-Hartman > ; Arnd Bergmann ; Zhangfei Gao > ; linux-accelerators@lists.ozlabs.org; > linux-kernel@vger.kernel.org; iommu@lists.linux-foundation.org; > linux-mm@kvack.org; Liguozhu (Kenneth) ; chensihang > (A) > Subject: Re: [RFC PATCH v2] uacce: Add uacce_ctrl misc device > > On Mon, Jan 25, 2021 at 10:21:14PM +0000, Song Bao Hua (Barry Song) wrote: > > mlock, while certainly be able to prevent swapping out, it won't > > be able to stop page moving due to: > > * memory compaction in alloc_pages() > > * making huge pages > > * numa balance > > * memory compaction in CMA > > Enabling those things is a major reason to have SVA device in the > first place, providing a SW API to turn it all off seems like the > wrong direction. I wouldn't say this is a major reason to have SVA. If we read the history of SVA and papers, people would think easy programming due to data struct sharing between cpu and device, and process space isolation in device would be the major reasons for SVA. SVA also declares it supports zero-copy while zero-copy doesn't necessarily depend on SVA. Page migration and I/O page fault overhead, on the other hand, would probably be the major problems which block SVA becoming a high-performance and more popular solution. > > If the device doesn't want to use SVA then don't use it, use normal > DMA pinning like everything else. > If we disable SVA, we won't get the benefits of SVA on address sharing, and process space isolation. > Jason Thanks Barry