mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-24 02:22:34 +03:00
gpu: nvgpu: remove rcu locks in clk arbiter
RCU's are available only in (linux) kernel. Though they are able to achieve lockless access in some specific scenarios, they are heavily dependent on the kernel for their functionality. E.g. synchronize_rcu(), which depends on the kernel in order to delimit read side critical sections. As such it is very difficult to implement constructs analogous to RCUs in userspace code. As a result the code which depends on RCU's for synchronization is not portable between OS'es, especially if one of them is in userspace, viz. QNX. Also, if the code is not in performance critical path, we can do with non-RCU constructs. For clk arbiter code here, RCU's are replaced by the traditional spinlocks, so that the code could be used by QNX down the line. Jira VQRM-3741 Change-Id: I178e5958788c8fd998303a6a94d8f2f328201508 Signed-off-by: Sourab Gupta <sourabg@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1705535 Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> Reviewed-by: Alex Waterman <alexw@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
3dabdf3e6d
commit
2b498cdf8a
@@ -41,11 +41,12 @@
|
||||
struct nvgpu_clk_arb {
|
||||
struct nvgpu_spinlock sessions_lock;
|
||||
struct nvgpu_spinlock users_lock;
|
||||
struct nvgpu_spinlock requests_lock;
|
||||
|
||||
struct nvgpu_mutex pstate_lock;
|
||||
struct list_head users;
|
||||
struct list_head sessions;
|
||||
struct llist_head requests;
|
||||
struct list_head requests;
|
||||
|
||||
struct gk20a *g;
|
||||
int status;
|
||||
@@ -92,7 +93,7 @@ struct nvgpu_clk_dev {
|
||||
struct nvgpu_clk_session *session;
|
||||
union {
|
||||
struct list_head link;
|
||||
struct llist_node node;
|
||||
struct list_head node;
|
||||
};
|
||||
struct nvgpu_cond readout_wq;
|
||||
nvgpu_atomic_t poll_mask;
|
||||
@@ -110,8 +111,9 @@ struct nvgpu_clk_session {
|
||||
struct gk20a *g;
|
||||
struct nvgpu_ref refcount;
|
||||
struct list_head link;
|
||||
struct llist_head targets;
|
||||
struct list_head targets;
|
||||
|
||||
struct nvgpu_spinlock session_lock;
|
||||
struct nvgpu_clk_arb_target target_pool[2];
|
||||
struct nvgpu_clk_arb_target *target;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user