summaryrefslogtreecommitdiffstats
path: root/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.6/0083-zcache-fix-deadlock-condition.patch
diff options
context:
space:
mode:
authorKoen Kooi <koen@dominion.thruhere.net>2012-02-14 19:11:39 +0100
committerDenys Dmytriyenko <denys@ti.com>2012-02-27 09:04:29 -0500
commit2425d6e457b51e756a742c58494e86d36fca0839 (patch)
tree0013e371ff581acbd79945cd409a0d18b5a388b9 /recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.6/0083-zcache-fix-deadlock-condition.patch
parentc4eefd753012467261cf221babd2e8639b81d3ca (diff)
downloadmeta-ti-2425d6e457b51e756a742c58494e86d36fca0839.tar.gz
linux-ti335x-psp 3.2: update to 3.2.6
Readahead fixed! Signed-off-by: Koen Kooi <koen@dominion.thruhere.net> Signed-off-by: Denys Dmytriyenko <denys@ti.com>
Diffstat (limited to 'recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.6/0083-zcache-fix-deadlock-condition.patch')
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.6/0083-zcache-fix-deadlock-condition.patch55
1 files changed, 55 insertions, 0 deletions
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.6/0083-zcache-fix-deadlock-condition.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.6/0083-zcache-fix-deadlock-condition.patch
new file mode 100644
index 00000000..c73b80a1
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.6/0083-zcache-fix-deadlock-condition.patch
@@ -0,0 +1,55 @@
1From 5c97f5b2d4924961479e862e8fe516ba217551b3 Mon Sep 17 00:00:00 2001
2From: Dan Magenheimer <dan.magenheimer@oracle.com>
3Date: Wed, 25 Jan 2012 14:32:51 -0800
4Subject: [PATCH 83/87] zcache: fix deadlock condition
5
6commit 9256a4789be3dae37d00924c03546ba7958ea5a3 upstream.
7
8I discovered this deadlock condition awhile ago working on RAMster
9but it affects zcache as well. The list spinlock must be
10locked prior to the page spinlock and released after. As
11a result, the page copy must also be done while the locks are held.
12
13Applies to 3.2. Konrad, please push (via GregKH?)...
14this is definitely a bug fix so need not be pushed during
15a -rc0 window.
16
17Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
18Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
19Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
20---
21 drivers/staging/zcache/zcache-main.c | 7 +++----
22 1 files changed, 3 insertions(+), 4 deletions(-)
23
24diff --git a/drivers/staging/zcache/zcache-main.c b/drivers/staging/zcache/zcache-main.c
25index d3a8e67..f5e469d 100644
26--- a/drivers/staging/zcache/zcache-main.c
27+++ b/drivers/staging/zcache/zcache-main.c
28@@ -358,8 +358,8 @@ static struct zbud_hdr *zbud_create(uint16_t client_id, uint16_t pool_id,
29 if (unlikely(zbpg == NULL))
30 goto out;
31 /* ok, have a page, now compress the data before taking locks */
32- spin_lock(&zbpg->lock);
33 spin_lock(&zbud_budlists_spinlock);
34+ spin_lock(&zbpg->lock);
35 list_add_tail(&zbpg->bud_list, &zbud_unbuddied[nchunks].list);
36 zbud_unbuddied[nchunks].count++;
37 zh = &zbpg->buddy[0];
38@@ -389,12 +389,11 @@ init_zh:
39 zh->oid = *oid;
40 zh->pool_id = pool_id;
41 zh->client_id = client_id;
42- /* can wait to copy the data until the list locks are dropped */
43- spin_unlock(&zbud_budlists_spinlock);
44-
45 to = zbud_data(zh, size);
46 memcpy(to, cdata, size);
47 spin_unlock(&zbpg->lock);
48+ spin_unlock(&zbud_budlists_spinlock);
49+
50 zbud_cumul_chunk_counts[nchunks]++;
51 atomic_inc(&zcache_zbud_curr_zpages);
52 zcache_zbud_cumul_zpages++;
53--
541.7.7.4
55