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

Commit 62711dd3 authored by Tharun Kumar Merugu's avatar Tharun Kumar Merugu Committed by Gerrit - the friendly Code Review server
Browse files

msm: adsprpc: cache buffers only of small sizes



Add buffers to cache list only if their size is less than the
threshold. Larger buffers will be freed.

Change-Id: I4eb1109679a4813ffd422b2d0c68f4dc2904bb98
Acked-by: default avatarThyagarajan Venkatanarayanan <venkatan@qti.qualcomm.com>
Signed-off-by: default avatarTharun Kumar Merugu <mtharu@codeaurora.org>
parent 6f808a5a
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -103,6 +103,7 @@

#define INIT_FILELEN_MAX (2*1024*1024)
#define INIT_MEMLEN_MAX  (8*1024*1024)
#define MAX_CACHE_BUF_SIZE (8*1024*1024)

#define PERF_END (void)0

@@ -494,7 +495,7 @@ static void fastrpc_buf_free(struct fastrpc_buf *buf, int cache)

	if (!fl)
		return;
	if (cache) {
	if (cache && buf->size < MAX_CACHE_BUF_SIZE) {
		spin_lock(&fl->hlock);
		hlist_add_head(&buf->hn, &fl->cached_bufs);
		spin_unlock(&fl->hlock);