From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C9D51C433E0 for ; Tue, 26 Jan 2021 01:13:08 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 4B78123108 for ; Tue, 26 Jan 2021 01:13:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4B78123108 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 6D2C98D0071; Mon, 25 Jan 2021 20:13:07 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 6818B8D0065; Mon, 25 Jan 2021 20:13:07 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 597D28D0071; Mon, 25 Jan 2021 20:13:07 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0234.hostedemail.com [216.40.44.234]) by kanga.kvack.org (Postfix) with ESMTP id 417E18D0065 for ; Mon, 25 Jan 2021 20:13:07 -0500 (EST) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 0F4401EE6 for ; Tue, 26 Jan 2021 01:13:07 +0000 (UTC) X-FDA: 77746152414.16.route03_600e3e12758a Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin16.hostedemail.com (Postfix) with ESMTP id E455F100E6903 for ; Tue, 26 Jan 2021 01:13:06 +0000 (UTC) X-HE-Tag: route03_600e3e12758a X-Filterd-Recvd-Size: 4906 Received: from mail-qt1-f169.google.com (mail-qt1-f169.google.com [209.85.160.169]) by imf49.hostedemail.com (Postfix) with ESMTP for ; Tue, 26 Jan 2021 01:13:06 +0000 (UTC) Received: by mail-qt1-f169.google.com with SMTP id e15so11173315qte.9 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=KC00NQoHHmdeFW/BdV3jX+YqDBGT0X7VU4wt1LkMpo84pbc/5gA4lsLaKifVc+Q7HH 65C1WxuOzyjRt8sJTtjmUKoEyNbDA8rciEOHFxuPxxUIsLJr4y8Xy/ZcK9u4Y8/2PBZW XCmVHqg2o/0ApLOps6JBXIf8IkO4aM2wLSeAsPV9J5BMS5ANpqOSOKJHRJutybG+D3vw n5Z4DuMvEzgMZv5w8yDoizvgWK//BkMBX8QOhnqWcYCEDAoMzdx+8yQBPp7rt8Ft3dQa bipaHdSusH8U8oMBV5v+eh0pxuijKzMqT9fUBme5bCTB/NDepdl7lCUSDwxk9/GrG8Uf KAbw== X-Gm-Message-State: AOAM530D137sXNJNJCia8DD528asPBaq3FwgICx2xEZhmYRmfA2oaU1s DR0f0MdTQ+bMVXEx8no3huvmbw== X-Google-Smtp-Source: ABdhPJxpdPeFFvMV3gAxS1etvOF2FWSYe21i1REZljAHSmM3iwf+cRwhsoyKqoNP4Os8WkMpKLF4aA== 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> X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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