函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\mempolicy.c Create Date:2022-07-27 17:06:43
Last Modify:2020-03-17 22:28:11 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:Replace a policy range.

函数原型:static int shared_policy_replace(struct shared_policy *sp, unsigned long start, unsigned long end, struct sp_node *new)

返回类型:int

参数:

类型参数名称
struct shared_policy *sp
unsigned longstart
unsigned longend
struct sp_node *new
2528  struct sp_node * n_new = NULL
2529  struct mempolicy * mpol_new = NULL
2530  ret等于0
2532  restart :
2533  write_lock( & lock)
2534  n等于lookup first element intersecting start-end. Caller holds sp->lock for* reading or for writing
2536 nstart小于end循环
2537  next等于rb_next( & nd)
2538  如果start大于等于start
2539  如果end小于等于endsp_delete(sp, n)
2541  否则start等于end
2543  否则
2545  如果end大于end
2546  如果非n_new则转到:alloc_new
2549  mpol_new等于policy
2550  atomic_set( & refcnt, 1)
2552  end等于start
2554  n_new = NULL
2555  mpol_new = NULL
2556  退出
2557  否则end等于start
2560  如果非next退出
2562  n等于rb_entry(next, structsp_node, nd)
2564  如果newInsert a new shared policy into the list. Caller holds sp->lock for* writing.
2566  write_unlock( & lock)
2567  ret等于0
2569  err_out :
2570  如果mpol_newmpol_put(mpol_new)
2572  如果n_newkmem_cache_free(sn_cache, n_new)
2575  返回:ret
2577  alloc_new :
2578  write_unlock( & lock)
2579  ret等于负ENOMEM
2580  n_new等于分配高速缓存区
2581  如果非n_new则转到:err_out
2583  mpol_new等于分配高速缓存区
2584  如果非mpol_new则转到:err_out
2586  转到:restart
调用者
名称描述
mpol_set_shared_policy