Received: by 2002:a05:6512:e85:0:0:0:0 with SMTP id bi5csp3091667lfb; Tue, 28 Jun 2022 06:18:07 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tafJs+GRN9/qrfGtOoyPcKnYkIxFky36R3t0M8tIakgJZ6xShUyqHnrHeJr6g+kKrvuPvR X-Received: by 2002:a17:907:86a7:b0:726:317f:aee0 with SMTP id qa39-20020a17090786a700b00726317faee0mr18173863ejc.229.1656422286947; Tue, 28 Jun 2022 06:18:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656422286; cv=none; d=google.com; s=arc-20160816; b=DllBzmk9wTGReen2YBmHs4B1ohET1yR0zUCPBg6aINgjRX21eHm15Ldc3SfkqIi2il SJk8kQP43t60A6mUBFJK4vB/GLhhQQY1tuVRZeHYTa3bPYOaj9MhRb/QMEml/Vjc65f+ WG0yIo5mKDbRnZepx75SUeaFgzLcE/5sZRUJR92kZYp+i7kSp5+lE4Ma4ox10/VUomKi iLBOK8WvK0kFNmd1xhea8kx3y0RDllZYsbJ7EQnXPEq1Ds1WPv7KD5n39dsHdi/xXk6l RgG92FoiyF5c+R6YJGmniEuZdYhUKELWwK2eGyplZB/rFquzq28DpFxlUNvQEyxVfLWC bFMQ== 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:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=JXMH+cHV0EMRUMwdVoxykkKfHbuvJDepQvWo6ESK3MA=; b=KU17gh7jGusCBZACOUKcCvP23LlLkjKLBzlw3DARp3v30k/QYaq0Vd+zf9sC83RCSl QfiQQ6G39vPknI1nbDOru8Jxq+7ImQIIfHGetTY0L6psz5s+7rZrZAW2bvFY7wx+Z+gM sv8S4ZCUuVcNfb7CEW0NwDvklJ3l3MU91cPkw+1bbCeiua8g7+A63EIAbbiijTa+7ZhC B8iLHPoltroQntWxQ6VBRHnb8bfIklr4Vrsq8s9zrYW2oVIYQawsOLfgtIpAM1LaBWGE 5pD/UrW82VULOGN5AFopXvZI4jQpPjPJRvVXDklemvQGwoNhzn7r+TugzAgOdArx//Fo 1ElA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=JVdCL4pO; 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 t6-20020a170906608600b00722ea4dd14csi13704943ejj.387.2022.06.28.06.17.34; Tue, 28 Jun 2022 06:18:06 -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=JVdCL4pO; 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 S231749AbiF1NL1 (ORCPT + 99 others); Tue, 28 Jun 2022 09:11:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34674 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245441AbiF1NLR (ORCPT ); Tue, 28 Jun 2022 09:11:17 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1AD47645A; Tue, 28 Jun 2022 06:11:15 -0700 (PDT) Received: from [192.168.2.145] (109-252-118-164.nat.spd-mgts.ru [109.252.118.164]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: dmitry.osipenko) by madras.collabora.co.uk (Postfix) with ESMTPSA id 714326601856; Tue, 28 Jun 2022 14:11:10 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1656421873; bh=KNSZUjyY4CuF71/A7Usafn7IJCqpjpqnNb+s/bjmhpM=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=JVdCL4pOrZRjPYlW1sSxr0ov8MYwr/h/jFUMEmO4yZZL0Thh0VqUNftTIaNvUwEmY myolbgF/rRAWBiGj8as5x4lXrPgfvowspQRix7IvWX3ujENW9n/A9RgofDbIFplpJ1 XKBUEiGyhohLkxg095z15R9kLoSIzKX7UR4GwSE03H/Wl5+upu3XGKE9fggwC3rLAJ YwztUDyhr9vdUcLY8PyCIUcj0FTuvMwiQySOEZvk1YLzw5WODsuuCzO2945ZS6eOcK kbjoe/4U6aWPVrza0Q6OS9hOE9m0uzU59dItxkwobNx4NGuRgKEN7SpAkBhFBnLjES o9MoSYPi5XeiA== Message-ID: <8c5d3cb0-70fa-81a7-33a2-50f45bf8f40e@collabora.com> Date: Tue, 28 Jun 2022 16:11:07 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Subject: Re: [PATCH v6 00/22] Add generic memory shrinker to VirtIO-GPU and Panfrost DRM drivers Content-Language: en-US To: Robin Murphy , David Airlie , Gerd Hoffmann , Gurchetan Singh , Chia-I Wu , Daniel Vetter , Daniel Almeida , Gert Wollny , Gustavo Padovan , Daniel Stone , Tomeu Vizoso , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Steven Price , Alyssa Rosenzweig , Rob Clark , Emil Velikov , Qiang Yu , Sumit Semwal , =?UTF-8?Q?Christian_K=c3=b6nig?= , "Pan, Xinhui" , Thierry Reding , Tomasz Figa , Marek Szyprowski , Mauro Carvalho Chehab , Alex Deucher , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, Dmitry Osipenko , linux-tegra@vger.kernel.org, linux-media@vger.kernel.org, linaro-mm-sig@lists.linaro.org, amd-gfx@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, kernel@collabora.com References: <20220526235040.678984-1-dmitry.osipenko@collabora.com> <49cc6f0c-e90e-8edd-52e7-4188620e2c28@arm.com> From: Dmitry Osipenko In-Reply-To: <49cc6f0c-e90e-8edd-52e7-4188620e2c28@arm.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_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Hello Robin, On 6/28/22 15:31, Robin Murphy wrote: >> Hello, >> >> This patchset introduces memory shrinker for the VirtIO-GPU DRM driver >> and adds memory purging and eviction support to VirtIO-GPU driver. >> >> The new dma-buf locking convention is introduced here as well. >> >> During OOM, the shrinker will release BOs that are marked as "not needed" >> by userspace using the new madvise IOCTL, it will also evict idling BOs >> to SWAP. 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. >> >> The Panfrost driver is switched to use generic memory shrinker. > > I think we still have some outstanding issues here - Alyssa reported > some weirdness yesterday, so I just tried provoking a low-memory > condition locally with this series applied and a few debug options > enabled, and the results as below were... interesting. The warning and crash that you got actually are the minor issues. Alyssa caught an interesting PREEMPT_DEBUG issue in the shrinker that I haven't seen before. She is also experiencing another problem in the Panfrost driver with a bad shmem pages (I think). It is unrelated to this patchset and apparently require an extra setup for the reproduction. -- Best regards, Dmitry