diff options
author | Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com> | 2021-08-04 14:25:42 +0000 |
---|---|---|
committer | Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com> | 2021-08-04 14:25:42 +0000 |
commit | 90c98361bbdcca1a50305b71d5a8aebb1e8918b3 (patch) | |
tree | 80f9693d75279ed576d003cf74e59a82cc9a5682 /mm | |
parent | e3b082933caab27829e775606708381fe1b7c3ba (diff) | |
parent | 0a0beb1f9120cf49a429e12f4ea69ddd74471d68 (diff) |
Merge tag 'v5.4.135' into 5.4-2.3.x-imx
This is the 5.4.135 stable release
Conflicts (manual resolve):
- drivers/usb/cdns3/gadget.c:
Use NXP version, as upstream commit f53729b828db7 ("usb: cdns3: Enable
TDL_CHK only for OUT ep") is already applied.
- arch/arm64/boot/dts/freescale/imx8mq.dtsi:
Merge upstream commit 556cf02830351 ("arm64: dts: imx8mq: assign PCIe
clocks") manually into NXP tree.
Signed-off-by: Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/slab_common.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/mm/slab_common.c b/mm/slab_common.c index 636cd496417c..8f128245b300 100644 --- a/mm/slab_common.c +++ b/mm/slab_common.c @@ -325,14 +325,6 @@ int slab_unmergeable(struct kmem_cache *s) if (s->refcount < 0) return 1; -#ifdef CONFIG_MEMCG_KMEM - /* - * Skip the dying kmem_cache. - */ - if (s->memcg_params.dying) - return 1; -#endif - return 0; } @@ -973,6 +965,16 @@ void kmem_cache_destroy(struct kmem_cache *s) get_online_mems(); mutex_lock(&slab_mutex); + + /* + * Another thread referenced it again + */ + if (READ_ONCE(s->refcount)) { + spin_lock_irq(&memcg_kmem_wq_lock); + s->memcg_params.dying = false; + spin_unlock_irq(&memcg_kmem_wq_lock); + goto out_unlock; + } #endif err = shutdown_memcg_caches(s); |