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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AE2EEC433EF for ; Wed, 9 Mar 2022 11:55:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232507AbiCIL42 (ORCPT ); Wed, 9 Mar 2022 06:56:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56862 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229550AbiCIL40 (ORCPT ); Wed, 9 Mar 2022 06:56:26 -0500 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9352760078 for ; Wed, 9 Mar 2022 03:55:27 -0800 (PST) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: dmitry.osipenko) with ESMTPSA id 8E7501F44A74 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1646826925; bh=PynJJsoLYdl1Gvc0xzkLN+51ws0jXntVzWj+p9ce160=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=dhtEPY66d4f949FzrfR1Gz129VcXzngI9xCwPitlNnWdd/t1ySgyteRFbpRcI03Hr kGYqsPdcvyWV9vc8TrTHTapgcflALoPO0AP4fvXBOyQDp5PriQZqU2VuSy/sPCvFT2 3L4WmNNQsf01RrZAC/C3oafVO+EByoZMbfmY+bjxawYde9QrkHUsWiaflrxixu0EXt jz9uVUsdPTPE2WwXgn5Idz0s5x5UyeoFKZc3Z3hb4WJSs605WkaDmUKYQX7ssc9NFH 9mbbab1IPlEMnzF1mnz4z8cm4vSuH7tTnI/I0wCU5X5Z8vtx1xkpmNwxO1/A45ECij ICu6WWaVn4+Yg== Message-ID: Date: Wed, 9 Mar 2022 14:55:21 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH v1 0/5] Add memory shrinker to VirtIO-GPU DRM driver Content-Language: en-US To: Thomas Zimmermann , David Airlie , Gerd Hoffmann , Gurchetan Singh , Chia-I Wu , Daniel Vetter , Daniel Almeida , Gert Wollny Cc: Tomeu Vizoso , linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, Gustavo Padovan , dri-devel@lists.freedesktop.org, Dmitry Osipenko References: <20220308131725.60607-1-dmitry.osipenko@collabora.com> <4ce1e172-799c-cba3-0a72-4a6fdf2c6d2f@suse.de> From: Dmitry Osipenko In-Reply-To: <4ce1e172-799c-cba3-0a72-4a6fdf2c6d2f@suse.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, On 3/9/22 11:59, Thomas Zimmermann wrote: > Hi > > Am 08.03.22 um 14:17 schrieb Dmitry Osipenko: >> Hello, >> >> This patchset introduces memory shrinker for the VirtIO-GPU DRM driver. >> During OOM, the shrinker will release BOs that are marked as "not needed" >> by userspace using the new madvise IOCTL. The userspace in this case is >> the Mesa VirGL driver, it will mark the cached BOs as "not needed", >> allowing kernel driver to release memory of the cached shmem BOs on >> lowmem >> situations, preventing OOM kills. > > Virtio-gpu is build on top of GEM shmem helpers. I have a prototype > patchset that adds a shrinker to these helpers. If you want to go > further, you could implement something like that instead. Panfrost and > lima also have their own shrinker and could certainly be converted to > the gem-shmem shrinker. I had a thought that it could be possible to unify shrinkers into a common DRM framework. Could you please give me a link to yours prototype patchset? 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 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 04AC0C433F5 for ; Wed, 9 Mar 2022 11:55:29 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0A23510E349; Wed, 9 Mar 2022 11:55:28 +0000 (UTC) Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by gabe.freedesktop.org (Postfix) with ESMTPS id EDD8610E349 for ; Wed, 9 Mar 2022 11:55:26 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: dmitry.osipenko) with ESMTPSA id 8E7501F44A74 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1646826925; bh=PynJJsoLYdl1Gvc0xzkLN+51ws0jXntVzWj+p9ce160=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=dhtEPY66d4f949FzrfR1Gz129VcXzngI9xCwPitlNnWdd/t1ySgyteRFbpRcI03Hr kGYqsPdcvyWV9vc8TrTHTapgcflALoPO0AP4fvXBOyQDp5PriQZqU2VuSy/sPCvFT2 3L4WmNNQsf01RrZAC/C3oafVO+EByoZMbfmY+bjxawYde9QrkHUsWiaflrxixu0EXt jz9uVUsdPTPE2WwXgn5Idz0s5x5UyeoFKZc3Z3hb4WJSs605WkaDmUKYQX7ssc9NFH 9mbbab1IPlEMnzF1mnz4z8cm4vSuH7tTnI/I0wCU5X5Z8vtx1xkpmNwxO1/A45ECij ICu6WWaVn4+Yg== Message-ID: Date: Wed, 9 Mar 2022 14:55:21 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH v1 0/5] Add memory shrinker to VirtIO-GPU DRM driver Content-Language: en-US To: Thomas Zimmermann , David Airlie , Gerd Hoffmann , Gurchetan Singh , Chia-I Wu , Daniel Vetter , Daniel Almeida , Gert Wollny References: <20220308131725.60607-1-dmitry.osipenko@collabora.com> <4ce1e172-799c-cba3-0a72-4a6fdf2c6d2f@suse.de> From: Dmitry Osipenko In-Reply-To: <4ce1e172-799c-cba3-0a72-4a6fdf2c6d2f@suse.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tomeu Vizoso , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, virtualization@lists.linux-foundation.org, Gustavo Padovan , Dmitry Osipenko Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Hello, On 3/9/22 11:59, Thomas Zimmermann wrote: > Hi > > Am 08.03.22 um 14:17 schrieb Dmitry Osipenko: >> Hello, >> >> This patchset introduces memory shrinker for the VirtIO-GPU DRM driver. >> During OOM, the shrinker will release BOs that are marked as "not needed" >> by userspace using the new madvise IOCTL. The userspace in this case is >> the Mesa VirGL driver, it will mark the cached BOs as "not needed", >> allowing kernel driver to release memory of the cached shmem BOs on >> lowmem >> situations, preventing OOM kills. > > Virtio-gpu is build on top of GEM shmem helpers. I have a prototype > patchset that adds a shrinker to these helpers. If you want to go > further, you could implement something like that instead. Panfrost and > lima also have their own shrinker and could certainly be converted to > the gem-shmem shrinker. I had a thought that it could be possible to unify shrinkers into a common DRM framework. Could you please give me a link to yours prototype patchset?