Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp3657990pxp; Tue, 15 Mar 2022 03:42:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwuYX7i6zVbVIBkEmkPDJ492viwBuODfrZ307wvfF0EZ+GahMZ/NKrwkBWq0Ae1HXkJW5SV X-Received: by 2002:a17:907:6286:b0:6da:6e24:5e43 with SMTP id nd6-20020a170907628600b006da6e245e43mr22291119ejc.449.1647340942522; Tue, 15 Mar 2022 03:42:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647340942; cv=none; d=google.com; s=arc-20160816; b=OgidtERb4q7k63mBbB+EUQ+ty4FXifdQZSPvOsb5HHVZgQHgGrgKonepN+pl3Hr2gl R9ys7hq7SqPYuDIDrfz7GmYppo5UoZ7txbmhgmiEK/+x6LJv97NBmqegb2ko3GKvlAYS is8jf/hXvceFlZ6va7Imodn5K5a8X86Wd3IKe3iIVUHbYpCX+ff4nF1N2DgcnJ3qnuQy Mvp501MFobn/s8seWis64W/UIxKPDKayxlnmq5hAxvStECCML3UdTPptql1JZJTio8IN DAA0io5ua2UcNOoy266VlJl1o+tPCy6Rr9hVznstE0I5NngDjZtO2xiOQPJAcIcQEiwr nbbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:references :cc:to:from:content-language:subject:user-agent:mime-version:date :message-id:dkim-signature; bh=bObmLyA76aHoivnjNQALCiK3lUzuTFSHnq7YsRGaYQU=; b=s21FretoIF/8N+rrHmmWCik4g7jb9w6OKHlJFJeyOjxN6VCCIhZlyvL2731Wcjt8GL wo3iZqk+/K4CqCqEtrz65Cnihkl6urrfRx/Ig6voGqBMtBKeVZS9PkeLJTf/WkP8ROpU NfvNuWTsB1hiq2XKi8ofjXcbG7QamgijZkxR+cx5mLQhbv/2lcBZp9yAcu4oVeEvvTXg BiV3NgdT/LnAzudUsDgjw54HcS99OO5LO9y47SEFhxGGaqBZGeugJ3gy7WTvoehr8i8m FEs+i3eMvswK+9ZJLBwf2ZD8yVMunp8P+qAmgcjoj6/7AAUv5rvXrB8u5dgcd1jztkK1 twrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=PlTxBut6; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p11-20020a50c94b000000b004162991fe46si10550659edh.418.2022.03.15.03.41.54; Tue, 15 Mar 2022 03:42:22 -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=@collabora.com header.s=mail header.b=PlTxBut6; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343565AbiCNXGO (ORCPT + 99 others); Mon, 14 Mar 2022 19:06:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60234 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235753AbiCNXGN (ORCPT ); Mon, 14 Mar 2022 19:06:13 -0400 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 65BBA39BBC for ; Mon, 14 Mar 2022 16:05:02 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: dmitry.osipenko) with ESMTPSA id 373E91F41076 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1647299101; bh=ImDNs5MtGaf4nSstH8zkCM28WFaVLQuyemCzF6ZQYJo=; h=Date:Subject:From:To:Cc:References:In-Reply-To:From; b=PlTxBut6TmpI+QxoNKeujpyLENjWdEye6aX+0N+6F2/DOWqvfg/tBGqHA5BBm8CI4 X/PEtRzXZbpIxQNXOSP+0W9ebTMWRTU7FAozYDi8ZeHs8Pa3NHe1IO7b5XESYewp/3 GoZvmtJx24jW14SESqm1+Qc+1KUVLhEtSav5/rG9qCfIWP/ESK2kgphI2niv0mRLUJ HjKo+pGO2RWRRyDFe5aGiYvn5ZaPBT9ucMsNDNUw7+Pu9wMG38u3xcjKqRnJ4Cqs6e AVsQv0/1Hzo0rUYayD7AR2j34doPgXwjvp0uZwPU3GY7LcDH0SBNkYOtsnhai7Hozz jqwDJ8iUNBe1Q== Message-ID: <64959ce1-15f0-59f5-a6f8-4258019e5a4b@collabora.com> Date: Tue, 15 Mar 2022 02:04:57 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.6.2 Subject: Re: [PATCH v1 0/5] Add memory shrinker to VirtIO-GPU DRM driver Content-Language: en-US From: Dmitry Osipenko To: Rob Clark Cc: David Airlie , Gerd Hoffmann , Gurchetan Singh , Chia-I Wu , Daniel Vetter , Daniel Almeida , Gert Wollny , Tomeu Vizoso , Linux Kernel Mailing List , "open list:VIRTIO GPU DRIVER" , Gustavo Padovan , dri-devel , Dmitry Osipenko , Rob Clark References: <20220308131725.60607-1-dmitry.osipenko@collabora.com> <42facae5-8f2c-9c1f-5144-4ebb99c798bd@collabora.com> <05e1fe61-1c29-152f-414b-cd6a44525af0@collabora.com> <285bf619-8c05-f2f4-3aeb-e013fba8754a@collabora.com> In-Reply-To: <285bf619-8c05-f2f4-3aeb-e013fba8754a@collabora.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY 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 3/10/22 01:43, Dmitry Osipenko wrote: >> I think that, given virgl uses host storage, guest shrinker should be >> still useful.. so I think continue with this series. > Guest shrinker indeed will be useful for virgl today. I was already > questioning why virgl needs both host and guest storages, maybe it will > move to a host-only storage approach in the future. > > I think the variant with the timer expiration actually could be > interesting to try because it should allow host to purge its VM BOs by > itself, preventing host OOMs. While I was working on shrinker v2, I noticed that host-side allocation may take a significant time. So I decided to defer implementation of my idea of using timer-based expiration for host-only BOs. I'll need to examine it more. >> For host shrinker, I'll have to look more at when crosvm triggers >> balloon inflation. I could still go the MADV:WILLNEED_REPLACE >> approach instead, which does have the advantage of host kernel not >> relying on host userspace or vm having a chance to run in order to >> release pages. The downside (perhaps?) is it would be more specific >> to virtgpu-native-context and less so to virgl or venus (but I guess >> there doesn't currently exist a way for madvise to be useful for vk >> drivers). > I'll also take a look at what CrOS does, maybe it has some interesting > ideas. I looked at CrOS kernel and crosvm, and haven't noticed anything special there in regards to purging GPU's memory of VM on host-side memory pressure. If you'll find something, then please let me know. I sent out v2 of the shrinker series, but missed to CC you on it by accident, please find it here [1]. [1] https://lore.kernel.org/dri-devel/20220314224253.236359-1-dmitry.osipenko@collabora.com/T/#t