linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
To: Michael Ellerman <mpe@ellerman.id.au>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	mikey@neuling.org, hbabu@us.ibm.com, nicholas.piggin@gmail.com,
	linuxppc-dev@ozlabs.org, <linux-kernel@vger.kernel.org>
Subject: [PATCH v3 04/18] powerpc/vas: Drop poll_window_cast_out().
Date: Tue,  7 Nov 2017 18:23:44 -0800	[thread overview]
Message-ID: <1510107838-15181-5-git-send-email-sukadev@linux.vnet.ibm.com> (raw)
In-Reply-To: <1510107838-15181-1-git-send-email-sukadev@linux.vnet.ibm.com>

Polling for window cast out is listed in the spec, but turns out that
it is not strictly necessary and slows down window close. Making it a
stub for now.

Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
---
 arch/powerpc/platforms/powernv/vas-window.c | 34 ++++++++++++++---------------
 1 file changed, 17 insertions(+), 17 deletions(-)

diff --git a/arch/powerpc/platforms/powernv/vas-window.c b/arch/powerpc/platforms/powernv/vas-window.c
index 67ffc5d..8ab8a82 100644
--- a/arch/powerpc/platforms/powernv/vas-window.c
+++ b/arch/powerpc/platforms/powernv/vas-window.c
@@ -1079,25 +1079,25 @@ static void poll_window_busy_state(struct vas_window *window)
 	}
 }
 
+/*
+ * Have the hardware cast a window out of cache and wait for it to
+ * be completed.
+ *
+ * NOTE: It can take a relatively long time to cast the window context
+ *	out of the cache. It is not strictly necessary to cast out if:
+ *
+ *	- we clear the "Pin Window" bit (so hardware is free to evict)
+ *
+ *	- we re-initialize the window context when it is reassigned.
+ *
+ *	We do the former in vas_win_close() and latter in vas_win_open().
+ *	So, ignoring the cast-out for now. We can add it as needed. If
+ *	casting out becomes necessary we should consider offloading the
+ *	job to a worker thread, so the window close can proceed quickly.
+ */
 static void poll_window_castout(struct vas_window *window)
 {
-	int cached;
-	u64 val;
-
-	/* Cast window context out of the cache */
-retry:
-	val = read_hvwc_reg(window, VREG(WIN_CTX_CACHING_CTL));
-	cached = GET_FIELD(VAS_WIN_CACHE_STATUS, val);
-	if (cached) {
-		val = 0ULL;
-		val = SET_FIELD(VAS_CASTOUT_REQ, val, 1);
-		val = SET_FIELD(VAS_PUSH_TO_MEM, val, 0);
-		write_hvwc_reg(window, VREG(WIN_CTX_CACHING_CTL), val);
-
-		set_current_state(TASK_UNINTERRUPTIBLE);
-		schedule_timeout(HZ);
-		goto retry;
-	}
+	/* stub for now */
 }
 
 /*
-- 
2.7.4

  parent reply	other threads:[~2017-11-08  2:24 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-08  2:23 [PATCH v3 00/18] powerpc/vas: Add support for FTW Sukadev Bhattiprolu
2017-11-08  2:23 ` [PATCH v3 01/18] powerpc/vas: init missing fields from [rt]xattr Sukadev Bhattiprolu
2017-11-14 11:12   ` [v3,01/18] " Michael Ellerman
2017-11-08  2:23 ` [PATCH v3 02/18] powerpc/vas: Validate window credits Sukadev Bhattiprolu
2017-11-08  2:23 ` [PATCH v3 03/18] powerpc/vas: Cleanup some debug code Sukadev Bhattiprolu
2017-11-08  2:23 ` Sukadev Bhattiprolu [this message]
2017-11-08  2:23 ` [PATCH v3 05/18] powerpc/vas: Use helper to unpin/close window Sukadev Bhattiprolu
2017-11-08  2:23 ` [PATCH v3 06/18] powerpc/vas: Reduce polling interval for busy state Sukadev Bhattiprolu
2017-11-08  2:23 ` [PATCH v3 07/18] powerpc/vas: Save configured window credits Sukadev Bhattiprolu
2017-11-08  2:23 ` [PATCH v3 08/18] powerpc/vas: poll for return of " Sukadev Bhattiprolu
2017-11-08  2:23 ` [PATCH v3 09/18] powerpc/vas: Create cpu to vas id mapping Sukadev Bhattiprolu
2017-11-08  2:23 ` [PATCH v3 10/18] powerpc/vas, nx-842: Define and use chip_to_vas_id() Sukadev Bhattiprolu
2017-11-20 17:57   ` Josh Boyer
2017-11-22 11:56     ` Michael Ellerman
2017-11-08  2:23 ` [PATCH v3 11/18] powerpc/vas: Export HVWC to debugfs Sukadev Bhattiprolu
2017-11-08  2:23 ` [PATCH v3 12/18] powerpc: have copy depend on CONFIG_BOOK3S_64 Sukadev Bhattiprolu
2017-11-08  2:23 ` [PATCH v3 13/18] powerpc: Add support for setting SPRN_TIDR Sukadev Bhattiprolu
2017-11-09 11:53   ` Michael Ellerman
2017-11-08  2:23 ` [PATCH v3 14/18] powerpc: Define set_thread_uses_vas() Sukadev Bhattiprolu
2017-11-08  2:23 ` [PATCH v3 15/18] powerpc: Emulate paste instruction Sukadev Bhattiprolu
2017-11-08  2:23 ` [PATCH v3 16/18] powerpc/vas: Define vas_win_paste_addr() Sukadev Bhattiprolu
2017-11-08  2:23 ` [PATCH v3 17/18] powerpc/vas: Define vas_win_id() Sukadev Bhattiprolu
2017-11-08  2:23 ` [PATCH v3 18/18] powerpc/vas: Add support for user receive window Sukadev Bhattiprolu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1510107838-15181-5-git-send-email-sukadev@linux.vnet.ibm.com \
    --to=sukadev@linux.vnet.ibm.com \
    --cc=benh@kernel.crashing.org \
    --cc=hbabu@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=mikey@neuling.org \
    --cc=mpe@ellerman.id.au \
    --cc=nicholas.piggin@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).