Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3702977pxb; Tue, 26 Jan 2021 02:30:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJy/SvnWDJ/58/OELk0s7BVNgisOPZu8F5xtLrnwXa4D7NVFj117L0rt2k4O/b4uzn/1WS4K X-Received: by 2002:a17:906:4d08:: with SMTP id r8mr3238143eju.191.1611657016351; Tue, 26 Jan 2021 02:30:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611657016; cv=none; d=google.com; s=arc-20160816; b=j1DwEm44r1R/qaGfPyfA2LIenAqR0SGF591mXb3bV2RcUTIzCWNtNvaLbPq84bCacU AaTQ7CnBUC+i0ii9yP/RwflET+NAFi3srsB5deqPxCDB+QTO744HlNwQIfaKK6H1IW4h Fiebu0LbbpADy7D0292hXOfkkUN+6NUFUXdTuLD5QxlpOVTjddQWjKuGfD5icW/dYDWY jNRCJK8fL55vedBwS6SLuLt22pFR41r98P9FxTmN9mfdd1vcMzWUI5lPYFBxvC22tBXn mqYtMC/VMDz9uzh2Zy7C7dbPdu3D9NEcwQATnvr8UsaxXPoSH1DmAMCl0FVQC3gqLyhf SqCA== 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=RCicovIuFlmz+ypg8L3PoOuWlGavLF3Xg9FrMyiBxf8=; b=JcWZqVGRVj2vkBH+XukX9XOXSspz84fPP16ibZ76wnZCyVf/7CYcgYy5KK1JJOH2e0 T/1xbaIpWn64UNyh834YSlcy606fjel1OWNgxGPs5sUKubVGRkBZ54cxcHOue6myvV5Z 5K+h++MML8+Q6wAagLTq1l8d/bhwSd0nEKVXoyazDGxVqS+GO9pouBD5veNyqai/vSS2 ZPHQ3DqsOlWYz8zSwCxLaqXMCbxunY5NKPS3DWaACr0Bfn2P8GMesQpS25iU49VlSa+i dJdezikZk0asJEsyofuUOdoBTDhnuVtxhpA8g9xSxLgLRCFZZ00LKzhLpFIbyMu0el4s S0wQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=FB2Tpuc1; 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 x23si4662211ejv.558.2021.01.26.02.29.52; Tue, 26 Jan 2021 02:30:16 -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=@ziepe.ca header.s=google header.b=FB2Tpuc1; 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 S1731186AbhAZKZy (ORCPT + 99 others); Tue, 26 Jan 2021 05:25:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731988AbhAZBbH (ORCPT ); Mon, 25 Jan 2021 20:31:07 -0500 Received: from mail-qt1-x836.google.com (mail-qt1-x836.google.com [IPv6:2607:f8b0:4864:20::836]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9BE6EC061BD1 for ; Mon, 25 Jan 2021 17:13:06 -0800 (PST) Received: by mail-qt1-x836.google.com with SMTP id o18so11177430qtp.10 for ; Mon, 25 Jan 2021 17:13:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=RCicovIuFlmz+ypg8L3PoOuWlGavLF3Xg9FrMyiBxf8=; b=FB2Tpuc1HrWHU67D7lihDbhcABDw5J5jULrlvaEJiPnINhch/RYMx7KL9QSB7Af8dY eH5T39U+ajK31mQxL1tWTDvzMpIG97rSMoZXoSjD8DhGhUGc35qANZRwTXlDuQluhV13 Ql5lQPMXrM7LhYGrk7FkUEgp8wsEtvO5FzDN26ha0sAcxusN1/qGjE7U5vjZ158aS0+G MPy3uXN88BmRua0FNN6IoBJSSK7zVWM4st6ypV63RN9lQ9q9+xjmW9rJC9qnDzaXN7t8 lBtssPvQLIz/CZJQMZIXYo/GnVdnm2+8Y4kXGKOPFxcqVA9HhwPemMQrEhpXii7XrXJ3 ItJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=RCicovIuFlmz+ypg8L3PoOuWlGavLF3Xg9FrMyiBxf8=; b=Vd/kFoxuAA8EFzTbseXsblWWE4JMuVW9LjMPMcd4XMxDC0yd/XTpPJGdiLaih1VJ/r WjEk03R71XKrQ5S56qvke3qVZ3o1z+xY/PCPysyCa4aPfepLrVh9yUUEsFzaJNKYIx17 uu43yOXG8GwA7QptiJoQqXy1WvJgvH0rtlgVe94MkOVinzhQo0TlNPZGJrELeT2MG5EJ aOXR2eCPTYkVP0eEjtNAdO8Re7gZk68zPS9FoFX0mRCNL5gKy9ONYD4KkYWP+cc6Rgvr s3u/XG3b2u55LyUsTby47+uwMy7/0XcHKq4dfVczSv2Klb7C3/1elVMM324bZ4MNFV5N wzWQ== X-Gm-Message-State: AOAM53019OgIDqZZ4N1dnkOhPutYN2+uKLgFXn08TzsPfgnI/BOAVpZl E7bfn8JMrQv07b+IAaW+yv1V698YrAsy7lJF X-Received: by 2002:ac8:698a:: with SMTP id o10mr3184010qtq.242.1611623585887; Mon, 25 Jan 2021 17:13:05 -0800 (PST) Received: from ziepe.ca (hlfxns017vw-142-162-115-133.dhcp-dynamic.fibreop.ns.bellaliant.net. [142.162.115.133]) by smtp.gmail.com with ESMTPSA id 16sm12266715qtp.38.2021.01.25.17.13.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Jan 2021 17:13:05 -0800 (PST) Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1l4Cum-006tPi-OX; Mon, 25 Jan 2021 21:13:04 -0400 Date: Mon, 25 Jan 2021 21:13:04 -0400 From: Jason Gunthorpe 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 Message-ID: <20210126011304.GZ4605@ziepe.ca> References: <1611563696-235269-1-git-send-email-wangzhou1@hisilicon.com> <20210125154717.GW4605@ziepe.ca> <96b655ade2534a65974a378bb68383ee@hisilicon.com> <20210125231619.GY4605@ziepe.ca> <5f64a68042c64f37b5cba74028bd2189@hisilicon.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5f64a68042c64f37b5cba74028bd2189@hisilicon.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 25, 2021 at 11:35:22PM +0000, Song Bao Hua (Barry Song) wrote: > > 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. Once you have to explicitly make system calls to declare memory under IO, you loose all of that. Since you've asked the app to be explicit about the DMAs it intends to do, there is not really much reason to use SVA for those DMAs anymore. Jason