From 8b665ac6b2984e07a290d5ecbcec2c93ec973c65 Mon Sep 17 00:00:00 2001 From: Deepak Nibade Date: Tue, 12 Jan 2016 18:51:37 +0530 Subject: gpu: nvgpu: move clean up of jobs to separate worker We currently clean up the jobs in gk20a_channel_update() which is called from nvhost worker thread Instead of doing this, schedule another delayed worker thread clean_up_work to clean up the jobs (with delay of 1 jiffies) Keep update_gp_get() in channel_update() and not in delayed worker since this will help in better book keeping of gp_get Also, this scheduling will help delay job clean-up so that more number of jobs are batched for clean up and hence less time is consumed by worker Bug 1718092 Change-Id: If3b94b6aab93c92da4cf0d1c74aaba756f4cd838 Signed-off-by: Deepak Nibade Reviewed-on: http://git-master/r/931701 GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/gk20a/channel_gk20a.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'drivers/gpu/nvgpu/gk20a/channel_gk20a.h') diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.h b/drivers/gpu/nvgpu/gk20a/channel_gk20a.h index 0f796ffe..4aea9d19 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.h @@ -80,6 +80,12 @@ struct channel_gk20a_poll_events { int num_pending_events; }; +struct channel_gk20a_clean_up { + struct mutex lock; + bool scheduled; + struct delayed_work wq; +}; + /* this is the priv element of struct nvhost_channel */ struct channel_gk20a { struct gk20a *g; /* set only when channel is active */ @@ -133,6 +139,7 @@ struct channel_gk20a { u32 timeout_gpfifo_get; struct channel_gk20a_timeout timeout; + struct channel_gk20a_clean_up clean_up; bool cmds_pending; struct { -- cgit v1.2.2