From 6260a0855ff0376c1520a672c885fb7769b271bc Mon Sep 17 00:00:00 2001 From: Deepak Nibade Date: Mon, 30 Nov 2015 16:09:48 +0530 Subject: [PATCH] gpu: nvgpu: move check_gp_put() and update_gp_get() to worker We currently call check_gp_put() and update_gp_get() in submit path and this takes about 5uS for both checks check_gp_put() - 3.5 uS update_gp_get() - 1.5 uS But this book keeping can be moved to gk20a_channel_update() to save some submit time Note that check_gp_put() needs to be done inside submit lock Bug 200141116 Change-Id: I276400111be0421eb673695e2f2899ff52e344b4 Signed-off-by: Deepak Nibade Reviewed-on: http://git-master/r/839232 (cherry picked from commit 289617e8bf01bde9aab45dfa3a1c6a1241e6eb78) Reviewed-on: http://git-master/r/839711 GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/gk20a/channel_gk20a.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c index 67f73cbd288..3b689a67740 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c @@ -1684,9 +1684,14 @@ void gk20a_channel_update(struct channel_gk20a *c, int nr_completed) trace_gk20a_channel_update(c->hw_chid); + update_gp_get(c->g, c); wake_up(&c->submit_wq); mutex_lock(&c->submit_lock); + + /* gp_put check needs to be done inside submit lock */ + check_gp_put(c->g, c); + mutex_lock(&c->jobs_lock); list_for_each_entry_safe(job, n, &c->jobs, list) { struct gk20a *g = c->g; @@ -1817,8 +1822,6 @@ int gk20a_submit_channel_gpfifo(struct channel_gk20a *c, flags, fence ? fence->id : 0, fence ? fence->value : 0); - check_gp_put(g, c); - update_gp_get(g, c); gk20a_dbg_info("pre-submit put %d, get %d, size %d", c->gpfifo.put, c->gpfifo.get, c->gpfifo.entry_num); -- 2.39.2