Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\slab.c Create Date:2022-07-28 15:46:14
Last Modify:2022-05-23 17:02:55 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:enable_cpucache

Proto:static int enable_cpucache(struct kmem_cache *cachep, gfp_t gfp)

Type:int

Parameter:

TypeParameterName
struct kmem_cache *cachep
gfp_tgfp
3920  limit = 0
3921  shared = 0
3922  batchcount = 0
3924  err = cache_random_seq_create(cachep, num, gfp)
3925  If err Then Go to end
3928  If Not is_root_cache(cachep) Then
3929  root = memcg_root_cache(cachep)
3930  limit = limit
3931  shared = shared
3932  batchcount = batchcount
3935  If limit && shared && batchcount Then Go to skip_setup
3946  If The size of an object including metadata > 131072 Then limit = 1
3948  Else if The size of an object including metadata > PAGE_SIZE Then limit = 8
3950  Else if The size of an object including metadata > 1024 Then limit = 24
3952  Else if The size of an object including metadata > 256 Then limit = 54
3954  Else limit = 120
3966  shared = 0
3967  If The size of an object including metadata <= PAGE_SIZE && num_possible_cpus() > 1 Then shared = 8
3978  batchcount = (limit + 1) / 2
3979  skip_setup :
3980  err = do_tune_cpucache(cachep, limit, batchcount, shared, gfp)
3981  end :
3982  If err Then pr_err("enable_cpucache failed for %s, error %d\n", Name (only for display!) , - err)
3985  Return err
Caller
NameDescribe
kmem_cache_init_late
setup_cpu_cache