Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp1284462rdh; Fri, 27 Oct 2023 09:32:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEWcXmbEvFp/NSkIWbsmK05i1V5l7z7ewle3VkSG2UbRpCp75H3tOMBSdP+EWpcXFXQWfcK X-Received: by 2002:a81:c645:0:b0:59a:f131:50fa with SMTP id q5-20020a81c645000000b0059af13150famr2865604ywj.47.1698424358706; Fri, 27 Oct 2023 09:32:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698424358; cv=none; d=google.com; s=arc-20160816; b=l+JNWcVHBB8bwqDPhWqJW+onhe8P+lkTnJVTbuY4y9fLeVyWCX8kLhYa/LQwe1WjMU CKZBmKhCDPe1LNJm2O8FiZ0LhC5Rp+dCqr9zkLR8BzovbEwxyuRmNMKsk1xUULGJyJoa 0mwKLH4uozC2eEGS/jFbIeYNw+ZQQLQuWz1ngTeBUw8SevaauRNOBS3WfgOi0vYoB972 qY1IhKyjBgqlVIAD5Kab9k+Shq6TRQ7ZBMD1/S8CD0olr9ADZrcZ52WL9f/sfP357aj8 wF5leHPpkexKSH3hvSwXUSvc9WeZAL9FjaophMykwDtj9MgCAy/FOHy2ok3BAoaecVwr zXRg== 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=Wu36lGoaonV5Odx6yz+PgYLGf3pbCs0BeOq0pqJPnPw=; fh=98Zn0Qam1Yt/Xf5Mbs6eB9yFj0PpyoXLvb00ayxBwNw=; b=gMIh0Kys1IHBZGrsy69BrSyNIP6oZURAyJgoAlG52AvXoa/xhOla3KJktNjb3Dr+3S HOmJCERmifbmlqrHQy456t2jH/PuFdN4XefaLB2vgmQaDeVjPZdDozRXjXJzoEfmvHiL CMFdFA4H3DZtNQm/5ca2D71wK9wi/dOWCUiVApFEInzijYdbPi5KibDLlyK0HfXxxofI HtQfstkxv4xzO2iLT3bwg4p6PqoEybiCW7iQXDVhMhf0rEeIxu9ipmM0oEX4du7QKf7C v5yPrqvoIjluBeBQmCutRgJFac0tsYHbVnljn7fjoW2UrlMswIOAv6141FwLbUbmCZyR 9wZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=P3vWQcsR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id n133-20020a81728b000000b005a7b0942ecesi3067305ywc.387.2023.10.27.09.32.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Oct 2023 09:32:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=P3vWQcsR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (Postfix) with ESMTP id A38AF85BEA4E; Fri, 27 Oct 2023 09:32:23 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231669AbjJ0QcH (ORCPT + 99 others); Fri, 27 Oct 2023 12:32:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34294 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231721AbjJ0QcF (ORCPT ); Fri, 27 Oct 2023 12:32:05 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8576211B for ; Fri, 27 Oct 2023 09:32:03 -0700 (PDT) Received: from localhost (cola.collaboradmins.com [195.201.22.229]) (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 93F406607323; Fri, 27 Oct 2023 17:32:01 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1698424322; bh=cdST41zz4Xh7cdHsxvEEbk6c5k5UXnNOVUkeHyEAKjY=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=P3vWQcsRrCviL0oMUJmcK53bzDSKtPhCZ0M/VqOKWMZl+UP5peJ+Bha8ncbvUNz/w 89TGVnmVl4rInQPWzFpGai/Er/93bUwynpxlj9gYSROMc+SaZ46eEvOTLz2qojh+yl 2U9Paw7jmPF7dcDtuffefm1tMFUVI8qbJWOflIUvbh+J5XxlDoM9MrqPzaZTAlZB1q ZfN8bntBWol7ImsK0EpcRSeL7+JwAGnvM/yFwgkNGs91GkT5/28EtJD6h/HvAWzvto xjQkh6qQGTDaCxqto5Cl22hx3mKB6zUoDZRGKlpYLTBKiKHYEusans3OB1K39u6jck 3OzE8Nwcv4qaA== Date: Fri, 27 Oct 2023 18:31:58 +0200 From: Boris Brezillon To: Danilo Krummrich Cc: airlied@gmail.com, daniel@ffwll.ch, matthew.brost@intel.com, christian.koenig@amd.com, faith@gfxstrand.net, luben.tuikov@amd.com, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH drm-misc-next v3] drm/sched: implement dynamic job-flow control Message-ID: <20231027183158.2dc4cce4@collabora.com> In-Reply-To: <8e117f9f-a01c-4242-8781-b2ed4969513b@redhat.com> References: <20231026161431.5934-1-dakr@redhat.com> <20231027102516.0e4b00ef@collabora.com> <8e117f9f-a01c-4242-8781-b2ed4969513b@redhat.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=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email 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 (pete.vger.email [0.0.0.0]); Fri, 27 Oct 2023 09:32:23 -0700 (PDT) On Fri, 27 Oct 2023 16:23:24 +0200 Danilo Krummrich wrote: > On 10/27/23 10:25, Boris Brezillon wrote: > > Hi Danilo, > > > > On Thu, 26 Oct 2023 18:13:00 +0200 > > Danilo Krummrich wrote: > > > >> Currently, job flow control is implemented simply by limiting the number > >> of jobs in flight. Therefore, a scheduler is initialized with a credit > >> limit that corresponds to the number of jobs which can be sent to the > >> hardware. > >> > >> 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 number of jobs. Therefore, add a field to track a job's > >> credit count, which represents the number of credits a job contributes > >> to the scheduler's credit limit. > >> > >> Signed-off-by: Danilo Krummrich > >> --- > >> Changes in V2: > >> ============== > >> - fixed up influence on scheduling fairness due to consideration of a job's > >> size > >> - If we reach a ready entity in drm_sched_select_entity() but can't actually > >> queue a job from it due to size limitations, just give up and go to sleep > >> until woken up due to a pending job finishing, rather than continue to try > >> other entities. > >> - added a callback to dynamically update a job's credits (Boris) > > > > This callback seems controversial. I'd suggest dropping it, so the > > patch can be merged. > > I don't think we should drop it just for the sake of moving forward. If there are objections > we'll discuss them. I've seen good reasons why the drivers you are working on require this, > while, following the discussion, I have *not* seen any reasons to drop it. It helps simplifying > driver code and doesn't introduce any complexity or overhead to existing drivers. Up to you. I'm just saying, moving one step in the right direction is better than being stuck, and it's not like adding this callback in a follow-up patch is super complicated either. If you're confident that we can get all parties to agree on keeping this hook, fine by me.