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 EBA50C6FD1C for ; Wed, 22 Mar 2023 14:08:52 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 244FE10E951; Wed, 22 Mar 2023 14:08:52 +0000 (UTC) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on20608.outbound.protection.outlook.com [IPv6:2a01:111:f400:7eaa::608]) by gabe.freedesktop.org (Postfix) with ESMTPS id DC56210E951 for ; Wed, 22 Mar 2023 14:08:49 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=e/eTsDnKI7Q8PXDPKJHPiqTz0D2HlFZNc3koxMiqQDqmm7MbKeJ0VDK+K6qU/J9GQb+94O2DB2f96j923J1UmrROixrKkJ14cBMmVNueMhmmzXHDRVE2SpIDscWPeAMymsUZvX493v+cjdvl590NpqRnt9CYMZkmKfQKPZ0Iou+BkBC3Q61fHZcTBrFyO0wVE8NbVj6cmlaSy63gieKV+4IdNL+Swq2+HTxDpCdZ6n+5hddUC/QRT7QPrlQcy6IRAjqrilfh38xKPTRVPpcr37gZVBM5ijadFJm1Fu+dzveBZ7ZuBg+modrm9p5199svy0PGTOCYxYCrJ83X2QenBg== 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=6UE8smLmVQ5INSaglCyTAlfu1wB1PEymc2g4zV4gSg8=; b=ETiRpEl7hob//vRk0xkwX1P/GxJzNw181UgdhaiTX4Rbdz8XS7nQ+RgXpzzLS3NHu5ekf8NISFWcCOIbU2fps+G164LDDez46glGZMkt0CtXEaFeAomQ24+KY3P24S2HoJtAOf3NtUsz0+8EFTumtdBc+4FOflcKqQEjtLcaEjRXRYfKPCGtxfYVSBpWha6mQEoVEWOwCEniwGIFZsHRTDDsK6YQtI74KpkRwZfT6d2IiRcuyGtb6Np9bazFXcFiPuvkDsPV2QmLo+Fao4fcCM292Kua3m1o9fhScIcsgVHEZVrLSos3fSRgY/Zx594zdDiyWSjLwKP5uz/rhWLoPw== 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=6UE8smLmVQ5INSaglCyTAlfu1wB1PEymc2g4zV4gSg8=; b=DYqhr1dIU6jj8sVfYA2zqduZsla432XLuqXcQ6hsGvll/4SLedjk0k5fO3D7Mr01FK2uffvhUM12PaRiaJAEdyHjskbJt4bq3BBLPPUWbzzUn/l2ALmpY7b4MDgpjxfuLF7uzDP5/y/uccNvcLYWC9yXdhJa70JL4ilPHwhjAXQ= 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 CY8PR12MB8243.namprd12.prod.outlook.com (2603:10b6:930:78::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.37; Wed, 22 Mar 2023 14:08:47 +0000 Received: from BN8PR12MB3587.namprd12.prod.outlook.com ([fe80::d23f:bb1:df95:3918]) by BN8PR12MB3587.namprd12.prod.outlook.com ([fe80::d23f:bb1:df95:3918%4]) with mapi id 15.20.6178.037; Wed, 22 Mar 2023 14:08:47 +0000 Content-Type: multipart/alternative; boundary="------------JdTSK2CDwiaoDb3kxj3nwy0B" Message-ID: Date: Wed, 22 Mar 2023 15:08:42 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: [PATCH v3 1/5] drm/amdgpu: add UAPI for workload hints to ctx ioctl Content-Language: en-US To: =?UTF-8?B?TWFyZWsgT2zFocOhaw==?= , =?UTF-8?Q?Christian_K=c3=b6nig?= References: <20220926214014.5450-1-shashank.sharma@amd.com> <20220926214014.5450-2-shashank.sharma@amd.com> <0e904e40-ee6f-dea2-b2de-3e408a72908e@gmail.com> From: =?UTF-8?Q?Christian_K=c3=b6nig?= In-Reply-To: X-ClientProxiedBy: FR3P281CA0147.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:95::10) To BN8PR12MB3587.namprd12.prod.outlook.com (2603:10b6:408:43::13) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8PR12MB3587:EE_|CY8PR12MB8243:EE_ X-MS-Office365-Filtering-Correlation-Id: a3cfb827-ab11-4b81-8c59-08db2adef407 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: eKWtfLHbuUilBdaG/R2AJmvMH2/eMLWbpwa81lhOClnkow+M9u9oyhxiM5g3sH0/MjVxOBHDIhFicoa2Pq7V7qg3LxmgbRKDJ4eaakmBWBVHBC6GLYVuCYYwciqz76HkaLTV6BsS/KmCpGBzAusNcunFQeTaupwrSQMwOCGOKFczd1Oi6MJCY5iUkLlUTXbo4SYWkyvQGpfeOjJ38q+Hj5nR/tZuXmiM50F7LPPShI3DIb9A5R2CxJq0cAqxWzJNQB+vp66QKC1U1Md6V9eQPNna8fezMLms4d+IVxw/1OmKNJHWUJgsQA4u7QOujFS3EAsZQfgsvHDcpVmHjR9Posd3F0bWhYJFzFLbXFflIW1fD/2cmrqBQmtmWkV53GdCk52EZ3Z6c0IOoaSLQXPrIsZL34DHGdCzTIzo4P3BrA+kW2kTsDnw5tg/d5Iipicvb+9AmmQLCmDY+aCDItvh8gAyn5iny6mKTUOEEqYMOTog50ao629oAGIyjFEhz5xSaB3SSnQc2q416SA/i0YYBpeVZYayhhZ3gaVcmHkGXSPInD6knM6k/w2APpcu2/qkw0672TaH3Oz/lG1UL7icKsUdm1cLD669j7B+iT81ar+SL9oXuRye8QG1N93zkJYKKBVTciV372BhP++MrIXZ61p5IFhdbmu8j9N7Z43ZvICAiXSXV2WUCEZC6NVncquu 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:(13230025)(4636009)(396003)(376002)(136003)(39860400002)(366004)(346002)(451199018)(31686004)(2616005)(6506007)(6512007)(6666004)(966005)(33964004)(6486002)(53546011)(166002)(186003)(86362001)(38100700002)(31696002)(54906003)(2906002)(478600001)(316002)(66946007)(4326008)(110136005)(8676002)(41300700001)(66556008)(8936002)(66476007)(5660300002)(36756003)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?OFdNeDNrQUdMbHR0L2hKcEJ6ZUVvbTl6NkNlQ1dmeUVaWHNsanIyNks1TnBh?= =?utf-8?B?dTd1K2U2QlZ1UVB3Uzk5bjVYUnZzMXBOVG1QaDRGOHJJSlN2NVgraHFJL2VG?= =?utf-8?B?VEdtLzJQMHJlUklkYXZWdXNETU1mRG0yQXJMZ2Fsa2xTeUtUVTByd3p0YjFJ?= =?utf-8?B?dWVqMG5xOVU4UXl5b2xLTHFaV0pGV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WlU4?= =?utf-8?B?SDBDa3ZCbXQ5cUxsdDE0N2dLT2dvRUNoa21Hc1ZOeWp1RXRwbk41STNLSHFX?= =?utf-8?B?bHpBUFpuWlF3K2p4eE44a05LQmxMKzBsR1V4ZlF2Q3k0ZmNBaEthYkt1QmNv?= =?utf-8?B?M0VWQWxrRnJrVkhjUGs3RUU3VWF1cm1RWDU2Z1RDcENsajAxdXY3am1XbFdi?= =?utf-8?Q?QZNlMggbGDslX39V7r5jVJ1p2duQTVagOs902zovNlWg?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: a3cfb827-ab11-4b81-8c59-08db2adef407 X-MS-Exchange-CrossTenant-AuthSource: BN8PR12MB3587.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Mar 2023 14:08:46.9704 (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: 1rCBj2Jy6gqPKfF2j8EDxMfOss9WA1/6mjuG9sIuygkgJYoLFgnzuaD1QeCDhx3W X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB8243 X-BeenThere: amd-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion list for AMD gfx List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Deucher, Alexander" , "Somalapuram, Amaranath" , "amd-gfx@lists.freedesktop.org" , "Sharma, Shashank" Errors-To: amd-gfx-bounces@lists.freedesktop.org Sender: "amd-gfx" --------------JdTSK2CDwiaoDb3kxj3nwy0B Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Well completely agree that we shouldn't have unused API. That's why I said we should remove the getting the hint from the UAPI. But what's wrong with setting it after creating the context? Don't you know enough about the use case? I need to understand the background a bit better here. Christian. Am 22.03.23 um 15:05 schrieb Marek Olšák: > The option to change the hint after context creation and get the hint > would be unused uapi, and AFAIK we are not supposed to add unused > uapi. What I asked is to change it to a uapi that userspace will > actually use. > > Marek > > On Tue, Mar 21, 2023 at 9:54 AM Christian König > wrote: > > Yes, I would like to avoid having multiple code paths for context > creation. > > Setting it later on should be equally to specifying it on creation > since we only need it during CS. > > Regards, > Christian. > > Am 21.03.23 um 14:00 schrieb Sharma, Shashank: >> >> [AMD Official Use Only - General] >> >> When we started this patch series, the workload hint was a part >> of the ctx_flag only, >> >> But we changed that after the design review, to make it more like >> how we are handling PSTATE. >> >> Details: >> >> https://patchwork.freedesktop.org/patch/496111/ >> >> Regards >> >> Shashank >> >> *From:*Marek Olšák >> *Sent:* 21 March 2023 04:05 >> *To:* Sharma, Shashank >> >> *Cc:* amd-gfx@lists.freedesktop.org; Deucher, Alexander >> ; >> Somalapuram, Amaranath >> ; Koenig, Christian >> >> *Subject:* Re: [PATCH v3 1/5] drm/amdgpu: add UAPI for workload >> hints to ctx ioctl >> >> I think we should do it differently because this interface will >> be mostly unused by open source userspace in its current form. >> >> Let's set the workload hint in drm_amdgpu_ctx_in::flags, and that >> will be immutable for the lifetime of the context. No other >> interface is needed. >> >> Marek >> >> On Mon, Sep 26, 2022 at 5:41 PM Shashank Sharma >> wrote: >> >> Allow the user to specify a workload hint to the kernel. >> We can use these to tweak the dpm heuristics to better match >> the workload for improved performance. >> >> V3: Create only set() workload UAPI (Christian) >> >> Signed-off-by: Alex Deucher >> Signed-off-by: Shashank Sharma >> --- >>  include/uapi/drm/amdgpu_drm.h | 17 +++++++++++++++++ >>  1 file changed, 17 insertions(+) >> >> diff --git a/include/uapi/drm/amdgpu_drm.h >> b/include/uapi/drm/amdgpu_drm.h >> index c2c9c674a223..23d354242699 100644 >> --- a/include/uapi/drm/amdgpu_drm.h >> +++ b/include/uapi/drm/amdgpu_drm.h >> @@ -212,6 +212,7 @@ union drm_amdgpu_bo_list { >>  #define AMDGPU_CTX_OP_QUERY_STATE2     4 >>  #define AMDGPU_CTX_OP_GET_STABLE_PSTATE        5 >>  #define AMDGPU_CTX_OP_SET_STABLE_PSTATE        6 >> +#define AMDGPU_CTX_OP_SET_WORKLOAD_PROFILE     7 >> >>  /* GPU reset status */ >>  #define AMDGPU_CTX_NO_RESET            0 >> @@ -252,6 +253,17 @@ union drm_amdgpu_bo_list { >>  #define AMDGPU_CTX_STABLE_PSTATE_MIN_MCLK  3 >>  #define AMDGPU_CTX_STABLE_PSTATE_PEAK  4 >> >> +/* GPU workload hints, flag bits 8-15 */ >> +#define AMDGPU_CTX_WORKLOAD_HINT_SHIFT     8 >> +#define AMDGPU_CTX_WORKLOAD_HINT_MASK      (0xff << >> AMDGPU_CTX_WORKLOAD_HINT_SHIFT) >> +#define AMDGPU_CTX_WORKLOAD_HINT_NONE      (0 << >> AMDGPU_CTX_WORKLOAD_HINT_SHIFT) >> +#define AMDGPU_CTX_WORKLOAD_HINT_3D        (1 << >> AMDGPU_CTX_WORKLOAD_HINT_SHIFT) >> +#define AMDGPU_CTX_WORKLOAD_HINT_VIDEO     (2 << >> AMDGPU_CTX_WORKLOAD_HINT_SHIFT) >> +#define AMDGPU_CTX_WORKLOAD_HINT_VR        (3 << >> AMDGPU_CTX_WORKLOAD_HINT_SHIFT) >> +#define AMDGPU_CTX_WORKLOAD_HINT_COMPUTE   (4 << >> AMDGPU_CTX_WORKLOAD_HINT_SHIFT) >> +#define AMDGPU_CTX_WORKLOAD_HINT_MAX >> AMDGPU_CTX_WORKLOAD_HINT_COMPUTE >> +#define AMDGPU_CTX_WORKLOAD_INDEX(n)      (n >> >> AMDGPU_CTX_WORKLOAD_HINT_SHIFT) >> + >>  struct drm_amdgpu_ctx_in { >>         /** AMDGPU_CTX_OP_* */ >>         __u32   op; >> @@ -281,6 +293,11 @@ union drm_amdgpu_ctx_out { >>                         __u32   flags; >>                         __u32   _pad; >>                 } pstate; >> + >> +               struct { >> +                       __u32   flags; >> +                       __u32   _pad; >> +               } workload; >>  }; >> >>  union drm_amdgpu_ctx { >> -- >> 2.34.1 >> > --------------JdTSK2CDwiaoDb3kxj3nwy0B Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit Well completely agree that we shouldn't have unused API. That's why I said we should remove the getting the hint from the UAPI.

