Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp963769pxp; Wed, 16 Mar 2022 22:48:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyiKSrS3WF8AxnYwUNXGdXYlqRX3UAkkG/4Po37HWOI2xKHjKJFNKfxdhNlhrjAcctZv/aa X-Received: by 2002:a17:903:192:b0:14f:ff7c:33db with SMTP id z18-20020a170903019200b0014fff7c33dbmr2992586plg.75.1647496110101; Wed, 16 Mar 2022 22:48:30 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1647496110; cv=pass; d=google.com; s=arc-20160816; b=JEfrrDbEBZhh1GuK9NZ68t6zwD4Y/0MmBbMUv1qB2H19mzq4quL1SIknDZpFWFAoUr 5AvLVA5WAf8YhRWwPt0GyxqIhg2PxXTHRoe8nnXwoSZR4C2LEeHEy5RPiD6hzIPHN3wW qmEvz5qWpL94XQxwdoKPqK2ftz4cNfNcUXw9E7bKYKe2H8YEfK9Gn5zzuk1FG9lhkvz0 5jqyOysnqP9Gn1lSgoF5VRrbesvtPVR81W8sdHer+fkiT3/DMXNcUca8g2Ez2p3eXklZ iTtYxwvTzD24MTXsfkQ4u8WmlT67gG0zw4Q7hHDPHsgdFIGRHBAb47+Er49qpkVyi6mw RpFQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:date:message-id:dkim-signature; bh=DVgpYaZ/ZiMZkfbylLTmqOCrXxoggQSQH5/M64+B6Q4=; b=CnwTUSFrIuwHXE5oaGMhwmYcz1ti3ghTkxtQhYx4BsvX3hJYUpZDnV5IGG3chWBiF0 Kd9vUOwghwvZw8ujgvu+iVrRZrXThOHfBa6+XGfQHTRvRWbIiCRZ9/qwp5h5SqV5Y3Yf RuamLeHE+O94+2BfHCuObEDWhFr5paK/Tx3JYfzxdFE9exyJFuQ8Va+kiVhqH3AKMKVD jDE6sPQf36y6UdejtUGX9AeSpYaqHWf28SuVG/d8vGS+0x2vVShdS5aU+q7U1WYdvMPY BO4j0I/4AU2LjGG/04juLca4fkEEktXcRjlmD6RfYAIwJnFpu1hpljrWJ47pIGA58Xku Z27Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=PyFQzAN7; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id n4-20020a1709026a8400b0015384440d82si3415828plk.302.2022.03.16.22.48.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Mar 2022 22:48:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=PyFQzAN7; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id CFCB7133669; Wed, 16 Mar 2022 21:43:53 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347327AbiCPOks (ORCPT + 99 others); Wed, 16 Mar 2022 10:40:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43128 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240487AbiCPOkq (ORCPT ); Wed, 16 Mar 2022 10:40:46 -0400 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2087.outbound.protection.outlook.com [40.107.243.87]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 559E35576C for ; Wed, 16 Mar 2022 07:39:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hAsPhhKYqXsDLLLw83+lD2GAQoYvDZJdhz5ziz7VB2a7e3/B7YPlEkwO7z2inhUy3dC1GIwtaV91pNQGy+WmLD4p0Gjs6srvypN/8tCClDPK1zGOWtN5mFn68umUeqxJqZFP2UL/Gr+XwexRhihMdL8cwtvrNP84aZfck8HGoXjRW+dOpLohORpNNoXOhUCWx/EmwDkSnLGZ2g2Bce/rlpKqSw+6vuKY23OjyZzOexSWYJEAHEi+Zjg3vx+7P1rXOhwRcA9r9lCUCBKoHlE469TjTaJIYQnubddoPo5M5bQF6YAzlHbscsutR8/6wJxSw+hKu//dzukXeYgJr6J5Uw== 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=DVgpYaZ/ZiMZkfbylLTmqOCrXxoggQSQH5/M64+B6Q4=; b=E9P9CgIh9tJE+vsHXnBMvv4URKscvAA/5pU/qESjdMMFJaOKy6R6EoDxxqWXF8f04ZUT37onpHREbzRAPa/Fy/CDFEOhW1uICID5i176WgCGcxM4VvXAE0hAdGrtuU2kPAEkRNPXQrcMU18BJ/jnWms389e+be9heQtrgKHCR4Vr4ICEp4HOZchcjARyaV5gHziHuL4jxnASMEno5a4jh3uIU8HSMYMngz27efLQK5fd6CXWdf93FvpGpnxXgFZNXyeOrV7ULl5b4jJOhTC1XdMAlWhaXuZ7aAuzlxKWhPGYTxtNhK6TVVs5Nas3qqQxbGhs409SRodWmu4OYHy3TQ== 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=DVgpYaZ/ZiMZkfbylLTmqOCrXxoggQSQH5/M64+B6Q4=; b=PyFQzAN7N7yJRSSLzr3N2kcQP5oovna2CtPc/ywddWZjtDfiAQCqib0unEYuuuBz0CotwMnYT0y0iDzg84of6TpQCrrUeC5xNyJY2Q8r/XhDxbi06AIP5GJaCaRUiVpEMJD7ej7hNftyoxFzEzVdd9mFgox1/0quxNU/zzhAF/8= 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 CY4PR1201MB2549.namprd12.prod.outlook.com (2603:10b6:903:da::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5061.26; Wed, 16 Mar 2022 14:39:29 +0000 Received: from BN8PR12MB3587.namprd12.prod.outlook.com ([fe80::404f:1fc8:9f4c:f185]) by BN8PR12MB3587.namprd12.prod.outlook.com ([fe80::404f:1fc8:9f4c:f185%6]) with mapi id 15.20.5081.015; Wed, 16 Mar 2022 14:39:29 +0000 Message-ID: Date: Wed, 16 Mar 2022 15:39:24 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [RFC PATCH 5/7] drm/ttm: add range busy check for range manager Content-Language: en-US To: Robert Beckett , intel-gfx@lists.freedesktop.org, Huang Rui , David Airlie , Daniel Vetter Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org References: <20220315180444.3327283-1-bob.beckett@collabora.com> <20220315180444.3327283-6-bob.beckett@collabora.com> <2918e4a2-3bb8-23e0-3b8c-90c620b82328@amd.com> <1eef3b71-ef7c-24d1-b0d7-695fc1d2d353@collabora.com> <2b5816aa-c082-b03a-c7a0-e4351e8e4e5a@amd.com> <2a364c03-d6d9-1ccd-2ecb-9ebf893f0860@collabora.com> From: =?UTF-8?Q?Christian_K=c3=b6nig?= In-Reply-To: <2a364c03-d6d9-1ccd-2ecb-9ebf893f0860@collabora.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: AM6PR0202CA0066.eurprd02.prod.outlook.com (2603:10a6:20b:3a::43) To BN8PR12MB3587.namprd12.prod.outlook.com (2603:10b6:408:43::13) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a0f04571-3b3b-4319-8965-08da075ac6cd X-MS-TrafficTypeDiagnostic: CY4PR1201MB2549:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Ui48xTSYm+iJOPXPw0DDagwVl3BQQ2RURZDmE5i3d8TTMxU9j4OBGRgFWdxCVEZWj8UQjHUNkqzEGLcMud6urlKz+iHp+ZDpUL3OJwd8Y5sac1F2VlwfV+plmTZjstQlpxxtykyKS/F1ShPx+sfVm7kdViuLUddA6LlP6UjlLJW4QZozvUQeBnhFfD+vGRlLL5Euu3cY15hehPXGT/FhP5wdU7rKT4S6L8Jpt790YYwhYIvpTLTuI4jBXXPW55WrbJ/n3By4YCaVZr9yJVHhgR4r+Re3mzHJnrnAdzb3Qih8I1zXTQZTZVTx6JdjagEnwC6p7apbpDbH0fImNuyAPM+RMnLD64keQPwG5J7mGC896RMTxzyFLhtdHY5NwnKC3xaZY8ZyayLWvGVUe0s51yalED3AHEPDpLDSafKwIC+KBJlcY98Rlq4Ex0BbKtKI9wFOh2B7rchfIwmR2r/0Fr1Ww+0ka0QaE7+Hxhv2RjIqsgzeZcEDGLioN0ZAXpog09aqZonuKGbR61OvMCliBxKU8cqCKq3QLScezY/c9eEjX5q0Ms45G9AcKcP428DGJiO9b2t1IG9RcNc88MnXlcYKLcGU9IhvBLUsHEkqOUd4OJHSCs5qPMz0EQ6XTwFoikXmt+ZcMhHRJGSevZiN8lpKByikMiUOCiKNxfyea5UeAUq036qKbo90B30+TnWHBl9LBESt/pQ5TjP1b1gQlMzmxIo2P9Cca3Lrr5CLdj/mhlD2XAsFg9O4aqWhIPSw 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:(13230001)(4636009)(366004)(6506007)(66946007)(31686004)(31696002)(5660300002)(2906002)(508600001)(36756003)(8936002)(66476007)(66556008)(2616005)(38100700002)(316002)(83380400001)(186003)(8676002)(86362001)(6486002)(6666004)(4326008)(110136005)(6512007)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?RnVNMGZNSUVUZWlpTEZsOStrTW1FSmlobkdMSEl0ZjgvRGNJTm9kYjZRaldp?= =?utf-8?B?T0pKaUVTVlVCSko0amp4djB1ZDFxTkhrUWgyazc4K29xUFZiTWh4bUZDWFd1?= =?utf-8?B?QUg5VFJhUU5nd1poeDhXR2hwV2FuZGkxUkxra216LzhqRmd4bzlwOUU4MDNh?= =?utf-8?B?dzNwd2tNUlR2WWd3S0N2V0M1S09wcjhjSVhidEZ1anVpQVYvWWt0SkZUUWZq?= =?utf-8?B?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1kveWhiSHU4UXVJenl2bGVrNy9k?= =?utf-8?Q?FNvVc3?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: a0f04571-3b3b-4319-8965-08da075ac6cd X-MS-Exchange-CrossTenant-AuthSource: BN8PR12MB3587.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Mar 2022 14:39:29.2656 (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: CC6lfnIWuqp8DulmzPXjHJgtAd3xNgiCTDJmQ24zYDRnBNPe56/nRUTyDEYy0ss2 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR1201MB2549 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=no 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 Am 16.03.22 um 15:26 schrieb Robert Beckett: > > [SNIP] > this is where I replace an existing range check via drm_mm with the > range check I added in this patch. Mhm, I still don't get the use case from the code, but I don't think it matters any more. >>> I suppose we could add another drm_mm range tracker just for testing >>> and shadow track each allocation in the range, but that seemed like >>> a lot of extra infrastructure for no general runtime use. >> >> I have no idea what you mean with that. > > I meant as a potential solution to tracking allocations without a > range check, we would need to add something external. e.g. adding a > shadow drm_mm range tracker, or a bitmask across the range, or stick > objects in a list etc. Ah! So you are trying to get access to the drm_mm inside the ttm_range_manager and not add some additional range check function! Now I got your use case. >>> would you mind explaining the rationale for removing range checks? >>> It seems to me like a natural fit for a memory manager >> >> TTM manages buffer objects and resources, not address space. The >> lpfn/fpfn parameter for the resource allocators are actually used as >> just two independent parameters and not define any range. We just >> keep the names for historical reasons. >> >> The only places we still use and compare them as ranges are >> ttm_resource_compat() and ttm_bo_eviction_valuable() and I already >> have patches to clean up those and move them into the backend >> resource handling. > > except the ttm_range_manager seems to still use them as a range specifier. Yeah, because the range manager is the backend which handles ranges using the drm_mm :) > If the general design going forward is to not consider ranges, how > would you recommend constructing buffers around pre-allocated regions > e.g. uefi frame buffers who's range is dictated externally? Call ttm_bo_mem_space() with the fpfn/lpfn filled in as required. See function amdgpu_bo_create_kernel_at() for an example. Regards, Christian. > >> >> Regards, >> Christian. >> >>> >>>> >>>> Regards, >>>> Christian. >>>> >>>>> >>>>> Signed-off-by: Robert Beckett >>>>> --- >>>>>   drivers/gpu/drm/ttm/ttm_range_manager.c | 21 +++++++++++++++++++++ >>>>>   include/drm/ttm/ttm_range_manager.h     |  3 +++ >>>>>   2 files changed, 24 insertions(+) >>>>> >>>>> diff --git a/drivers/gpu/drm/ttm/ttm_range_manager.c >>>>> b/drivers/gpu/drm/ttm/ttm_range_manager.c >>>>> index 8cd4f3fb9f79..5662627bb933 100644 >>>>> --- a/drivers/gpu/drm/ttm/ttm_range_manager.c >>>>> +++ b/drivers/gpu/drm/ttm/ttm_range_manager.c >>>>> @@ -206,3 +206,24 @@ int ttm_range_man_fini_nocheck(struct >>>>> ttm_device *bdev, >>>>>       return 0; >>>>>   } >>>>>   EXPORT_SYMBOL(ttm_range_man_fini_nocheck); >>>>> + >>>>> +/** >>>>> + * ttm_range_man_range_busy - Check whether anything is allocated >>>>> with a range >>>>> + * >>>>> + * @man: memory manager to check >>>>> + * @fpfn: first page number to check >>>>> + * @lpfn: last page number to check >>>>> + * >>>>> + * Return: true if anything allocated within the range, false >>>>> otherwise. >>>>> + */ >>>>> +bool ttm_range_man_range_busy(struct ttm_resource_manager *man, >>>>> +                  unsigned fpfn, unsigned lpfn) >>>>> +{ >>>>> +    struct ttm_range_manager *rman = to_range_manager(man); >>>>> +    struct drm_mm *mm = &rman->mm; >>>>> + >>>>> +    if (__drm_mm_interval_first(mm, PFN_PHYS(fpfn), PFN_PHYS(lpfn >>>>> + 1) - 1)) >>>>> +        return true; >>>>> +    return false; >>>>> +} >>>>> +EXPORT_SYMBOL(ttm_range_man_range_busy); >>>>> diff --git a/include/drm/ttm/ttm_range_manager.h >>>>> b/include/drm/ttm/ttm_range_manager.h >>>>> index 7963b957e9ef..86794a3f9101 100644 >>>>> --- a/include/drm/ttm/ttm_range_manager.h >>>>> +++ b/include/drm/ttm/ttm_range_manager.h >>>>> @@ -53,4 +53,7 @@ static __always_inline int >>>>> ttm_range_man_fini(struct ttm_device *bdev, >>>>>       BUILD_BUG_ON(__builtin_constant_p(type) && type >= >>>>> TTM_NUM_MEM_TYPES); >>>>>       return ttm_range_man_fini_nocheck(bdev, type); >>>>>   } >>>>> + >>>>> +bool ttm_range_man_range_busy(struct ttm_resource_manager *man, >>>>> +                  unsigned fpfn, unsigned lpfn); >>>>>   #endif >>>> >>