Lines Matching refs:s
19 static void __scs_account(void *s, int account) in __scs_account() argument
21 struct page *scs_page = vmalloc_to_page(s); in __scs_account()
34 void *s; in __scs_alloc() local
37 s = this_cpu_xchg(scs_cache[i], NULL); in __scs_alloc()
38 if (s) { in __scs_alloc()
39 s = kasan_unpoison_vmalloc(s, SCS_SIZE, in __scs_alloc()
41 memset(s, 0, SCS_SIZE); in __scs_alloc()
46 s = __vmalloc_node_range(SCS_SIZE, 1, VMALLOC_START, VMALLOC_END, in __scs_alloc()
51 return kasan_reset_tag(s); in __scs_alloc()
56 void *s; in scs_alloc() local
58 s = __scs_alloc(node); in scs_alloc()
59 if (!s) in scs_alloc()
62 *__scs_magic(s) = SCS_END_MAGIC; in scs_alloc()
68 kasan_poison_vmalloc(s, SCS_SIZE); in scs_alloc()
69 __scs_account(s, 1); in scs_alloc()
70 return s; in scs_alloc()
73 void scs_free(void *s) in scs_free() argument
77 __scs_account(s, -1); in scs_free()
86 if (this_cpu_cmpxchg(scs_cache[i], 0, s) == NULL) in scs_free()
89 kasan_unpoison_vmalloc(s, SCS_SIZE, KASAN_VMALLOC_PROT_NORMAL); in scs_free()
90 vfree_atomic(s); in scs_free()
116 void *s; in scs_prepare() local
121 s = scs_alloc(node); in scs_prepare()
122 if (!s) in scs_prepare()
125 task_scs(tsk) = task_scs_sp(tsk) = s; in scs_prepare()
159 void *s = task_scs(tsk); in scs_release() local
161 if (!scs_is_enabled() || !s) in scs_release()
167 scs_free(s); in scs_release()