Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3644407pxb; Sun, 7 Feb 2021 17:33:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJzEAXFl8+ashX2bRJZ/Ctlf5dyu8+rTupKzk4kdJOx+flQ02VYOQT9/mw97ka5tK8pcEIZs X-Received: by 2002:a17:906:17d7:: with SMTP id u23mr14819411eje.390.1612748015777; Sun, 07 Feb 2021 17:33:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612748015; cv=none; d=google.com; s=arc-20160816; b=KZwq0EcgEC9/Rmkt1wckJyfIDmzspZkCtZWT3J5AcTITtiBc9D/GbFy8vTdmLJESoq aq4wf4BjDO2p5+MkHG/uuyuQphu/Qdokfi5lq9Q7/gt9P8pdTzMC+yK97qzAk6b6ubj9 +xRfKhPf28GCFyvtKUoOK2KFr8ojft3ZLh9herr7l+ecmWtTPPEo5mikkxNt/GpvXa8m K5xOG48v4Uut4Ff0Z21eKfE64suh3hYDMBfMWsjUIYnjYQy9D7qme2GzDkiES2zR5B7l utA5vfcOlTcnngzCiUD1+r54NCtZHU53gRXCIWuAxjgsCnJ9YfwQ59jms5hTDtEvLlm3 +5RQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=lD7QVBDoo2n3B5TjjWe/LazElHNVpG8lB7yZkwrFfwc=; b=ybPzdNy1hp0zwK55+6vvwU174h2DvPP4Dda5ikSpjyvXcXL3TDP5VRxLfRH/jXzUwk Dc+oZ4d9Khzulf5DJpkOhhRyk/ScP95HOxDNbmfEbhZlB3KZKUWbDQOKHHu+DuBJsOjk aR+ud+LDqg/2W4anCeogqNhPpr3HeICABkyp7ob9gD1zVb6NYIsurGCISDqxoKOqeKCz WCH4K15kKwwxeFo5BODfYRA2y3N3XCGIByEp7ZSpRedrmRBsVm2kf8JCNfGe4POpFVfE 1kGzIWN28+ybahryeDtVYu17aa3uhFFqkWDdiwBHHDsMmRQpFo7qz109aDHaXASMXaik 1vUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=MaJMVf61; 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 k11si10060007ejr.403.2021.02.07.17.33.12; Sun, 07 Feb 2021 17:33:35 -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; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=MaJMVf61; 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 S229615AbhBHBbp (ORCPT + 99 others); Sun, 7 Feb 2021 20:31:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45464 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229565AbhBHBbo (ORCPT ); Sun, 7 Feb 2021 20:31:44 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 32742C06174A; Sun, 7 Feb 2021 17:31:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=lD7QVBDoo2n3B5TjjWe/LazElHNVpG8lB7yZkwrFfwc=; b=MaJMVf613EdZuXmqlYeAtKUuHj Y1do0olDL4LMFLRLVerYvQCug2SqeQLzlJ8NzAPMCYrVBJXRHGDVz1tBDYWcSrGha+Tpu2Id7Mtmm tAb30QyZmu9ZhJbiEFOIz6GuKN9xCRRdCA7HEDU1qVgg6i70eTyQ6rIDgtWwoHGBH+uoN6zydBL34 Iab+t9xLe8qt8LfgKIYJfpN3O3pxnioA+yvAVnarVxjSkWY8vd+QbOn/hiVTlV8NwZ9qDHhFP/Jwe TUnXf6m8p5iH6eMf9YUnyVUZOfuEb/040qR0nuT1cb7GOibjLaWDBaVjiK0x5J/FvBH86/Fg3M9pP yn9SsJ6Q==; Received: from willy by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1l8vOC-005L6R-9O; Mon, 08 Feb 2021 01:30:56 +0000 Date: Mon, 8 Feb 2021 01:30:56 +0000 From: Matthew Wilcox To: "Song Bao Hua (Barry Song)" Cc: "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" , "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 Message-ID: <20210208013056.GM308988@casper.infradead.org> References: <1612685884-19514-1-git-send-email-wangzhou1@hisilicon.com> <1612685884-19514-2-git-send-email-wangzhou1@hisilicon.com> <20210207213409.GL308988@casper.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Feb 07, 2021 at 10:24:28PM +0000, 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 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. You're dodging the question. Should the CMA allocation fail because another application is using SVA? I would say no. The application using SVA should take the one-time performance hit from having its memory moved around.