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 X-Spam-Level: X-Spam-Status: No, score=-10.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_2 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B907CC4743C for ; Mon, 21 Jun 2021 14:44:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9411C610C7 for ; Mon, 21 Jun 2021 14:44:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229747AbhFUOqa (ORCPT ); Mon, 21 Jun 2021 10:46:30 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:49186 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229789AbhFUOq3 (ORCPT ); Mon, 21 Jun 2021 10:46:29 -0400 Received: from localhost (unknown [IPv6:2a01:e0a:2c:6930:5cf4:84a1:2763:fe0d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: bbrezillon) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id 1BCE71F425E2; Mon, 21 Jun 2021 15:44:14 +0100 (BST) Date: Mon, 21 Jun 2021 16:44:11 +0200 From: Boris Brezillon To: Steven Price Cc: Alyssa Rosenzweig , Rob Herring , Tomeu Vizoso , Alyssa Rosenzweig , Robin Murphy , dri-devel@lists.freedesktop.org, Icecream95 , stable@vger.kernel.org Subject: Re: [PATCH v2 01/12] drm/panfrost: Make sure MMU context lifetime is not bound to panfrost_priv Message-ID: <20210621164411.20eeacd4@collabora.com> In-Reply-To: <828f1e50-323e-7f67-009f-e465720e303c@arm.com> References: <20210621133907.1683899-1-boris.brezillon@collabora.com> <20210621133907.1683899-2-boris.brezillon@collabora.com> <828f1e50-323e-7f67-009f-e465720e303c@arm.com> Organization: Collabora X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org On Mon, 21 Jun 2021 15:29:55 +0100 Steven Price wrote: > On 21/06/2021 14:57, Alyssa Rosenzweig wrote: > >> Jobs can be in-flight when the file descriptor is closed (either because > >> the process did not terminate properly, or because it didn't wait for > >> all GPU jobs to be finished), and apparently panfrost_job_close() does > >> not cancel already running jobs. Let's refcount the MMU context object > >> so it's lifetime is no longer bound to the FD lifetime and running jobs > >> can finish properly without generating spurious page faults. > > > > Remind me - why can't we hard stop in-flight jobs when the fd is closed? > > I've seen cases where kill -9'ing a badly behaved process doesn't end > > the fault storm, or unfreeze the desktop. > > > > Hard-stopping the in-flight jobs would also make sense. But unless we > want to actually hang the close() then there will be a period between > issuing the hard-stop and actually having completed all jobs in the context. Patch 10 is doing that, I just didn't want to backport all the dependencies, so I kept it split in 2 halves: one patch fixing the use-after-free bug, and the other part killing in-flight jobs. > > But equally to be fair I've been cherry-picking this patch myself for > quite some time, so we should just merge it and improve from there. So > you can have my: > > Reviewed-by: Steven Price