Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp1832539rdh; Tue, 26 Sep 2023 05:09:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFy2U0lypbr7TpP6FbBYbDFXfCVtjCTwekqc0b6B10ppCZKlHvqBPy7XfTNn8d2nEF1IBMB X-Received: by 2002:a17:903:2301:b0:1c6:e4b:bbeb with SMTP id d1-20020a170903230100b001c60e4bbbebmr5922749plh.56.1695730150341; Tue, 26 Sep 2023 05:09:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695730150; cv=none; d=google.com; s=arc-20160816; b=k0c6z6YlmN5XjXvs0DvIGq50OUwn1SEqOJ4KEIcc935pZ4NKd/4MAW92fbw8cm8N1W 2i9K9EIpYhGQWAvek5aejlNOEupnM6gF9zd51c6yYrohWJzO1wQoUfXZ++f0Gv6yuPzB K3xQtUMpwLTdtRwQT8cS566+FM/QmC3eyPX7jfB2DwXL6e0mbK8WzXTzAADJyjFXyzxc hpH3suM7RlUlEZaaDSE2X2EJHjgZ9QBKnZiW2Lvcw3+2wljBxTfxCSXR6oPj0PDFZJG3 STtENROizOnHEXMVwE5iFOrMQGIgoKntrgTyEpQEw+dapXWbwx+uksWCbmLbWZiuAl5r e32Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=Un9kNmibt/1LyNRx3dilYTDLfKHRNSrtYcTFTDYcqVI=; fh=sjB47R/PQuTMdny83DGa6TS8/BKP8ePNRCyc218W7Y0=; b=GryUE1MLF6uGW8GSnzIm2SKN/9CDezUjegA6kvtnXaOJnAYreAazXFhDa0Mc7oIzUo /tJzuUyRLHpcX+86ex7M5pnTTQsJu7B9XhbJv+uPxFrCWHaGK1dcCBLZr1myjwTj4f5u JETtMT14oVZs1p3ZI/N85TQn+xQrgdOYmU6bkz1GtaNSG5FuPcT6JFeqUPSnCnt6GQBn mGBBRdLga5IwSY31POWf2JQMtmM7OpcclT+fL5HhkNzBlurOdHDKgw/wByrH0uaJpQlt mMkUuNVuHJZRYgOtyXAnVFQsj2AUmgAQMlmv2Q/wRVySiwPSz5vC+Z9dXf749p5sxiRJ Y5gg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=izubzpAd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id b9-20020a170902650900b001c5f71b145dsi7618988plk.162.2023.09.26.05.09.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Sep 2023 05:09:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=izubzpAd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id C54A3812DBD7; Tue, 26 Sep 2023 00:11:47 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231908AbjIZHLp (ORCPT + 99 others); Tue, 26 Sep 2023 03:11:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40526 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229585AbjIZHLl (ORCPT ); Tue, 26 Sep 2023 03:11:41 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B903AEB for ; Tue, 26 Sep 2023 00:11:34 -0700 (PDT) Received: from localhost (unknown [IPv6:2a01:e0a:2c:6930:5cf4:84a1:2763:fe0d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: bbrezillon) by madras.collabora.co.uk (Postfix) with ESMTPSA id A28776607313; Tue, 26 Sep 2023 08:11:32 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1695712293; bh=Un9kNmibt/1LyNRx3dilYTDLfKHRNSrtYcTFTDYcqVI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=izubzpAdJUmlqw799jWDhJJwlf44rQt8twSWJ7JGD6gmAbR0lsGYGZ+Wte/v0Q54c zNTE9YVhhw3sSa9DUuHDZ+O5e4UuZ9uRPjYMWoZDNhKz/caK/sAK7ggb7gIIs6VU3B yFJHRTNBtugS2K+RNTtxYSOdac2NG/W7kwMLyiI66eJW2jJSuFGD+LTb+M2I9wNEMq hi+2wAcXJ8pojhmqHY1yHpTndhNuQe6uVj+CQ0Vez2pbR35Sg2ueuG18L5CwBesRQ8 9YsR8MpuMCbjSBb0INtNmhH2oo2M0LiMFp+MPQedfmdCLsXdGNGLxbStHcoq09Z46+ sIytARsTNr70Q== Date: Tue, 26 Sep 2023 09:11:29 +0200 From: Boris Brezillon To: Christian =?UTF-8?B?S8O2bmln?= Cc: Danilo Krummrich , airlied@gmail.com, daniel@ffwll.ch, matthew.brost@intel.com, faith.ekstrand@collabora.com, luben.tuikov@amd.com, dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org, linux-kernel@vger.kernel.org, Donald Robson , Frank Binns , Sarah Walker Subject: Re: [PATCH drm-misc-next 1/3] drm/sched: implement dynamic job flow control Message-ID: <20230926091129.2d7d7472@collabora.com> In-Reply-To: References: <20230924224555.15595-1-dakr@redhat.com> <20230925145513.49abcc52@collabora.com> Organization: Collabora X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 26 Sep 2023 00:11:48 -0700 (PDT) On Mon, 25 Sep 2023 19:55:21 +0200 Christian K=C3=B6nig wrote: > Am 25.09.23 um 14:55 schrieb Boris Brezillon: > > +The imagination team, who's probably interested too. > > > > On Mon, 25 Sep 2023 00:43:06 +0200 > > Danilo Krummrich wrote: > > =20 > >> Currently, job flow control is implemented simply by limiting the amou= nt > >> of jobs in flight. Therefore, a scheduler is initialized with a > >> submission limit that corresponds to a certain amount of jobs. > >> > >> This implies that for each job drivers need to account for the maximum > >> job size possible in order to not overflow the ring buffer. > >> > >> However, there are drivers, such as Nouveau, where the job size has a > >> rather large range. For such drivers it can easily happen that job > >> submissions not even filling the ring by 1% can block subsequent > >> submissions, which, in the worst case, can lead to the ring run dry. > >> > >> In order to overcome this issue, allow for tracking the actual job size > >> instead of the amount job jobs. Therefore, add a field to track a job's > >> submission units, which represents the amount of units a job contribut= es > >> to the scheduler's submission limit. =20 > > As mentioned earlier, this might allow some simplifications in the > > PowerVR driver where we do flow-control using a dma_fence returned > > through ->prepare_job(). The only thing that'd be missing is a way to > > dynamically query the size of a job (a new hook?), instead of having the > > size fixed at creation time, because PVR jobs embed native fence waits, > > and the number of native fences will decrease if some of these fences > > are signalled before ->run_job() is called, thus reducing the job size.= =20 >=20 > Exactly that is a little bit questionable since it allows for the device= =20 > to postpone jobs infinitely. >=20 > It would be good if the scheduler is able to validate if it's ever able=20 > to run the job when it is pushed into the entity. Yes, we do that already. We check that the immutable part of the job (everything that's not a native fence wait) fits in the ringbuf.