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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 8C615EE4993 for ; Mon, 21 Aug 2023 18:13:06 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 57BA910E151; Mon, 21 Aug 2023 18:13:06 +0000 (UTC) Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on2068.outbound.protection.outlook.com [40.107.95.68]) by gabe.freedesktop.org (Postfix) with ESMTPS id CE2F010E12A; Mon, 21 Aug 2023 18:13:04 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EgMNuzoar/M7dLQkGv0g/Ar1DnWcGJN12Ns3KwPAFQw+gOPrMWpk5bUEVobDPVe6pZ8/jlQzw67I9enDxB8KRj7cPlIzenLHx/qP5efLLgYA/SLXNWMeEvqYCG8AK24vHSLp5mos81I3PivzR0cqEwIWrBIjabZf6ELHQXrrtnrkbPCLNzNb4hWlVDUlyOSds8TzRROq6D+vKuvSYPPJE2rPAPJBDdBftFxK+k8c2jSE/JLUMVhhvTSpc9B1KO8/9i7XHgcd0NH2bzepNFNkqyGaPu/VG7M709EWYzzS2EEk3ZVnAG1RzHI+FZwY/hw6epw1ZyfYdZgV8yPwd4jlUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=kQkd2l5rpLG93TiltggGdmWnPYz3IyfZ6Aycm4a9llA=; b=JU4Ysb9SXuQsuFQuWnkaFO3Y8VOCNaykE7rTwZ1O6m2qW5dktnhzqTdj/lQoohr0eI/2BhlhiYKpAd3HEgCAUNYmpZEP/g9BlnLnGm/Ty+NJAqjy113uthss4tzZnzppCi1lnAsyu1w58ijmVcL+ucFW4DD0ofxZtW5S+nzkS15VQmmctsmj9eF1g1yqwdpplj710UlUrq8YpGstRjgR7KT5xT4jN7d2rxBkTIvKy0OFoBC136wH/zAoOXLsL610wLly3u8OmagW6Y5AWIwYsqb4KfmWdW5EGLWIndIIwQMxUs5jd2uPOSsSnsYziM6ido3tdlEtR39zEuzClx9eFA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kQkd2l5rpLG93TiltggGdmWnPYz3IyfZ6Aycm4a9llA=; b=QuH3pbt80beM94z1KPiMNV86GcSZGVJWNEsZthg3s3Ar2vD1K52iMq2XOwdnYUjDqnluPDPtpDX96DbmGaD+92hDId1VCCffYmA3Ed+JDmA8a/7H5oiiB90fT59yCFyzIMloU//iC0arIQplIqRKeQCz9R9HWEN2kU3TLa+aDlE= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from BN8PR12MB3587.namprd12.prod.outlook.com (2603:10b6:408:43::13) by SN7PR12MB6909.namprd12.prod.outlook.com (2603:10b6:806:263::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.20; Mon, 21 Aug 2023 18:13:01 +0000 Received: from BN8PR12MB3587.namprd12.prod.outlook.com ([fe80::3d:c14:667a:1c81]) by BN8PR12MB3587.namprd12.prod.outlook.com ([fe80::3d:c14:667a:1c81%4]) with mapi id 15.20.6699.022; Mon, 21 Aug 2023 18:13:01 +0000 Message-ID: <85107169-8a24-441f-6631-d99472d810f0@amd.com> Date: Mon, 21 Aug 2023 20:12:55 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Content-Language: en-US To: Danilo Krummrich , Matthew Brost References: <20230811023137.659037-1-matthew.brost@intel.com> <20230811023137.659037-2-matthew.brost@intel.com> <69b648f8-c6b3-5846-0d03-05a380d010d8@redhat.com> <069e6cd0-abd3-fdd9-217d-173e8f8e1d29@amd.com> <982800c1-e7d3-f276-51d0-1a431f92eacb@amd.com> <5fdf7d59-3323-24b5-a35a-bd60b06b4ce5@redhat.com> <0bf839df-db7f-41fa-8b34-59792d2ba8be@amd.com> <0d5af79a-ba3a-d4be-938f-81627db65b50@amd.com> <1820cb54-5f1e-d2e6-38fa-7161465ed061@amd.com> <9072642e-f4f6-4ff1-e11f-9bda8730750c@redhat.com> From: =?UTF-8?Q?Christian_K=c3=b6nig?= In-Reply-To: <9072642e-f4f6-4ff1-e11f-9bda8730750c@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: FR0P281CA0195.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:ab::6) To BN8PR12MB3587.namprd12.prod.outlook.com (2603:10b6:408:43::13) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8PR12MB3587:EE_|SN7PR12MB6909:EE_ X-MS-Office365-Filtering-Correlation-Id: 1330bae0-67b2-4329-f5d3-08dba27241a1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9eqO76rpor66FsDbBOPRbjOF4P4ppSKohs/oCJKcRqFc7YiE1BZPgVxPT1AeRSSZSaym/Qyq+8PV2tr9ENnxSLaYMMiCXztB5ymHNGSlvl39OPbSSJrB9j5WPlv2cp9fzjZ0ee2fX/AQbATCgYxN9ZJxzkSJjGUdjdFpxvivDPU4BiTo2l1KzFCBMr+YHQ4zHVQuKnImlDLfJOlX3AEwM9etr9QSyCSnmURZc021RMW8CA+gFyNuCLnsrNib8YviALchabwMW0+16rw7NFeqlcxcbUwqMb2Jca+kCMFCZRXmcONHpBQF4kFvg/1FZDviD/FKLz24iMQi31i682RofSbcbl0evijGVL8otUIqayFFU2zObSwnmWjZfdQAFnsqbSbxqRs1B7nQgnbZL01A+Osh+k/CQZjepfMD7jGi9UC4n8UDntF5Wz77dDd6UcWHYxe1NKM4AYH8wqfGKf0UA2nkuQ/uPjRIS7guowYWjdSIte+lEBByc/RrdVXYhkCsZSBZ5fH4U6CQD+Rd5UtLDFNNnuwAQ9NkB9gitslD0/3vH12Rgw+bH9dO5g6/Sr5u1LiHzM41Qpxd8TA7G8QQdVfyfee/g2EM6iOjYaGfgxtC1RE6+6CS39A4JvjNR8XWTYxLWNVvww2KcuVNuRpnig== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BN8PR12MB3587.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(396003)(376002)(136003)(346002)(39860400002)(366004)(186009)(1800799009)(451199024)(66476007)(66556008)(316002)(66946007)(6512007)(110136005)(8676002)(8936002)(2616005)(4326008)(36756003)(41300700001)(478600001)(6666004)(38100700002)(53546011)(6506007)(6486002)(83380400001)(66574015)(2906002)(7416002)(86362001)(31686004)(31696002)(5660300002)(26005)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?UkhQZVJoYWJTMWNCKzNZVmdEZzhvQjc1UXBnSTdTd1JPekI5a3h2MHZwL1RW?= =?utf-8?B?TlIyV2s4a0h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ZFRTUTRnd3BGYmdZVzU5NFRHRm1vaUx6Yllx?= =?utf-8?B?SEsvWkRZeVpSMTZYc0I5SVdUcFIyc05lOWI4VGRqV2VLYjhhWVUxeFFQTXE4?= =?utf-8?B?cEdKc0RZRVBoaVVkYjJLVVBjaThrYmMvSXloYzR3Slk0TFd1c2VGazRQdnR4?= =?utf-8?B?bzZsaGJXYzVnUGswVGJEZW9uNTBTZmtnUi8ycnlrTlJHZVRNS2FoTmJpaFhO?= =?utf-8?B?VDR1SlN4d05zSERaaG1uaXFRWGZRa2JEMkYycWxZbjY5a25wMGxUamxjVHFj?= =?utf-8?Q?3d6mFqlDbh1QCv/ODDYpMRjrA?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1330bae0-67b2-4329-f5d3-08dba27241a1 X-MS-Exchange-CrossTenant-AuthSource: BN8PR12MB3587.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Aug 2023 18:13:01.6219 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: s19suUpOS1H5XhW8RJq38IJZ9Ykkou7TZjzEahm5Ezmy8qaG/D/WVRgjOCTSvcd2 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB6909 Subject: Re: [Intel-xe] [PATCH v2 1/9] drm/sched: Convert drm scheduler to use a work queue rather than kthread X-BeenThere: intel-xe@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Xe graphics driver List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: robdclark@chromium.org, sarah.walker@imgtec.com, ketil.johnsen@arm.com, lina@asahilina.net, Liviu.Dudau@arm.com, dri-devel@lists.freedesktop.org, luben.tuikov@amd.com, donald.robson@imgtec.com, boris.brezillon@collabora.com, intel-xe@lists.freedesktop.org, faith.ekstrand@collabora.com Errors-To: intel-xe-bounces@lists.freedesktop.org Sender: "Intel-xe" Am 21.08.23 um 20:01 schrieb Danilo Krummrich: > On 8/21/23 16:07, Christian König wrote: >> Am 18.08.23 um 13:58 schrieb Danilo Krummrich: >>> [SNIP] >>>> I only see two possible outcomes: >>>> 1. You return -EBUSY (or similar) error code indicating the the hw >>>> can't receive more commands. >>>> 2. Wait on previously pushed commands to be executed. >>>> (3. Your driver crash because you accidentally overwrite stuff in >>>> the ring buffer which is still executed. I just assume that's >>>> prevented). >>>> >>>> Resolution #1 with -EBUSY is actually something the UAPI should not >>>> do, because your UAPI then depends on the specific timing of >>>> submissions which is a really bad idea. >>>> >>>> Resolution #2 is usually bad because it forces the hw to run dry >>>> between submission and so degrade performance. >>> >>> I agree, that is a good reason for at least limiting the maximum job >>> size to half of the ring size. >>> >>> However, there could still be cases where two subsequent jobs are >>> submitted with just a single IB, which as is would still block >>> subsequent jobs to be pushed to the ring although there is still >>> plenty of space. Depending on the (CPU) scheduler latency, such a >>> case can let the HW run dry as well. >> >> Yeah, that was intentionally not done as well. The crux here is that >> the more you push to the hw the worse the scheduling granularity >> becomes. It's just that neither Xe nor Nouveau relies that much on >> the scheduling granularity at all (because of hw queues). >> >> But Xe doesn't seem to need that feature and I would still try to >> avoid it because the more you have pushed to the hw the harder it is >> to get going again after a reset. >> >>> >>> Surely, we could just continue decrease the maximum job size even >>> further, but this would result in further overhead on user and >>> kernel for larger IB counts. Tracking the actual job size seems to >>> be the better solution for drivers where the job size can vary over >>> a rather huge range. >> >> I strongly disagree on that. A larger ring buffer is trivial to allocate > > That sounds like a workaround to me. The problem, in the case above, > isn't that the ring buffer does not have enough space, the problem is > that we account for the maximum job size although the actual job size > is much smaller. And enabling the scheduler to track the actual job > size is trivial as well. That's what I agree on, so far I just didn't see the reason for doing it but at least a few reason for not doing it. > >> and if userspace submissions are so small that the scheduler can't >> keep up submitting them then your ring buffer size is your smallest >> problem. >> >> In other words the submission overhead will completely kill your >> performance and you should probably consider stuffing more into a >> single submission. > > I fully agree and that is also the reason why I want to keep the > maximum job size as large as possible. > > However, afaik with Vulkan it's the applications themselves deciding > when and with how many command buffers a queue is submitted (@Faith: > please correct me if I'm wrong). Hence, why not optimize for this case > as well? It's not that it would make another case worse, right? As I said it does make both the scheduling granularity as well as the reset behavior worse. In general I think we should try to push just enough work to the hardware to keep it busy and not as much as possible. So as long as nobody from userspace comes and says we absolutely need to optimize this use case I would rather not do it. Regards, Christian. > > - Danilo > >> >> Regards, >> Christian. >> >>> >>> - Danilo >> >