函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:include\linux\ptr_ring.h Create Date:2022-07-27 14:41:03
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:Return entries into ring

函数原型:static inline void ptr_ring_unconsume(struct ptr_ring *r, void **batch, int n, void (*destroy)(void *))

返回类型:void

参数:

类型参数名称
struct ptr_ring *r
void **batch
intn
void (*destroy
516  spin_lock_irqsave( & consumer_lock, flags)
517  加自旋锁
519  如果非 Read-only by both the producer and the consumer 则转到:done
526  head等于consumer_head减1
527 此条件成立可能性大(为编译器优化)(head >= next entry to invalidate )循环
528  queue[head--] = NULL
529  next entry to invalidate 等于consumer_head
535 n循环
536  head等于consumer_head减1
537  如果head小于0则head等于 Read-only by both the producer and the consumer 减1
539  如果queue[head]则
541  转到:done
543  queue[head]等于batch[--n]
544  next entry to invalidate 等于head
546  WRITE_ONCE(consumer_head, head)
549  done :
551 n循环
552  destroy(batch[--n])
553  自旋锁解锁
554  spin_unlock_irqrestore( & consumer_lock, flags)