Lines Matching refs:s
34 static inline unsigned long *scs_magic(void *s) in scs_magic() argument
36 return (unsigned long *)(s + SCS_SIZE) - 1; in scs_magic()
39 static inline void scs_set_magic(void *s) in scs_set_magic() argument
41 *scs_magic(s) = SCS_END_MAGIC; in scs_set_magic()
53 void *s; in scs_alloc() local
56 s = this_cpu_xchg(scs_cache[i], NULL); in scs_alloc()
57 if (s) { in scs_alloc()
58 memset(s, 0, SCS_SIZE); in scs_alloc()
69 s = __vmalloc_node_range(PAGE_SIZE, SCS_SIZE, in scs_alloc()
75 if (s) in scs_alloc()
76 scs_set_magic(s); in scs_alloc()
79 return s; in scs_alloc()
82 static void scs_free(void *s) in scs_free() argument
87 if (this_cpu_cmpxchg(scs_cache[i], 0, s) == NULL) in scs_free()
90 vfree_atomic(s); in scs_free()
123 void *s; in scs_alloc() local
125 s = kmem_cache_alloc_node(scs_cache, GFP_SCS, node); in scs_alloc()
126 if (s) { in scs_alloc()
127 scs_set_magic(s); in scs_alloc()
132 kasan_poison_object_data(scs_cache, s); in scs_alloc()
135 return s; in scs_alloc()
138 static inline void scs_free(void *s) in scs_free() argument
140 kasan_unpoison_object_data(scs_cache, s); in scs_free()
141 kmem_cache_free(scs_cache, s); in scs_free()
175 void *s; in scs_prepare() local
177 s = scs_alloc(node); in scs_prepare()
178 if (!s) in scs_prepare()
181 task_set_scs(tsk, s); in scs_prepare()
192 unsigned long s = (unsigned long)p; in scs_used() local
197 return (unsigned long)p - s; in scs_used()
234 void *s; in scs_release() local
236 s = __scs_base(tsk); in scs_release()
237 if (!s) in scs_release()
245 scs_free(s); in scs_release()