函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:ipc\shm.c Create Date:2022-07-27 18:21:54
Last Modify:2020-03-17 22:58:32 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:shm_destroy

函数原型:static void shm_destroy(struct ipc_namespace *ns, struct shmid_kernel *shp)

返回类型:void

参数:

类型参数名称
struct ipc_namespace *ns
struct shmid_kernel *shp
283  shm_file等于shm_file
284  shm_file = NULL
285  shm_tot减等于shm_segszPAGE_SIZE减1右移PAGE_SHIFT determines the page size
286  shm_rmid(ns, shp)
287  shm_unlock(shp)
288  如果非is_file_hugepages(shm_file)则shmem_lock(shm_file, 0, mlock_user)
290  否则如果mlock_useruser_shm_unlock(NOTE: in a 32bit arch with a preemptable kernel and* an UP compile the i_size_read/write must be atomic* with respect to the local cpu (unlike with preempt disabled),* but they don't need to be atomic with respect to other cpus like in* true SMP (so they , mlock_user)
293  fput(shm_file)
294  ipc_update_pid( & shm_cprid, NULL)
295  ipc_update_pid( & shm_lprid, NULL)
296  ipc_rcu_putref( & shm_perm, shm_rcu_free)
调用者
名称描述
do_shm_rmidCalled with shm_ids.rwsem (writer) and the shp structure locked.* Only shm_ids.rwsem remains locked on exit.
shm_close
shm_try_destroy_orphanedCalled with ns->shm_ids(ns).rwsem locked
exit_shmLocking assumes this will only be called with task == current
do_shmatFix shmaddr, allocate descriptor, map shm, add attach descriptor to lists.* NOTE! Despite the name, this is NOT a direct system call entrypoint. The* "raddr" thing points to kernel space, and there has to be a wrapper around* this.