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.5 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 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 EA060C433DB for ; Fri, 22 Jan 2021 10:27:27 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id AF9DE2376F for ; Fri, 22 Jan 2021 10:27:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AF9DE2376F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 57BE689D73; Fri, 22 Jan 2021 10:27:27 +0000 (UTC) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTPS id F057489D73 for ; Fri, 22 Jan 2021 10:27:25 +0000 (UTC) IronPort-SDR: kdRlo2Zx1hJyfDjKx10A/FMYB32sFaa/SJ0WMA64qmDTfzdP25bcVaSWmO87AdMFdLBBHMVTnX bBAU9XjrIgiw== X-IronPort-AV: E=McAfee;i="6000,8403,9871"; a="198181325" X-IronPort-AV: E=Sophos;i="5.79,366,1602572400"; d="scan'208";a="198181325" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jan 2021 02:27:25 -0800 IronPort-SDR: 6+8wOWlJjWzNUVVhTOUYuI38TGBXhAas0+Za4mtWanSQzB1g0m67iO7llQHlIS0kl0o2Mv+T4B aytBJxwYsLwQ== X-IronPort-AV: E=Sophos;i="5.79,366,1602572400"; d="scan'208";a="385711041" Received: from lcfenner-mobl1.ger.corp.intel.com (HELO [10.252.20.148]) ([10.252.20.148]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jan 2021 02:27:23 -0800 To: Chris Wilson , intel-gfx@lists.freedesktop.org References: <20210121232807.16618-1-chris@chris-wilson.co.uk> From: Matthew Auld Message-ID: <5b188fea-2417-fa6a-7a8c-c2d240b359f7@intel.com> Date: Fri, 22 Jan 2021 10:27:21 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <20210121232807.16618-1-chris@chris-wilson.co.uk> Content-Language: en-GB Subject: Re: [Intel-gfx] [PATCH] drm/i915: Always flush the active worker before returning from the wait X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: stable@vger.kernel.org Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On 21/01/2021 23:28, Chris Wilson wrote: > The first thing the active retirement worker does is decrement the > i915_active count. > > The first thing we do during i915_active_wait is try to increment the > i915_active count, but only if already active [non-zero]. > > The wait may see that the retirement is already started and so marked the > i915_active as idle, and skip waiting for the retirement handler. > However, the caller of i915_active_wait may immediately free the > i915_active upon returning (e.g. i915_vma_destroy) so we must not return > before the concurrent access from the worker are completed. We must > always flush the worker. > > Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/2473 > Fixes: 274cbf20fd10 ("drm/i915: Push the i915_active.retire into a worker") > Signed-off-by: Chris Wilson > Cc: Matthew Auld > Cc: Tvrtko Ursulin > Cc: # v5.5+ Reviewed-by: Matthew Auld _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx