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 X-Spam-Level: X-Spam-Status: No, score=-15.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_2 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 239EBC48BC2 for ; Wed, 23 Jun 2021 16:52:56 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id E6F0A61166 for ; Wed, 23 Jun 2021 16:52:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E6F0A61166 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=collabora.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 58DC76E95B; Wed, 23 Jun 2021 16:52:55 +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 95BE86E959; Wed, 23 Jun 2021 16:52:53 +0000 (UTC) Received: from localhost (unknown [IPv6:2a01:e0a:2c:6930:5cf4:84a1:2763:fe0d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: bbrezillon) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id 50C0D1F4163C; Wed, 23 Jun 2021 17:52:52 +0100 (BST) Date: Wed, 23 Jun 2021 18:52:50 +0200 From: Boris Brezillon To: Daniel Vetter Subject: Re: [PATCH 04/15] drm/panfrost: Shrink sched_lock Message-ID: <20210623185250.7418a744@collabora.com> In-Reply-To: <20210622165511.3169559-5-daniel.vetter@ffwll.ch> References: <20210622165511.3169559-1-daniel.vetter@ffwll.ch> <20210622165511.3169559-5-daniel.vetter@ffwll.ch> Organization: Collabora X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII 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 , Intel Graphics Development , DRI Development , Steven Price , Alyssa Rosenzweig , Daniel Vetter Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Tue, 22 Jun 2021 18:55:00 +0200 Daniel Vetter wrote: > drm/scheduler requires a lock between _init and _push_job, but the > reservation lock dance doesn't. So shrink the critical section a > notch. > > v2: Lucas pointed out how this should really work, I got it all wrong > in v1. > > Signed-off-by: Daniel Vetter > Cc: Lucas Stach > Cc: Rob Herring > Cc: Tomeu Vizoso > Cc: Steven Price > Cc: Alyssa Rosenzweig Reviewed-by: Boris Brezillon > --- > drivers/gpu/drm/panfrost/panfrost_job.c | 7 +++---- > 1 file changed, 3 insertions(+), 4 deletions(-) > > diff --git a/drivers/gpu/drm/panfrost/panfrost_job.c b/drivers/gpu/drm/panfrost/panfrost_job.c > index 2df3e999a38d..38f8580c19f1 100644 > --- a/drivers/gpu/drm/panfrost/panfrost_job.c > +++ b/drivers/gpu/drm/panfrost/panfrost_job.c > @@ -224,14 +224,13 @@ int panfrost_job_push(struct panfrost_job *job) > struct ww_acquire_ctx acquire_ctx; > int ret = 0; > > - mutex_lock(&pfdev->sched_lock); > > ret = drm_gem_lock_reservations(job->bos, job->bo_count, > &acquire_ctx); > - if (ret) { > - mutex_unlock(&pfdev->sched_lock); > + if (ret) > return ret; > - } > + > + mutex_lock(&pfdev->sched_lock); > > ret = drm_sched_job_init(&job->base, entity, NULL); > if (ret) { 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 X-Spam-Level: X-Spam-Status: No, score=-15.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_2 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 728A6C4743C for ; Wed, 23 Jun 2021 16:52:55 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 37AEB610C7 for ; Wed, 23 Jun 2021 16:52:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 37AEB610C7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=collabora.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C8E0F6E959; Wed, 23 Jun 2021 16:52:54 +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 95BE86E959; Wed, 23 Jun 2021 16:52:53 +0000 (UTC) Received: from localhost (unknown [IPv6:2a01:e0a:2c:6930:5cf4:84a1:2763:fe0d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: bbrezillon) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id 50C0D1F4163C; Wed, 23 Jun 2021 17:52:52 +0100 (BST) Date: Wed, 23 Jun 2021 18:52:50 +0200 From: Boris Brezillon To: Daniel Vetter Message-ID: <20210623185250.7418a744@collabora.com> In-Reply-To: <20210622165511.3169559-5-daniel.vetter@ffwll.ch> References: <20210622165511.3169559-1-daniel.vetter@ffwll.ch> <20210622165511.3169559-5-daniel.vetter@ffwll.ch> Organization: Collabora X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Subject: Re: [Intel-gfx] [PATCH 04/15] drm/panfrost: Shrink sched_lock X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tomeu Vizoso , Intel Graphics Development , DRI Development , Steven Price , Alyssa Rosenzweig , Daniel Vetter Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On Tue, 22 Jun 2021 18:55:00 +0200 Daniel Vetter wrote: > drm/scheduler requires a lock between _init and _push_job, but the > reservation lock dance doesn't. So shrink the critical section a > notch. > > v2: Lucas pointed out how this should really work, I got it all wrong > in v1. > > Signed-off-by: Daniel Vetter > Cc: Lucas Stach > Cc: Rob Herring > Cc: Tomeu Vizoso > Cc: Steven Price > Cc: Alyssa Rosenzweig Reviewed-by: Boris Brezillon > --- > drivers/gpu/drm/panfrost/panfrost_job.c | 7 +++---- > 1 file changed, 3 insertions(+), 4 deletions(-) > > diff --git a/drivers/gpu/drm/panfrost/panfrost_job.c b/drivers/gpu/drm/panfrost/panfrost_job.c > index 2df3e999a38d..38f8580c19f1 100644 > --- a/drivers/gpu/drm/panfrost/panfrost_job.c > +++ b/drivers/gpu/drm/panfrost/panfrost_job.c > @@ -224,14 +224,13 @@ int panfrost_job_push(struct panfrost_job *job) > struct ww_acquire_ctx acquire_ctx; > int ret = 0; > > - mutex_lock(&pfdev->sched_lock); > > ret = drm_gem_lock_reservations(job->bos, job->bo_count, > &acquire_ctx); > - if (ret) { > - mutex_unlock(&pfdev->sched_lock); > + if (ret) > return ret; > - } > + > + mutex_lock(&pfdev->sched_lock); > > ret = drm_sched_job_init(&job->base, entity, NULL); > if (ret) { _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx