Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp2153631imn; Mon, 1 Aug 2022 13:12:58 -0700 (PDT) X-Google-Smtp-Source: AGRyM1ta39hVwvuJNgaHISz5G9FJ3omyafMGQBK9T36ksojTxgVySu1H1JhFb1BUvFJZdvdVy98q X-Received: by 2002:a05:6402:428a:b0:42e:8f7e:1638 with SMTP id g10-20020a056402428a00b0042e8f7e1638mr17306775edc.228.1659384778384; Mon, 01 Aug 2022 13:12:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659384778; cv=none; d=google.com; s=arc-20160816; b=eb78WPSOlXst9YQj7ib4gQMsRJxXxe+ARg5WMxmm+RQjgu2ROL7Fx27akXPsiENPu5 G3nsIcVbCZ7EYJHP8mihlBqUp1dkLxjUwKqHtY+j/zGQDB66zRJyhrmNCSgJvPsGtvhy uGCxyjjw2VpnYU+tdUp+t9X4d550/4/cV+0PbxgCXZ+SRL+Z4seigUdvjZx66RmweV0V piUoSujtEEs37kGBBPZ8dzuSYTaLMGD/QjM05Nq60G0wBG5BtsfEmAfoq9Ui4uQ0nvgs 9WL/m1yHzumwWW7qVHpEka5LeBbdBOBpvr35oi7SXsfCaRFnP9GrFt4CBlLryPFtcERI X6dA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=V5gQ5qjxqGzCmOK1PLGxzPSbavAClYglR/pW8JvcVsY=; b=SWmIVaFlhxlcYZTHjwxRwghIX7zyGQOslG202DulcYXHQPiaT7JPlSi4/Xb7Hbf2cp 1xl4yb2uSxstCjfLGoVxBnoiOvErHJHia1JXobc4tnZ+ElY5rzwyXD9KCDTPZZJFds0M YjvPTVbToGUa1nxzaO8jOI0DROs8+kmKGc09zzsUslN4kgn/srVU5bCFU8cxJpPkWKZT uRRYRg2IffDTGcII4sUkxfwOxVWLyJiMM78JUWV1YAdpk8J/sEXBujZUoKRRDF6s4pkp HP9oNw+CRSJrw9B6xT52lI1PenIgfdNttOAzGeQcsYNQ/4qDhg6yJHuKpJhlN9yHe3ID L9cQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=EOL03vS8; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dr18-20020a170907721200b007306e4fc2f2si4643352ejc.374.2022.08.01.13.12.32; Mon, 01 Aug 2022 13:12:58 -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=@gmail.com header.s=20210112 header.b=EOL03vS8; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231634AbiHAUAq (ORCPT + 99 others); Mon, 1 Aug 2022 16:00:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230320AbiHAUAo (ORCPT ); Mon, 1 Aug 2022 16:00:44 -0400 Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com [IPv6:2a00:1450:4864:20::131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A9FC01572B; Mon, 1 Aug 2022 13:00:41 -0700 (PDT) Received: by mail-lf1-x131.google.com with SMTP id w15so18926063lft.11; Mon, 01 Aug 2022 13:00:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc; bh=V5gQ5qjxqGzCmOK1PLGxzPSbavAClYglR/pW8JvcVsY=; b=EOL03vS8sJyZdeSxpiRsCpF+3QVM3bz3TKLSdmNrCoN76SVWyUko+Tv6vsSYLW7ohS OoFPkFDsJRnCHJ8rN0rBpqI8kXsGle4DYUVWllYVv4qGUEKKkiDcieFDGBfMgt6tEi7t LP86DXRvoqv4wH2xg+sMC+aIO5Wf/uE9oLW9FlN2WJvKg9mQqtKopNHU39gskBLHOLhg oqT9ulPJApTuxEbnIx4D096yBekO7hEns8wHMQ8Vga8PMh+bdRVTg2U1BdfxwzpUz+Sa x2ALv/PS9Hp6ZtJQhZD3YGGC5A9n7f4sDdG7YeKW3OJkegRDy04hq3vJtVLEaS9RiQd6 Co6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=V5gQ5qjxqGzCmOK1PLGxzPSbavAClYglR/pW8JvcVsY=; b=SDSkPpxwyBOnaglBbh/mTbdlIKQDsfJ9SUok8cwUuAqEyD3/4u4/Sz2Qx4tC6nW+8X +2YV+f078IdV9J07YHSHMSbORL7X6cRCzqdZM2TduufPrVqjXW+caVaJ5oW7RfV05ezc x0tQ53yFbH81T985/fHVadF9LE8f00FjZvVLSGWCgxADnwzuBZTIOCs5jnVKTCO4AyLq uvZ8Ihu4J78fHbnB8OJy7shpPtae1Ka0g0HCKzBhS6IJrhI9JcS2EhbNiesKw0FU+hNv DFJMsArQgQWajosW6Qoe8ytijNAJwJOzkTCVEOX5/SCUfuiz+c3nnZeUE4UwRWE8AMri mu9g== X-Gm-Message-State: AJIora+OMxPL1drjHj4EIQlrOyRdCT5wMLfi0sT4zU+SIm0XOBmlqXeE 7jTTbetOUkiQs9hIjeBjm0cvFugHqxKV9MsgU18= X-Received: by 2002:a05:6512:3f13:b0:48a:a89e:3ccb with SMTP id y19-20020a0565123f1300b0048aa89e3ccbmr5804969lfa.245.1659384039913; Mon, 01 Aug 2022 13:00:39 -0700 (PDT) MIME-Version: 1.0 References: <20220726175043.1027731-1-robdclark@gmail.com> <20220726175043.1027731-10-robdclark@gmail.com> In-Reply-To: From: Rob Clark Date: Mon, 1 Aug 2022 13:00:27 -0700 Message-ID: Subject: Re: [PATCH v3 09/15] drm/gem: Add LRU/shrinker helper To: Dmitry Osipenko 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 Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,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 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.. 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 BR, -R