But what's wrong with setting it after creating the context? Don't you know enough about the use case? I need to understand the background a bit better here.

Christian.

Am 22.03.23 um 15:05 schrieb Marek Olšák:
The option to change the hint after context creation and get the hint would be unused uapi, and AFAIK we are not supposed to add unused uapi. What I asked is to change it to a uapi that userspace will actually use.

Marek

On Tue, Mar 21, 2023 at 9:54 AM Christian König <ckoenig.leichtzumerken@gmail.com> wrote:
Yes, I would like to avoid having multiple code paths for context creation.

Setting it later on should be equally to specifying it on creation since we only need it during CS.

Regards,
Christian.

Am 21.03.23 um 14:00 schrieb Sharma, Shashank:

[AMD Official Use Only - General]

 

When we started this patch series, the workload hint was a part of the ctx_flag only,

But we changed that after the design review, to make it more like how we are handling PSTATE.

 

Details:

https://patchwork.freedesktop.org/patch/496111/

 

Regards

Shashank

 

From: Marek Olšák <maraeo@gmail.com>
Sent: 21 March 2023 04:05
To: Sharma, Shashank <Shashank.Sharma@amd.com>
Cc: amd-gfx@lists.freedesktop.org; Deucher, Alexander <Alexander.Deucher@amd.com>; Somalapuram, Amaranath <Amaranath.Somalapuram@amd.com>; Koenig, Christian <Christian.Koenig@amd.com>
Subject: Re: [PATCH v3 1/5] drm/amdgpu: add UAPI for workload hints to ctx ioctl

 

