@@ -1392,9 +1392,9 @@ static struct pcpu_chunk * __init pcpu_alloc_first_chunk(unsigned long tmp_addr,
1392
1392
panic ("%s: Failed to allocate %zu bytes\n" , __func__ ,
1393
1393
alloc_size );
1394
1394
1395
- #ifdef CONFIG_MEMCG_KMEM
1395
+ #ifdef NEED_PCPUOBJ_EXT
1396
1396
/* first chunk is free to use */
1397
- chunk -> obj_cgroups = NULL ;
1397
+ chunk -> obj_exts = NULL ;
1398
1398
#endif
1399
1399
pcpu_init_md_blocks (chunk );
1400
1400
@@ -1463,12 +1463,12 @@ static struct pcpu_chunk *pcpu_alloc_chunk(gfp_t gfp)
1463
1463
if (!chunk -> md_blocks )
1464
1464
goto md_blocks_fail ;
1465
1465
1466
- #ifdef CONFIG_MEMCG_KMEM
1467
- if (! mem_cgroup_kmem_disabled ()) {
1468
- chunk -> obj_cgroups =
1466
+ #ifdef NEED_PCPUOBJ_EXT
1467
+ if (need_pcpuobj_ext ()) {
1468
+ chunk -> obj_exts =
1469
1469
pcpu_mem_zalloc (pcpu_chunk_map_bits (chunk ) *
1470
- sizeof (struct obj_cgroup * ), gfp );
1471
- if (!chunk -> obj_cgroups )
1470
+ sizeof (struct pcpuobj_ext ), gfp );
1471
+ if (!chunk -> obj_exts )
1472
1472
goto objcg_fail ;
1473
1473
}
1474
1474
#endif
@@ -1480,7 +1480,7 @@ static struct pcpu_chunk *pcpu_alloc_chunk(gfp_t gfp)
1480
1480
1481
1481
return chunk ;
1482
1482
1483
- #ifdef CONFIG_MEMCG_KMEM
1483
+ #ifdef NEED_PCPUOBJ_EXT
1484
1484
objcg_fail :
1485
1485
pcpu_mem_free (chunk -> md_blocks );
1486
1486
#endif
@@ -1498,8 +1498,8 @@ static void pcpu_free_chunk(struct pcpu_chunk *chunk)
1498
1498
{
1499
1499
if (!chunk )
1500
1500
return ;
1501
- #ifdef CONFIG_MEMCG_KMEM
1502
- pcpu_mem_free (chunk -> obj_cgroups );
1501
+ #ifdef NEED_PCPUOBJ_EXT
1502
+ pcpu_mem_free (chunk -> obj_exts );
1503
1503
#endif
1504
1504
pcpu_mem_free (chunk -> md_blocks );
1505
1505
pcpu_mem_free (chunk -> bound_map );
@@ -1646,9 +1646,9 @@ static void pcpu_memcg_post_alloc_hook(struct obj_cgroup *objcg,
1646
1646
if (!objcg )
1647
1647
return ;
1648
1648
1649
- if (likely (chunk && chunk -> obj_cgroups )) {
1649
+ if (likely (chunk && chunk -> obj_exts )) {
1650
1650
obj_cgroup_get (objcg );
1651
- chunk -> obj_cgroups [off >> PCPU_MIN_ALLOC_SHIFT ] = objcg ;
1651
+ chunk -> obj_exts [off >> PCPU_MIN_ALLOC_SHIFT ]. cgroup = objcg ;
1652
1652
1653
1653
rcu_read_lock ();
1654
1654
mod_memcg_state (obj_cgroup_memcg (objcg ), MEMCG_PERCPU_B ,
@@ -1663,13 +1663,13 @@ static void pcpu_memcg_free_hook(struct pcpu_chunk *chunk, int off, size_t size)
1663
1663
{
1664
1664
struct obj_cgroup * objcg ;
1665
1665
1666
- if (unlikely (!chunk -> obj_cgroups ))
1666
+ if (unlikely (!chunk -> obj_exts ))
1667
1667
return ;
1668
1668
1669
- objcg = chunk -> obj_cgroups [off >> PCPU_MIN_ALLOC_SHIFT ];
1669
+ objcg = chunk -> obj_exts [off >> PCPU_MIN_ALLOC_SHIFT ]. cgroup ;
1670
1670
if (!objcg )
1671
1671
return ;
1672
- chunk -> obj_cgroups [off >> PCPU_MIN_ALLOC_SHIFT ] = NULL ;
1672
+ chunk -> obj_exts [off >> PCPU_MIN_ALLOC_SHIFT ]. cgroup = NULL ;
1673
1673
1674
1674
obj_cgroup_uncharge (objcg , pcpu_obj_full_size (size ));
1675
1675
0 commit comments