Function report |
Source Code:lib\test_meminit.c |
Create Date:2022-07-28 06:37:38 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:Check that the data written to an RCU-allocated object survives* reallocation.
Proto:static int __init do_kmem_cache_rcu_persistent(int size, int *total_failures)
Type:int
Parameter:
Type | Parameter | Name |
---|---|---|
int | size | |
int * | total_failures |
276 | maxiter = 1024 |
277 | bool fail = false |
279 | c = kmem_cache_create("test_cache", size, size, Defer freeing slabs to RCU , NULL) |
281 | buf = kmem_cache_alloc(c, GFP_KERNEL) |
283 | fill_with_garbage(buf, size) |
284 | buf_contents = kmalloc(size, GFP_KERNEL) |
285 | If Not buf_contents Then Go to out |
287 | used_objects = kmalloc_array - allocate memory for an array.*@n: number of elements.*@size: element size.*@flags: the type of memory to allocate (see kmalloc). |
288 | If Not used_objects Then |
289 | kfree(buf_contents) |
290 | Go to out |
292 | No 3D Now!(buf_contents, buf, size) |
293 | kmem_cache_free(c, buf) |
299 | buf = kmem_cache_alloc(c, GFP_KERNEL) |
300 | used_objects[iter] = buf |
302 | fail = memcmp(buf_contents, buf, size) |
303 | When i <= iter cycle kmem_cache_free(c, used_objects[i]) |
305 | Go to free_out |
309 | free_out : |
310 | kmem_cache_destroy(c) |
311 | kfree(buf_contents) |
312 | kfree(used_objects) |
313 | out : |
314 | total_failures += fail |
315 | Return 1 |
Name | Describe |
---|---|
test_rcu_persistent | Test the behavior of SLAB_TYPESAFE_BY_RCU caches of different sizes. |
Source code conversion tool public plug-in interface | X |
---|---|
Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |