projects
/
cascardo
/
linux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge tag 'irqchip-core-4.8' of git://git.infradead.org/users/jcooper/linux into...
[cascardo/linux.git]
/
mm
/
zswap.c
diff --git
a/mm/zswap.c
b/mm/zswap.c
index
de0f119
..
275b22c
100644
(file)
--- a/
mm/zswap.c
+++ b/
mm/zswap.c
@@
-117,7
+117,7
@@
struct zswap_pool {
struct crypto_comp * __percpu *tfm;
struct kref kref;
struct list_head list;
struct crypto_comp * __percpu *tfm;
struct kref kref;
struct list_head list;
- struct
rcu_head rcu_head
;
+ struct
work_struct work
;
struct notifier_block notifier;
char tfm_name[CRYPTO_MAX_ALG_NAME];
};
struct notifier_block notifier;
char tfm_name[CRYPTO_MAX_ALG_NAME];
};
@@
-658,9
+658,11
@@
static int __must_check zswap_pool_get(struct zswap_pool *pool)
return kref_get_unless_zero(&pool->kref);
}
return kref_get_unless_zero(&pool->kref);
}
-static void __zswap_pool_release(struct
rcu_head *head
)
+static void __zswap_pool_release(struct
work_struct *work
)
{
{
- struct zswap_pool *pool = container_of(head, typeof(*pool), rcu_head);
+ struct zswap_pool *pool = container_of(work, typeof(*pool), work);
+
+ synchronize_rcu();
/* nobody should have been able to get a kref... */
WARN_ON(kref_get_unless_zero(&pool->kref));
/* nobody should have been able to get a kref... */
WARN_ON(kref_get_unless_zero(&pool->kref));
@@
-680,7
+682,9
@@
static void __zswap_pool_empty(struct kref *kref)
WARN_ON(pool == zswap_pool_current());
list_del_rcu(&pool->list);
WARN_ON(pool == zswap_pool_current());
list_del_rcu(&pool->list);
- call_rcu(&pool->rcu_head, __zswap_pool_release);
+
+ INIT_WORK(&pool->work, __zswap_pool_release);
+ schedule_work(&pool->work);
spin_unlock(&zswap_pools_lock);
}
spin_unlock(&zswap_pools_lock);
}