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 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 0E4FAC38A2D for ; Sat, 22 Oct 2022 02:11:35 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AEA6610E3EA; Sat, 22 Oct 2022 02:11:33 +0000 (UTC) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTPS id 978A910E3EA; Sat, 22 Oct 2022 02:11:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1666404687; x=1697940687; h=date:message-id:from:to:cc:subject:in-reply-to: references:mime-version; bh=3UOOosFhyKkh6aPCp9ZAu49HvRmDWoWCHFAyFPVbyR4=; b=IQMzbw561Ec5xrEIBYYbj6ZSXK1k5qPTR6Z365ZYkd4MmNIOGKT5Vyip atBySpWA7EvpMA/Kw/QAyojSUipFUdGTydvrzJrZrx/mOOtJ/bFd1YdtS DCZN1ccaxLEVYfLAQk051BdPCqLX9BOsMPag6BUyIwUUbj/mDDWAwqDzy zNP7NWZzLrvxBTAHlrJDiXLf+USBgmjOk58NL/eLVTHNn1k2i3Ukfqrlx y8K5m727nZ07jXuXGIM7c7STjBWLjivJbz6pe75W4+xnxDOPSem9e1eyW NL/I3HmnLByeYuvE7lbBwv1qqnjdTkeQVKlD03Q5Xg8jq5eUXoPSCsYE+ A==; X-IronPort-AV: E=McAfee;i="6500,9779,10507"; a="304758535" X-IronPort-AV: E=Sophos;i="5.95,203,1661842800"; d="scan'208";a="304758535" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Oct 2022 19:11:26 -0700 X-IronPort-AV: E=McAfee;i="6500,9779,10507"; a="661827768" X-IronPort-AV: E=Sophos;i="5.95,203,1661842800"; d="scan'208";a="661827768" Received: from adixit-mobl.amr.corp.intel.com (HELO adixit-arch.intel.com) ([10.255.230.194]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Oct 2022 19:11:26 -0700 Date: Fri, 21 Oct 2022 19:11:26 -0700 Message-ID: <87wn8sppyp.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" To: Vinay Belgaumkar In-Reply-To: <20221022002452.36716-1-vinay.belgaumkar@intel.com> References: <20221022002452.36716-1-vinay.belgaumkar@intel.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/28.2 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Subject: Re: [Intel-gfx] [PATCH v4] drm/i915/slpc: Optmize waitboost for SLPC 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: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On Fri, 21 Oct 2022 17:24:52 -0700, Vinay Belgaumkar wrote: > Hi Vinay, > Waitboost (when SLPC is enabled) results in a H2G message. This can result > in thousands of messages during a stress test and fill up an already full > CTB. There is no need to request for RP0 if boost_freq and the min softlimit > are the same. > > v2: Add the tracing back, and check requested freq > in the worker thread (Tvrtko) > v3: Check requested freq in dec_waiters as well > v4: Only check min_softlimit against boost_freq. Limit this > optimization for server parts for now. Sorry I didn't follow. Why are we saying limit this only to server? This: if (slpc->min_freq_softlimit == slpc->boost_freq) return; The condition above should work for client too if it is true? But yes it is typically true automatically for server but not for client. Is that what you mean? > > Signed-off-by: Vinay Belgaumkar > --- > drivers/gpu/drm/i915/gt/intel_rps.c | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/i915/gt/intel_rps.c b/drivers/gpu/drm/i915/gt/intel_rps.c > index fc23c562d9b2..32e1f5dde5bb 100644 > --- a/drivers/gpu/drm/i915/gt/intel_rps.c > +++ b/drivers/gpu/drm/i915/gt/intel_rps.c > @@ -1016,9 +1016,15 @@ void intel_rps_boost(struct i915_request *rq) > if (rps_uses_slpc(rps)) { > slpc = rps_to_slpc(rps); > > + if (slpc->min_freq_softlimit == slpc->boost_freq) > + return; nit but is it possible that 'slpc->min_freq_softlimit > slpc->boost_freq' (looks possible to me from the code though we might not have intended it)? Then we can change this to: if (slpc->min_freq_softlimit >= slpc->boost_freq) return; > + > /* Return if old value is non zero */ > - if (!atomic_fetch_inc(&slpc->num_waiters)) > + if (!atomic_fetch_inc(&slpc->num_waiters)) { > + GT_TRACE(rps_to_gt(rps), "boost fence:%llx:%llx\n", > + rq->fence.context, rq->fence.seqno); Another possibility would have been to add the trace to slpc_boost_work but this is matches host turbo so I think it is fine here. > schedule_work(&slpc->boost_work); > + } > > return; > } Thanks. -- Ashutosh