Re: + mm-zswap-use-workqueue-to-destroy-pool.patch added to -mm tree
On Wed, Apr 27, 2016 at 1:40 AM, Sergey Senozhatskywrote: > Hello, > > On (04/26/16 16:52), a...@linux-foundation.org wrote: > [..] >> -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(>kref)); >> @@ -674,7 +676,9 @@ static void __zswap_pool_empty(struct kr >> WARN_ON(pool == zswap_pool_current()); >> >> list_del_rcu(>list); >> - call_rcu(>rcu_head, __zswap_pool_release); >> + >> + INIT_WORK(>work, __zswap_pool_release); >> + schedule_work(>work); >> >> spin_unlock(_pools_lock); >> } >> _ >> >> Patches currently in -mm which might be from ddstr...@ieee.org are >> >> mm-zpool-use-workqueue-for-zpool_destroy.patch >> mm-zswap-use-workqueue-to-destroy-pool.patch > > I think only mm-zswap-use-workqueue-to-destroy-pool.patch is > needed. yep, please drop mm-zpool-use-workqueue-for-zpool_destroy.patch thanks! > > -ss
Re: + mm-zswap-use-workqueue-to-destroy-pool.patch added to -mm tree
On Wed, Apr 27, 2016 at 1:40 AM, Sergey Senozhatsky wrote: > Hello, > > On (04/26/16 16:52), a...@linux-foundation.org wrote: > [..] >> -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(>kref)); >> @@ -674,7 +676,9 @@ static void __zswap_pool_empty(struct kr >> WARN_ON(pool == zswap_pool_current()); >> >> list_del_rcu(>list); >> - call_rcu(>rcu_head, __zswap_pool_release); >> + >> + INIT_WORK(>work, __zswap_pool_release); >> + schedule_work(>work); >> >> spin_unlock(_pools_lock); >> } >> _ >> >> Patches currently in -mm which might be from ddstr...@ieee.org are >> >> mm-zpool-use-workqueue-for-zpool_destroy.patch >> mm-zswap-use-workqueue-to-destroy-pool.patch > > I think only mm-zswap-use-workqueue-to-destroy-pool.patch is > needed. yep, please drop mm-zpool-use-workqueue-for-zpool_destroy.patch thanks! > > -ss
Re: + mm-zswap-use-workqueue-to-destroy-pool.patch added to -mm tree
Hello, On (04/26/16 16:52), a...@linux-foundation.org wrote: [..] > -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(>kref)); > @@ -674,7 +676,9 @@ static void __zswap_pool_empty(struct kr > WARN_ON(pool == zswap_pool_current()); > > list_del_rcu(>list); > - call_rcu(>rcu_head, __zswap_pool_release); > + > + INIT_WORK(>work, __zswap_pool_release); > + schedule_work(>work); > > spin_unlock(_pools_lock); > } > _ > > Patches currently in -mm which might be from ddstr...@ieee.org are > > mm-zpool-use-workqueue-for-zpool_destroy.patch > mm-zswap-use-workqueue-to-destroy-pool.patch I think only mm-zswap-use-workqueue-to-destroy-pool.patch is needed. -ss
Re: + mm-zswap-use-workqueue-to-destroy-pool.patch added to -mm tree
Hello, On (04/26/16 16:52), a...@linux-foundation.org wrote: [..] > -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(>kref)); > @@ -674,7 +676,9 @@ static void __zswap_pool_empty(struct kr > WARN_ON(pool == zswap_pool_current()); > > list_del_rcu(>list); > - call_rcu(>rcu_head, __zswap_pool_release); > + > + INIT_WORK(>work, __zswap_pool_release); > + schedule_work(>work); > > spin_unlock(_pools_lock); > } > _ > > Patches currently in -mm which might be from ddstr...@ieee.org are > > mm-zpool-use-workqueue-for-zpool_destroy.patch > mm-zswap-use-workqueue-to-destroy-pool.patch I think only mm-zswap-use-workqueue-to-destroy-pool.patch is needed. -ss