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 5C92BC6FA8F for ; Wed, 30 Aug 2023 22:20:12 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E135810E60C; Wed, 30 Aug 2023 22:20:11 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3B5FF10E60C for ; Wed, 30 Aug 2023 22:20:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1693434010; x=1724970010; h=date:message-id:from:to:cc:subject:in-reply-to: references:mime-version; bh=B17TIQAM9wifm9c7RiXlRjIHJd4xpXXcdqiEXNnTjgI=; b=IcNg/uR/cFB7EiNgu69J4IIzViHiBjStmqWzDsz8sd7hOsDSzOLyFWJi y7hYAEjy83K5TK9jEbEmkicicz9L50wYYlYk8Kl8kHBQv+KMKLYObQOpC t4ekA62q87MhxscjwVTWJ8axb1dqaT7HdztZOka7TDMJG9A2Y39RUVH2K HV7yT/wmeHMWGqnXbthve+1TysLLLgQlPSib2ZfCyc+0/u2FZgRG/zmBT fJeqS9ZjH22b1AyLNlx6BEN0ySZqDjdQBfz/R8LzZ2jIMHRVqFKFG+sWd gsEbZwjyFIyL5jhlliaqOr7a8Y9u7oVwkwsSxDB86J3Kk6BtcXRkdUZtA A==; X-IronPort-AV: E=McAfee;i="6600,9927,10818"; a="406754015" X-IronPort-AV: E=Sophos;i="6.02,214,1688454000"; d="scan'208";a="406754015" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Aug 2023 15:20:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10818"; a="716084896" X-IronPort-AV: E=Sophos;i="6.02,214,1688454000"; d="scan'208";a="716084896" Received: from adixit-mobl.amr.corp.intel.com (HELO adixit-arch.intel.com) ([10.212.137.46]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Aug 2023 15:20:09 -0700 Date: Wed, 30 Aug 2023 15:19:08 -0700 Message-ID: <87bkeo18df.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" To: Rodrigo Vivi In-Reply-To: References: <20230830051544.369643-1-aravind.iddamsetty@linux.intel.com> <20230830051544.369643-3-aravind.iddamsetty@linux.intel.com> <87cyz514dt.wl-ashutosh.dixit@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/29.1 (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-xe] [PATCH 2/3] drm/xe: Use spinlock in forcewake instead of mutex X-BeenThere: intel-xe@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Xe graphics driver List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: intel-xe@lists.freedesktop.org Errors-To: intel-xe-bounces@lists.freedesktop.org Sender: "Intel-xe" On Wed, 30 Aug 2023 13:56:57 -0700, Rodrigo Vivi wrote: > > On Tue, Aug 29, 2023 at 10:33:02PM -0700, Dixit, Ashutosh wrote: > > On Tue, 29 Aug 2023 22:15:43 -0700, Aravind Iddamsetty wrote: > > > > > > > Hi Aravind, > > > > > @@ -162,7 +162,7 @@ int xe_force_wake_get(struct xe_force_wake *fw, > > > domain->id, ret); > > > } > > > fw->awake_domains |= woken; > > > - mutex_unlock(&fw->lock); > > > + spin_unlock(&fw->lock); > > > > No need to change anything yet, but let's get some more opinion on this: is > > it ok to (a) just replace the mutex with a spinlock in these force_wake > > functions, or, (b) should we have a second set of functions to be called in > > atomic context, say: xe_force_wake_get/put_atomic? So we should use (b) in > > atomic contexts and everywhere else we just continue to use the previous > > set of non-atomic functions? Or just converting the default set of > > functions to use spin lock (as is done in this patch) is ok? > > It looks okay to me, > Reviewed-by: Rodrigo Vivi Still thinking about this, maybe some time (not part of this series) we should do a power measurement comparison between mutex and spinlock and see if there's an appreciable difference (unless we already know?). But till we do that, this is fine, so this is also: Reviewed-by: Ashutosh Dixit