Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d0c6096b authored by Charan Teja Reddy's avatar Charan Teja Reddy Committed by Gerrit - the friendly Code Review server
Browse files

dma-buf: replace tasklist_lock with rcu lock



tasklist_lock is not required while traversing the processes list.
Replace it with rcu_read_lock() which can help in avoiding the watchdog
bark/bite which scenario is expected when the writers does
write_lock_irq(&tasklist_lock) and the reader of the same lock who
acquired it first takes more time to release.

Change-Id: I1f2b7a23c85b30fa44eec6e7bff7258923382790
Signed-off-by: default avatarCharan Teja Reddy <charante@codeaurora.org>
parent 1e52b08a
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -1353,14 +1353,14 @@ static int dma_procs_debug_show(struct seq_file *s, void *unused)
	struct dma_proc *tmp, *n;
	LIST_HEAD(plist);

	read_lock(&tasklist_lock);
	rcu_read_lock();
	for_each_process(task) {
		struct files_struct *group_leader_files = NULL;

		tmp = kzalloc(sizeof(*tmp), GFP_ATOMIC);
		if (!tmp) {
			ret = -ENOMEM;
			read_unlock(&tasklist_lock);
			rcu_read_unlock();
			goto mem_err;
		}
		INIT_LIST_HEAD(&tmp->dma_bufs);
@@ -1384,7 +1384,7 @@ static int dma_procs_debug_show(struct seq_file *s, void *unused)
skip:
		free_proc(tmp);
	}
	read_unlock(&tasklist_lock);
	rcu_read_unlock();

	list_sort(NULL, &plist, proccmp);
	list_for_each_entry(tmp, &plist, head)