From patchwork Fri Jun 1 17:11:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Grodzovsky X-Patchwork-Id: 10444151 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C992B603D7 for ; Fri, 1 Jun 2018 17:12:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BC49528CD2 for ; Fri, 1 Jun 2018 17:12:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B008E28D54; Fri, 1 Jun 2018 17:12:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 50A8428CD2 for ; Fri, 1 Jun 2018 17:12:06 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EE6736E734; Fri, 1 Jun 2018 17:12:04 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0085.outbound.protection.outlook.com [104.47.36.85]) by gabe.freedesktop.org (Postfix) with ESMTPS id C8F136E72E; Fri, 1 Jun 2018 17:12:03 +0000 (UTC) Received: from DM3PR12CA0079.namprd12.prod.outlook.com (2603:10b6:0:57::23) by DM3PR12MB0764.namprd12.prod.outlook.com (2a01:111:e400:5984::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.797.11; Fri, 1 Jun 2018 17:12:02 +0000 Received: from DM3NAM03FT007.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e49::204) by DM3PR12CA0079.outlook.office365.com (2603:10b6:0:57::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.820.11 via Frontend Transport; Fri, 1 Jun 2018 17:12:01 +0000 Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXCHOV02.amd.com (165.204.84.17) by DM3NAM03FT007.mail.protection.outlook.com (10.152.82.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.20.820.8 via Frontend Transport; Fri, 1 Jun 2018 17:12:01 +0000 Received: from agrodzovsky-All-Series.amd.com (10.34.1.3) by SATLEXCHOV02.amd.com (10.181.40.72) with Microsoft SMTP Server id 14.3.382.0; Fri, 1 Jun 2018 12:12:00 -0500 From: Andrey Grodzovsky To: , Subject: [PATCH v2 2/2] drm/amdgpu: move amdgpu_ctx_mgr_entity_fini to f_ops flush hook. Date: Fri, 1 Jun 2018 13:11:47 -0400 Message-ID: <1527873107-32642-2-git-send-email-andrey.grodzovsky@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1527873107-32642-1-git-send-email-andrey.grodzovsky@amd.com> References: <1527873107-32642-1-git-send-email-andrey.grodzovsky@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:165.204.84.17; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(396003)(39840400004)(376002)(346002)(39380400002)(2980300002)(428003)(189003)(199004)(53936002)(2906002)(450100002)(47776003)(4326008)(478600001)(5660300001)(305945005)(68736007)(72206003)(575784001)(86362001)(356003)(104016004)(8676002)(51416003)(8936002)(81156014)(50226002)(81166006)(97736004)(76176011)(53416004)(106466001)(105586002)(16586007)(316002)(54906003)(110136005)(59450400001)(77096007)(26005)(186003)(11346002)(7696005)(126002)(44832011)(2616005)(476003)(36756003)(336012)(48376002)(50466002)(486006)(446003)(426003)(6666003); DIR:OUT; SFP:1101; SCL:1; SRVR:DM3PR12MB0764; H:SATLEXCHOV02.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; MX:1; A:1; X-Microsoft-Exchange-Diagnostics: 1; DM3NAM03FT007; 1:L8C8be0AWM856WjGnCjf/QGNkb/ew27dRpVtExz55NN9H+fDbD0Q1izLS1Ogn9FOy49F1wiFZZ+ABHh7cRg7GYpBelGqQoPHW7n5Ky8SJD2+HSwtxoUdp/Pv8Hm92xuJ X-MS-PublicTrafficType: Email X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060); SRVR:DM3PR12MB0764; X-Microsoft-Exchange-Diagnostics: 1; DM3PR12MB0764; 3:Gl5/E9tA8nldaRkFIS0XoaczS8C/To2qj7Kf2hwAlwLT/8I4LQoSkLlBuWnrjOo9Nokl2vq7Ur8M09EtXC6zfQoKReL+HFyIIAHEv0N7taJpt4z/PNTZd6fZqXhKtRz3wQojiWM0A1mH/eJGLwFYNgE/+UpVje9eJrjTGSolbhnNeBeS0MDYhuuEw630FBT3rTHJ4AYSuEHst3NNoFuzT/1j0kW+dMHgEXaOzOWjSjCSZsfbGJ5LF1InW61fcmkJ1WDRgJjM6kukqVGJOKWH/yofP+XLOtyBLGU6hP4WMz7o238EW1n49dlRKWJZJ2Mcns9p60tWRh5fQyYeqRGol42GZTtVZ+cGzwzfbHjHz3g=; 25:/UdOBQ6peV1n4B7XPOxyI+DlGUREdMmN5T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crBe2pUMcKaLwTMm3Iu1mIIMOxD+8skI96X0Z57t/q8UCFYAHtxNJHb X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(10201501046)(3002001)(93006095)(93003095)(3231254)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(20161123558120)(20161123562045)(20161123560045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016); SRVR:DM3PR12MB0764; BCL:0; PCL:0; RULEID:; SRVR:DM3PR12MB0764; X-Microsoft-Exchange-Diagnostics: 1; DM3PR12MB0764; 4:XTw8qEvaAnVufqhy29QvZuMQHCONABf6sofeoT+DeUqN5jCscjiwNNHOBOkyHOK8muMskTA0onfEozlRt1Jp9/UBo7Ds1P6B7/4As5V3ks4Bz240XWzHfKZsjLnx3ExGD/C4Qw9JO/TkZMagy7BZ8OByDwGxyNE2/LuRebNbd1eQIyg9YMmE99M1q8Oa5S96lw2KrHkXuj8xqlUP3MMmR3SauZNF2XWexTO7xBKJBCt5b6kG4RaciN6R+0ixZe8xNRlnzIeK9PWkMY7Z4FRumvV6r8gWmqCNjMr1fJdFsCRXq2AtS98tN9P2oFsN0KIB X-Forefront-PRVS: 0690E5FF22 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM3PR12MB0764; 23:Bc8nP6Hmmx6F+wzaRcR3H2FgwlvZ0yXCuugCDch0I?= =?us-ascii?Q?UtXb+JYpXFROq8uRwblrH2oGUfLYsneIPgOKAn0B8r6hOo63IVOAEEBU9/FY?= =?us-ascii?Q?CT8DpMh5aKIQokthIZSZCcum5bGDPTEE7ObWOu+yc5tq6GmDz4MQ0UpMs/zv?= =?us-ascii?Q?1XkFQ5PynZZJqAK5uF7kSQapJzSKqfVB6kGQwLgoKoQkU9OFU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oX0Npbs1Nll0mmolBQRJaVbfNL9e55mpTxyoQ7ah1OqK6H5YqTbrg91JCfd3sBEr1O8xX73UGVRNHbE=; 24:CLau2/DskG2F7QzMqrfi+4BBK7Ne44H5fTt8vgJyHvSKOFYxL2IrFsaufhP0diyVt3R4xv+OAxsCeqEODXQGigQgtHT8lO5nZA3Dth2ZpBs= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM3PR12MB0764; 7:4f0qLbBX9TCSrgijNhTGXigMCXKgxnO3KoHMi5FEDCmK37L6JeBsZ+TvP7bBQlPT/PaesERHw/2ToAPwMC6j9UHpq4TwI3QvCSJ7zDH3cUoCd3Lldx8NXQkWSFl8irQmFkhTAFUFz/TyJP5yL65aDomJCkRRRDiRryXYNtB1GtyR/kkOsFTlUpSwaoLX75PR7EgvpTZbxJoT97zywQK6LSDoptvfUO1e52WO2Jwy8sIaPcbqhOw93bVz/mW7D2em; 20:7EdBGKHubc8uKqOoh6ChIBcZVUTF7wRjcDMDMoVZ+Rdcp3dG5SPHmmBTieToOie/k4zha5lebQqApULL94zDeDPR/UD821lO+W13Z7Fq222EvnENOp1n7b2aIUW+ui4cPSPQu1474k0J7j7mwg/GCXbzkXIQd0bD65/fvjWqWqla9hXGqZGTePtRmg1FxlIQcIwgBMyBvI83u7e0Js6828dv2saXp9xGar2DusbV7sfv6zlZ53NNZJAEmBU8MMsI X-MS-Office365-Filtering-Correlation-Id: ae45e10b-ac4a-4184-0bfc-08d5c7e2ca92 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jun 2018 17:12:01.6492 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ae45e10b-ac4a-4184-0bfc-08d5c7e2ca92 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXCHOV02.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM3PR12MB0764 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Christian.Koenig@amd.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP With this we can now terminate jobs enqueue into SW queue the moment the task is being killed instead of waiting for last user of drm file to release it. Also stop checking for kref_read(&ctx->refcount) == 1 when calling drm_sched_entity_do_release since other task might still hold a reference to this entity but we don't care since KILL means terminate job submission regardless of what other tasks are doing. v2: Use returned remaining timeout as parameter for the next call. Rebase. Signed-off-by: Andrey Grodzovsky --- drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 17 +++++++++++------ drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 12 ++++++++++++ drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 1 - 3 files changed, 23 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c index c5bb362..cbf2fcc 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c @@ -449,26 +449,31 @@ void amdgpu_ctx_mgr_entity_fini(struct amdgpu_ctx_mgr *mgr) struct amdgpu_ctx *ctx; struct idr *idp; uint32_t id, i; + unsigned ret; + unsigned max_wait = MAX_WAIT_SCHED_ENTITY_Q_EMPTY_MS; idp = &mgr->ctx_handles; + mutex_lock(&mgr->lock); idr_for_each_entry(idp, ctx, id) { - if (!ctx->adev) + if (!ctx->adev) { + mutex_unlock(&mgr->lock); return; + } for (i = 0; i < ctx->adev->num_rings; i++) { if (ctx->adev->rings[i] == &ctx->adev->gfx.kiq.ring) continue; - if (kref_read(&ctx->refcount) == 1) - drm_sched_entity_do_release(&ctx->adev->rings[i]->sched, - &ctx->rings[i].entity); - else - DRM_ERROR("ctx %p is still alive\n", ctx); + ret = drm_sched_entity_do_release(&ctx->adev->rings[i]->sched, + &ctx->rings[i].entity, max_wait); + + max_wait = max_wait >= ret ? max_wait - ret : 0; } } + mutex_unlock(&mgr->lock); } void amdgpu_ctx_mgr_entity_cleanup(struct amdgpu_ctx_mgr *mgr) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c index b0bf2f2..a549483 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c @@ -855,9 +855,21 @@ static const struct dev_pm_ops amdgpu_pm_ops = { .runtime_idle = amdgpu_pmops_runtime_idle, }; +static int amdgpu_flush(struct file *f, fl_owner_t id) +{ + struct drm_file *file_priv = f->private_data; + struct amdgpu_fpriv *fpriv = file_priv->driver_priv; + + amdgpu_ctx_mgr_entity_fini(&fpriv->ctx_mgr); + + return 0; +} + + static const struct file_operations amdgpu_driver_kms_fops = { .owner = THIS_MODULE, .open = drm_open, + .flush = amdgpu_flush, .release = drm_release, .unlocked_ioctl = amdgpu_drm_ioctl, .mmap = amdgpu_mmap, diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c index ca21549..1239384 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c @@ -930,7 +930,6 @@ void amdgpu_driver_postclose_kms(struct drm_device *dev, return; pm_runtime_get_sync(dev->dev); - amdgpu_ctx_mgr_entity_fini(&fpriv->ctx_mgr); if (adev->asic_type != CHIP_RAVEN) { amdgpu_uvd_free_handles(adev, file_priv);