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 68C80C0015E for ; Fri, 4 Aug 2023 00:19:25 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8812910E056; Fri, 4 Aug 2023 00:19:23 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.43]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3325310E056; Fri, 4 Aug 2023 00:19:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1691108360; x=1722644360; h=message-id:date:subject:to:cc:references:from: in-reply-to:content-transfer-encoding:mime-version; bh=1eHMUPkNy1IN7cbiv3VPM/FPv4c2M0llo4cw85ebdXQ=; b=Yu9Wof21SQ/bYoghDRgCvqQQHU8DqS0alXlLesCIqraCYb1nnsfhyRSb exr9ikM8ZF07DQZ5M7E11I5adKdPSzLtiGIQPJPF2J4/dsaGs3A1+YlGQ yFO0jY/kOLAQKFvIcoscAENTOWuYU7lETTmv2Puhqc00Eo925gxGten/R k8BxJXAcMawsDxyR+PM6QYQ/xPkkd/5jlXDivVqFu32sU243omRGe9GfU ST3KGW+U5K4eucRHV6R5Vz5ARmnmf9qCD0QCalYVZ0Lb1OY7kXrXZEsPx WLs7haAAW4ljKHzlWn9uR7lT/9mGwYRZPNf1TNX6TdCYyXKl/OfzGRvLW A==; X-IronPort-AV: E=McAfee;i="6600,9927,10791"; a="456399936" X-IronPort-AV: E=Sophos;i="6.01,253,1684825200"; d="scan'208";a="456399936" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Aug 2023 17:19:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10791"; a="764883909" X-IronPort-AV: E=Sophos;i="6.01,253,1684825200"; d="scan'208";a="764883909" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by orsmga001.jf.intel.com with ESMTP; 03 Aug 2023 17:19:19 -0700 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Thu, 3 Aug 2023 17:19:18 -0700 Received: from fmsmsx602.amr.corp.intel.com (10.18.126.82) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Thu, 3 Aug 2023 17:19:18 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27 via Frontend Transport; Thu, 3 Aug 2023 17:19:18 -0700 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.48) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.27; Thu, 3 Aug 2023 17:19:18 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Rj3PCIrmUMi6/ohMoxiUPi0ZA6b6zn5+eMYPk3R8oOhbYa1STWxCaskYnCOYgGxfJ7cHjIpI6DUJYsaPOSJOPSflCvOxfdEAx0ghR9pNhlfdjyeVsy01jStVKZlA6Vq1GIorFrePd4EcNkVF5YfwDsw2b7GRdgrKeJH1DttMIme6pAmvIWAMve2b1EaMUXmoQ9bKAiogHW14p1m3L7JXBauqUIvdIjuSWzqXi8VsPC2LusNDBaTtuPYmi6hSPosT658r9WHDmXusRC2GFzCXgsGKVkp1L+8RpSv1y3PAcajYFWAhHZBV9a9Fu2tfuoy7Qv/lYToJUu661E9r0wYHUA== 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=y+KjpVDdp2ooE1nxkHB7/KBOuWwdgt/MFM9oL+weHp8=; b=BVrXwUF+u3sGmHg5aIyqLmkCwXLl9xvMyi0xjktlOfQzTaQrohA/bUEnOY4EPQkxPPkNus2sfT+JUZP2WT1fG6E061qhqUS2Na7VzlPT1v3Yc65/ZFqb9x7fMO+ykc8v8CiwNb6Epl4nnnQ3J0H73SxgglZQzpTylma8o8+q8bq+waUAF2i2Pz4S+tMZVSwErX33hUsBjNmcOicJH80fGsBIpoxNHwcovNsYusUhPnJlv2ZaiQdWLLD+PX75mBKw05ihhnV58o0wvRpJZhwfBg4/6j+J7Rk6jGt6TqkC3wvisagyoS9dXOZfDDoPn3nNbYQfmnkboSB1s3P7WIy+Mw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from SN7PR11MB7705.namprd11.prod.outlook.com (2603:10b6:806:32f::16) by CYYPR11MB8385.namprd11.prod.outlook.com (2603:10b6:930:c1::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.20; Fri, 4 Aug 2023 00:19:11 +0000 Received: from SN7PR11MB7705.namprd11.prod.outlook.com ([fe80::32cf:820f:a18b:422d]) by SN7PR11MB7705.namprd11.prod.outlook.com ([fe80::32cf:820f:a18b:422d%7]) with mapi id 15.20.6631.046; Fri, 4 Aug 2023 00:19:11 +0000 Message-ID: <6d985b00-49a1-9f23-c313-b9964688b3a1@intel.com> Date: Thu, 3 Aug 2023 17:19:08 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.14.0 Subject: Re: [Intel-xe] ttm_bo and multiple backing store segments To: =?UTF-8?Q?Christian_K=c3=b6nig?= , Rodrigo Vivi References: <059f2d71-92f2-f8d1-bbd8-4112ed75f10c@amd.com> Content-Language: en-US From: "Welty, Brian" In-Reply-To: <059f2d71-92f2-f8d1-bbd8-4112ed75f10c@amd.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: BY5PR16CA0018.namprd16.prod.outlook.com (2603:10b6:a03:1a0::31) To SN7PR11MB7705.namprd11.prod.outlook.com (2603:10b6:806:32f::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN7PR11MB7705:EE_|CYYPR11MB8385:EE_ X-MS-Office365-Filtering-Correlation-Id: 0433ef93-de13-4b63-e456-08db94806cc3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: pWhx7Mzy77nB0AoZ8wVFjhZIA5ubg7k8rf6pyhobiDs6IHtLRxOa/kXSg16NNmZlBxIb4ykJ3NBOtWhUwz0wlHM6oAErKRFEDc2NZY0susvqFJeIxsVbd+tp5zp5N0cldI/pMpm2b7KCTasD88P6D6qvNoyzQlpu+ZOnycqr54u0trdmJnQcrk0rhVvK13jp65kzQY+OlKxQ1BP4rzWFgZx4Yechc7QaOPHw3Pmx/J35gfDsealbQTI/HJCLWA0wMTnjGGDR0lOiQH0Rw0ZhhqY6j3oVxFNkRVV1smB9JnRIXFqoVotG48ovy7KsohzfsO4CYpjpPkVsWGRy5R2AQbXPSVLIRfpsv38mddgpTzm4kDb8J4LGHPVt9JZrMeNHr9yWLqHqWMdp/MUSMdhJV9pFvniCSCKy7VtdturqsrOn/f9fPCHfTrxy+QHdwek7NTUm1VCh9lKRsOnlPX3UDFYXBUGkVWEO3I+BxYOtIoAR6O/wiSNK7tM2rnhaBRf3iaBlIQF+dRV0oEAHbP+TKBWHwdMSnyXGXZ6TURxsWzTnDLLA9zPqf9MzUikCd/dnJY4oVHxSXYrbUN5bnQJs09NGyLxda4w4CfOhjKwmsbq4KUzKW3sR5w9wm+qFdL4zwq/l6GD4yyTksIMroU32lA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN7PR11MB7705.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(346002)(376002)(39860400002)(366004)(396003)(136003)(451199021)(186006)(1800799003)(31696002)(86362001)(36756003)(31686004)(478600001)(110136005)(54906003)(82960400001)(38100700002)(66574015)(2616005)(8676002)(26005)(6506007)(83380400001)(53546011)(41300700001)(8936002)(6666004)(6512007)(6486002)(66556008)(316002)(66476007)(2906002)(4326008)(5660300002)(6636002)(66946007)(45980500001)(43740500002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?RkhhWGNGYWdMM0RVeFJLUk5LbklCS1B0S1AwVjJTN2NwVjg4T2J0Y25rUnRy?= =?utf-8?B?T2h6QXdXTDZSNkI1eHllYmFsQ2ZHNzB2THJyWFAyVlBrSnFoZUZ1cmJOblQr?= =?utf-8?B?VmllMVAzM0RWT01RWWNPRGFCbjVlSkZMTEc3eTVxN2RUUW5UMnVLamtQWWpG?= =?utf-8?B?UHhsQnBpSXoxOWxBd2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0M0Nk9nS3lMQ2tP?= =?utf-8?B?TFZVU2RHZXRsMW9PcHRJTWNRL3hYTXB0c2ZGdjJIQ28zYnBPUXgweURZYWhz?= =?utf-8?B?SkpHU2E4MnIwVGo1UTNOMmc2aG5NQWVPSkliWWV4WkxWeFQzS3l2SEZhN1Zj?= =?utf-8?Q?OgJ5fL7ixC4ogu1TQbnsrSckd?= X-MS-Exchange-CrossTenant-Network-Message-Id: 0433ef93-de13-4b63-e456-08db94806cc3 X-MS-Exchange-CrossTenant-AuthSource: SN7PR11MB7705.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Aug 2023 00:19:10.6062 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: L0S22l29lHRvYPO28gJRJXmcvYQn0I7NDJid7zzNUBIIoZf/pQbYjPQixDl2YJ7U+kGWPj4RlyNM/AxbZnzLGA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CYYPR11MB8385 X-OriginatorOrg: intel.com 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: Matthew Brost , =?UTF-8?Q?Thomas_Hellstr=c3=b6m?= , dri-devel@lists.freedesktop.org, intel-xe@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Finally returning to this, thanks for the replies. On 7/19/2023 2:02 AM, Christian König wrote: > Hi guys, > > massive sorry for the delayed response, this mail felt totally through > my radar without being noticed. > > Am 17.07.23 um 19:24 schrieb Rodrigo Vivi: >> On Thu, Jun 29, 2023 at 02:10:58PM -0700, Welty, Brian wrote: >>> Hi Christian / Thomas, >>> >>> Wanted to ask if you have explored or thought about adding support in >>> TTM >>> such that a ttm_bo could have more than one underlying backing store >>> segment >>> (that is, to have a tree of ttm_resources)? > > We already use something similar on amdgpu where basically the VRAM > resources are stitched together from multiple backing pages. > > That is not exactly the same, but it comes close. I tried searching for awhile for this in amdgpu but wasn't able to find it. Didn't see any signs in amdgpu_vram_mgr.c. Can you point me to where this code lives? I wanted to review and compare the approach... > >>> We are considering to support such BOs for Intel Xe driver. >> They are indeed the best one to give an opinion here. >> I just have some dummy questions and comments below. >> >>> Some of the benefits: >>>   * devices with page fault support can fault (and migrate) backing >>> store >>>     at finer granularity than the entire BO > > We've considered that once as well and I even started hacking something > together, but the problem was that at least at that point it wasn't > doable because of limitations in the Linux memory management. > > Basically the extended attributes used to control caching of pages where > only definable per VMA! So when one piece of the BO would have been in > uncached VRAM while another piece would be in cached system system > memory you immediately ran into problems. > > I think that issue is fixed by now, but I'm not 100% sure. Okay, thanks for mentioning. I didn't come across such issue so far... > > In general I think it might be beneficial, but I'm not 100% sure if it's > worth the additional complexity. Agreed. Well, up next is to put small RFC together then... > > Regards, > Christian. > >> what advantage does this bring? to each workload? >> is it a performance on huge bo? Replying to Rodrigo's comments for the rest here... Yes, providing more rationale is needed. I'll see about beefing up the description with the RFC patches... Bascially, all aspects of working with BO backing store can operate on smaller granularity. Including being able to support a BO which is larger than total VRAM. >> >>>   * BOs can support having multiple backing store segments, which can be >>>     in different memory domains/regions >> what locking challenges would this bring? Intent would be to still have locking done at the BO level, and not attempt to introduce finer grained locking. >> is this more targeting gpu + cpu? or only for our multi-tile platforms? >> and what's the advantage this is bringing to real use cases? Right, it's able to be leveraged for both types of usage you mentioned. So with both gpu + cpu accessing a BO, the portion of the BO they are accessing can be placed locally. And with an Xe gt0 + gt1 accessing a BO, we can place segments of it in the tile local to the gt. >> (probably the svm/hmm question below answers my questions, but...) >> >>>   * BO eviction could operate on smaller granularity than entire BO >> I believe all the previous doubts apply to this item as well... Not sure what 'all the previous doubts' refers to... Agree most of the value is lost if eviction is not updated to operate at finer granularity. Will make sure to explore this. >> >>> Or is the thinking that workloads should use SVM/HMM instead of >>> GEM_CREATE >>> if they want above benefits? >>> >>> Is this something you are open to seeing an RFC series that starts >>> perhaps >>> with just extending ttm_bo_validate() to see how this might shape up? >> Imho the RFC always help... a piece of code to see the idea usually draws >> more attention from devs than ask in text mode. But more text explaining >> the reasons behind are also helpful even with the RFC. Will work up a small RFC and see where we go with this... Thanks, -Brian >> >> Thanks, >> Rodrigo. >> >>> -Brian >