Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp2162336imn; Mon, 1 Aug 2022 13:34:12 -0700 (PDT) X-Google-Smtp-Source: AA6agR4YKXU/wdT0oAVmUz56EC9bPcyb1MDW22fZ+VkWkZU+B0QOunXi/3bQAKTkZnsmFcR1jPpY X-Received: by 2002:a17:906:9bc9:b0:730:6595:dfc8 with SMTP id de9-20020a1709069bc900b007306595dfc8mr7131888ejc.286.1659386051889; Mon, 01 Aug 2022 13:34:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659386051; cv=none; d=google.com; s=arc-20160816; b=j+O1KqKtEBxyBk38WIS92wurLsaYQ1aj0Sy43ee17MGIdPh7Fk7x6oOSnHVP4MQ+sH em0OmgAruoZaPX1pJd3bHkUrC3FONZBBA5pReYgo7AB21lDsPn7Bmx/UMJO48kWjL5dq qspg3kGEFSe2O/Xu7nf46O8WRD9W8p7ak/YrDHKULy+/isYQNSy+lC8hM5Ib2fxYKttb dGRZqA6um8I3HNY8ZZEe2FUpuTdYPP9alt9U6JZLEwLNTlJ39ueRSpkowyCsOxOiokO+ ro0NKn+cAE1BUazCu7eidDF2MzDqXjO3B6oYyLxSOQaLycqcBZJYp4nWMCXjSTdXYpoW HTtw== 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=TrcUg4vSGwJenM/tm2qbn2gtdSsZyHzgOgWCFEkfqco=; b=A1ExJ1xdD1S637xFjLGbo/GdM2RfkL29o4x+LNLVdTv+saDMtW8zhOoE+NbOqzOzZY WO0Gjft8vQAvZVpCzo+APrQqWlUerhvk7h+6u1B5+ZcSUaDBcgBByzFNecsYTwdb+AYC IdERxlfD+s394NyV7oyeCSQRCFz+8B3ZFXGrE6Gbvq8vpsd1ML4gzVF/mckd6FqN3Mkm /tHDv9srskwS2ASym1seQnBsNpoDeDs1MKg3AeTt3ORS3I30wKyxDtasqs/WPf7wtoGt 2R2ZAk6R3QYni4xzOEyO9n01TdrYjZ7XcEOvEXMrtgc7DMNrf8vyYYpuW7+zy+vMfv8i /iRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=cyu+trJy; 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 i19-20020a05640242d300b0043d67a7dd61si5834457edc.179.2022.08.01.13.33.46; Mon, 01 Aug 2022 13:34:11 -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=cyu+trJy; 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 S234794AbiHAUM6 (ORCPT + 99 others); Mon, 1 Aug 2022 16:12:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55852 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234725AbiHAUMH (ORCPT ); Mon, 1 Aug 2022 16:12:07 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 62BF33DF19; Mon, 1 Aug 2022 13:12:04 -0700 (PDT) Received: from [192.168.2.145] (109-252-119-232.nat.spd-mgts.ru [109.252.119.232]) (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 7244A6601BA5; Mon, 1 Aug 2022 21:12:01 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1659384722; bh=Ww02GIODxPF1eQWZ6lWAqTXwqaa5UD98G24csRrYi5c=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=cyu+trJyxvIzAtsbdH+eRaHNA5ReSc+WTnNm85JhbbY69TX86XOdfKFz6K6Bgtt46 V3Rj9gR4f7vJWIccBBNOEfRNZsgUNDlCdSLbwT61J+kMBlGmqqX6FTNgaPsV1TZd28 ns4xMUMxmjX0rjQf8hjiyfknQjYqDOrMwXXu71G73LR64iXE1lNPNnN1sVRtp6VgCX Ys4oEw31upAURNwAx0VCNqt4XCees5Rcr7up0uXnX1WfGwn+HijQaAAHYTN0mj6GHh 7z79MZKBEZsa0ciGtS38BnXqmSgTgk6ikSpSREhuugd27TAEXOxtDBELcx+t7M74U5 gtRZNHM1r+SXg== Message-ID: <6b35b912-68e5-e722-0b5a-0f7bd06c22c2@collabora.com> Date: Mon, 1 Aug 2022 23:11:58 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0 Subject: Re: [PATCH v3 09/15] drm/gem: Add LRU/shrinker helper Content-Language: en-US To: Rob Clark Cc: dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, Rob Clark , Daniel Vetter , Thomas Zimmermann , Maarten Lankhorst , Maxime Ripard , David Airlie , open list References: <20220726175043.1027731-1-robdclark@gmail.com> <20220726175043.1027731-10-robdclark@gmail.com> From: Dmitry Osipenko In-Reply-To: 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 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 8/1/22 23:00, Rob Clark wrote: > On Mon, Aug 1, 2022 at 12:41 PM Dmitry Osipenko > wrote: >> >> On 7/26/22 20:50, Rob Clark wrote: >>> +/** >>> + * drm_gem_lru_remove - remove object from whatever LRU it is in >>> + * >>> + * If the object is currently in any LRU, remove it. >>> + * >>> + * @obj: The GEM object to remove from current LRU >>> + */ >>> +void >>> +drm_gem_lru_remove(struct drm_gem_object *obj) >>> +{ >>> + struct drm_gem_lru *lru = obj->lru; >>> + >>> + if (!lru) >>> + return; >>> + >>> + mutex_lock(lru->lock); >>> + lru_remove(obj); >>> + mutex_unlock(lru->lock); >>> +} >>> +EXPORT_SYMBOL(drm_gem_lru_remove); >> >> I made a preliminary port of the DRM-SHMEM shrinker on top of the the >> latest version of dma-buf locking convention and yours LRU patches. It >> all works good, the only thing that is missing for the DRM-SHMEM >> shrinker is the drm_gem_lru_remove_locked(). >> >> What about to add a locked variant of drm_gem_lru_remove()? > > Sounds fine to me.. the only reason it didn't exist yet was because it > wasn't needed yet.. There is no use for the drm_gem_lru_move_tail_locked() as well, you're not using it in the MSM driver. Hence I thought it might be good to add the drm_gem_lru_remove_locked(), or maybe the drm_gem_lru_move_tail_locked() should be dropped then? > I can respin w/ an addition of a _locked() version, or you can add it > on top in your patchset. Either is fine by me The either option is fine by me too. If you'll keep the unused drm_gem_lru_move_tail_locked(), then will be nice to add drm_gem_lru_remove_locked(). -- Best regards, Dmitry