Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3569298pxb; Sun, 7 Feb 2021 14:29:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJyU8zpj7rPDA+obRVOpBjx+L7u0T5CCIxjdyPzyUNB3r8g+EYbFR5S4OPQ/vy1aDPROx3mK X-Received: by 2002:a17:906:c051:: with SMTP id bm17mr1209970ejb.493.1612736952650; Sun, 07 Feb 2021 14:29:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612736952; cv=none; d=google.com; s=arc-20160816; b=WE09BgCT1THQ7sOw8raZsy40rPl8Kylu+R3OeAA2mfiPjyf24OJ/+50Ttmthxxlwk8 ms+Lfn1PdaEcH98sEN7aF7FGZbsq69XWQuZT3rTrkBIIEt3YYPJec+Df3l0/ZptMMl4L Ken/DnD9j1jKQEpNIY3B40aI/QE0YW4nv9Y7gYW08nazU1bJj2Ag7WkG7FSzOLlzTLf5 6vnbINEepJxhlsimMvfkK4w9OF5j5IBNWSGOfgouLVRz9riykA3sxyztUG4kpHQv+b/+ CVm/F8aDHBemh6vDb27QqlN5wZyEHl48AeY9mG9EutzrUIvunLCWANCh95NQCQ/xN6d2 6eIw== 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=IlW+LAHCQM+5Hj3fWBOdEknsmVcsnEuCEyXvzjBSjTI=; b=FK91q9TBuf53TyP+heoRtVveHRA20Mal6aAsypETngOyJtJn/PlchL7L8hxufWjoNi RmGB7YFX9i/V/hYFs0OKNfJmo+UlJqDNFugnwnBWl2sCeKKOAfIGExNecKH/VkIGuDPc GnyKDHo6a6v1K/lWKdB5YRGxQhIiM1KdGN5ppGaCw0uDcxcFr/7ud6oxctBb8NaCqt3Y jeiRHS1XQ4USLAODZqjn/2sqpnWdEFX57v+sZmxCfuadp79NdGGAcYFOTeystdQ3J3pO YlSdeosDD+yj0R7SqJhCBsradi0FcwymAN4i8Mzx1MuiAjD0AXf41663apP0cwrHKtTy 0Dsw== 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 cf5si3039850ejb.684.2021.02.07.14.28.49; Sun, 07 Feb 2021 14:29:12 -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 S229636AbhBGWZS convert rfc822-to-8bit (ORCPT + 99 others); Sun, 7 Feb 2021 17:25:18 -0500 Received: from szxga01-in.huawei.com ([45.249.212.187]:4612 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229611AbhBGWZP (ORCPT ); Sun, 7 Feb 2021 17:25:15 -0500 Received: from DGGEMM404-HUB.china.huawei.com (unknown [172.30.72.54]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4DYkFH2dR4zY664; Mon, 8 Feb 2021 06:23:15 +0800 (CST) Received: from dggpemm100012.china.huawei.com (7.185.36.212) by DGGEMM404-HUB.china.huawei.com (10.3.20.212) with Microsoft SMTP Server (TLS) id 14.3.498.0; Mon, 8 Feb 2021 06:24:29 +0800 Received: from dggemi761-chm.china.huawei.com (10.1.198.147) by dggpemm100012.china.huawei.com (7.185.36.212) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2106.2; Mon, 8 Feb 2021 06:24:29 +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; Mon, 8 Feb 2021 06:24:29 +0800 From: "Song Bao Hua (Barry Song)" To: Matthew Wilcox , "Wangzhou (B)" CC: "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" , "jgg@ziepe.ca" , "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/SrsWWMRpilf2UC1Pz29QqsBVqpMsX2AgACQE1A= Date: Sun, 7 Feb 2021 22:24:28 +0000 Message-ID: References: <1612685884-19514-1-git-send-email-wangzhou1@hisilicon.com> <1612685884-19514-2-git-send-email-wangzhou1@hisilicon.com> <20210207213409.GL308988@casper.infradead.org> In-Reply-To: <20210207213409.GL308988@casper.infradead.org> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.126.200.200] 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: Matthew Wilcox [mailto:willy@infradead.org] > Sent: Monday, February 8, 2021 10:34 AM > To: Wangzhou (B) > Cc: 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; Song > Bao Hua (Barry Song) ; jgg@ziepe.ca; > 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 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 latency of IO page fault is relatively big, DMA > > performance will be affected severely when there are IO page faults. > > >From a long term view, DMA performance will be not stable. > > > > 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 this > > requirement, e.g. mlock can only avoid memory to swap to backup device, > > page migration can still trigger IO page fault. > > Well ... we have two requirements. The application wants to not take > page faults. The system wants to move the application to a different > NUMA node in order to optimise overall performance. Why should the > application's desires take precedence over the kernel's desires? And why > should it be done this way rather than by the sysadmin using numactl to > lock the application to a particular node? 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: * memory move due to CMA * memory move due to huge pages creation Hardly we can ask users to disable the COMPACTION, CMA and Huge Page in the whole system. On the other hand, numactl doesn't always bind memory to single NUMA node, sometimes, while applications require many cpu, it could bind more than one memory node. Thanks Barry