Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1880939rwd; Wed, 17 May 2023 02:43:17 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7cyz0IQ446v0wbm3ZmsJpFfW02tcpQxDzDDdD9mtkBTLw429AiTJzP90qMeqHeO9utRbP3 X-Received: by 2002:a05:6a20:1596:b0:105:95b2:a8e3 with SMTP id h22-20020a056a20159600b0010595b2a8e3mr14715524pzj.22.1684316597590; Wed, 17 May 2023 02:43:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684316597; cv=none; d=google.com; s=arc-20160816; b=PCVgmVntRxwh5d/vyZ7WHi8pSBNsq9OUYJOcl0B6zIsiWlh3elkf5v5pRYLHpF9XAZ Lr//3cR9V4458ZX16cP6Lrz0yGgQNVJxcyZnPLe4sphnB9SaR8uPk94pMcJR7zaZ9uvF 3E4jPCeU8NPW2m4pyynRKPeseabTotuKLBwnkAN1MIZ97I9XN0G2gORSJyvV7r59MnHe Yws8OS/sGuBf36UwYVIKXcEz+SM6B4EUGenmxTu5WVoT+LaZG9aUH3PkCDVsZm9dKTaY nRDZIorDAM3KgG1/hm7x87KXhnllsziMZuo6kmIgNos/mznASZ9qWoUI36OMEriFfnOj m87g== 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=gtYEL+cNF7JBOxTUOl920ZwaVms6oMpqn+5use50Dtc=; b=kY7hZW2nLxL4sDVJnfhtuwD1gj+x/isfv/gHlU4FpBziI447HpbYflC6r1q3Pr1wK3 pqI7/rnR+qGV3aBW4dgek1aGnoiqs+t+aC2qK5ND5GMs3wRGxkZdPuaYpSeRBVgn7Emu wnafeUGg4ifs/IhbgQ3kvzBfR9wPD7D/8ZlFKcMjGo8fg9yEAjMma2Cbqsf+bH7WlJ1B cXlTZhIw51kf9TF1+tPgoEzDO9ZSnDwHJ4nR2tUF2yyMusdhwy3IBwFlmjJ4pIf7Urp1 NnmSA1XI8nWzGFNFdsHzoCMIoHIn4P78XNEECiQtjGY32LuLZKCjr74iKEigQWdGlJlO i3+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=zTihcchD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c3-20020a056a00008300b006434d66f94dsi21746447pfj.31.2023.05.17.02.43.03; Wed, 17 May 2023 02:43:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=zTihcchD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230092AbjEQJgQ (ORCPT + 99 others); Wed, 17 May 2023 05:36:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42262 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229678AbjEQJgP (ORCPT ); Wed, 17 May 2023 05:36:15 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 69B86210C for ; Wed, 17 May 2023 02:36:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; 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=gtYEL+cNF7JBOxTUOl920ZwaVms6oMpqn+5use50Dtc=; b=zTihcchDPUHLMoURHpwYR6cQZM stP81hCQFi1oM6TlF5VeYFxwswzfvO73CQXC+d0HK4KBesR0iicRSupkwNvKr2oAjUoX0v93RoKQY NFD++5fvKU9r6s/tGhD0GdE4IP/r2EhdGaxKMWIila8PRiF0TQzsn38p67AUPig4SgItiNrX8xjnS NKjtEziY2Rth+74sQNv8i5JUzpa6sTLxJ8+DSTARpanLoH08XAXRxr6bV5CL1cMwuriptuEeijwuQ wUN9r1fPuic8B9pLBmkXUYhGWzKwHWQ1HNLCXQ7wI3w4AsPE2OR4piTLjOyU1udqLVeCm6e4+rchU ViVrwtNg==; Received: from hch by bombadil.infradead.org with local (Exim 4.96 #2 (Red Hat Linux)) id 1pzDZp-0095AA-1E; Wed, 17 May 2023 09:36:09 +0000 Date: Wed, 17 May 2023 02:36:09 -0700 From: Christoph Hellwig To: Sumit Garg Cc: Christoph Hellwig , Xiaoming Ding , Jens Wiklander , Matthias Brugger , AngeloGioacchino Del Regno , op-tee@lists.trustedfirmware.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, fei.xu@mediatek.com, srv_heupstream@mediatek.com, linux-mm@kvack.org Subject: Re: [PATCH] tee: add FOLL_LONGTERM for CMA case when alloc shm Message-ID: References: <20230517031856.19660-1-xiaoming.ding@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 17, 2023 at 02:56:13PM +0530, Sumit Garg wrote: > Do you mean a pinned user-space page can be paged out automatically? No, pinned pages can't be paged out. But a short term pin implies it will be release after a short delay, and it is feasible for wait for the pin to go away. For a long term pin waiting is not an option, and anyone wanting to do something with the pinned page that requires it to not be pinned must simply give up. > Just FYI, the underlying use-case for TEE registered shared memory is > that the references to pinned pages are provided to TEE implementation > to operate upon. This can happen over multiple syscalls and we want > the pinned pages to be always in RAM as otherwise the physical > addresses may change if they are paged out in between. That's a very use clear case for a long term pin.