I think we should do it differently because this interface will be mostly unused by open source userspace in its current form.

 

Let's set the workload hint in drm_amdgpu_ctx_in::flags, and that will be immutable for the lifetime of the context. No other interface is needed.

 

Marek

 

On Mon, Sep 26, 2022 at 5:41 PM Shashank Sharma <shashank.sharma@amd.com> wrote:

Allow the user to specify a workload hint to the kernel.
We can use these to tweak the dpm heuristics to better match
the workload for improved performance.

V3: Create only set() workload UAPI (Christian)

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Shashank Sharma <shashank.sharma@amd.com>
---
 include/uapi/drm/amdgpu_drm.h | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/include/uapi/drm/amdgpu_drm.h b/include/uapi/drm/amdgpu_drm.h
index c2c9c674a223..23d354242699 100644
--- a/include/uapi/drm/amdgpu_drm.h
+++ b/include/uapi/drm/amdgpu_drm.h
@@ -212,6 +212,7 @@ union drm_amdgpu_bo_list {
 #define AMDGPU_CTX_OP_QUERY_STATE2     4
 #define AMDGPU_CTX_OP_GET_STABLE_PSTATE        5
 #define AMDGPU_CTX_OP_SET_STABLE_PSTATE        6
+#define AMDGPU_CTX_OP_SET_WORKLOAD_PROFILE     7

 /* GPU reset status */
 #define AMDGPU_CTX_NO_RESET            0
@@ -252,6 +253,17 @@ union drm_amdgpu_bo_list {
 #define AMDGPU_CTX_STABLE_PSTATE_MIN_MCLK  3
 #define AMDGPU_CTX_STABLE_PSTATE_PEAK  4

+/* GPU workload hints, flag bits 8-15 */
+#define AMDGPU_CTX_WORKLOAD_HINT_SHIFT     8
+#define AMDGPU_CTX_WORKLOAD_HINT_MASK      (0xff << AMDGPU_CTX_WORKLOAD_HINT_SHIFT)
+#define AMDGPU_CTX_WORKLOAD_HINT_NONE      (0 << AMDGPU_CTX_WORKLOAD_HINT_SHIFT)
+#define AMDGPU_CTX_WORKLOAD_HINT_3D        (1 << AMDGPU_CTX_WORKLOAD_HINT_SHIFT)
+#define AMDGPU_CTX_WORKLOAD_HINT_VIDEO     (2 << AMDGPU_CTX_WORKLOAD_HINT_SHIFT)
+#define AMDGPU_CTX_WORKLOAD_HINT_VR        (3 << AMDGPU_CTX_WORKLOAD_HINT_SHIFT)
+#define AMDGPU_CTX_WORKLOAD_HINT_COMPUTE   (4 << AMDGPU_CTX_WORKLOAD_HINT_SHIFT)
+#define AMDGPU_CTX_WORKLOAD_HINT_MAX      AMDGPU_CTX_WORKLOAD_HINT_COMPUTE
+#define AMDGPU_CTX_WORKLOAD_INDEX(n)      (n >> AMDGPU_CTX_WORKLOAD_HINT_SHIFT)
+
 struct drm_amdgpu_ctx_in {
        /** AMDGPU_CTX_OP_* */
        __u32   op;
@@ -281,6 +293,11 @@ union drm_amdgpu_ctx_out {
                        __u32   flags;
                        __u32   _pad;
                } pstate;
+
+               struct {
+                       __u32   flags;
+                       __u32   _pad;
+               } workload;
 };

 union drm_amdgpu_ctx {
--
2.34.1



--------------JdTSK2CDwiaoDb3kxj3nwy0B--