函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\trace\ring_buffer.c Create Date:2022-07-27 12:59:14
Last Modify:2020-03-17 19:30:04 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:rb_insert_pages

函数原型:static int rb_insert_pages(struct ring_buffer_per_cpu *cpu_buffer)

返回类型:int

参数:

类型参数名称
struct ring_buffer_per_cpu *cpu_buffer
1609  pages等于w pages to add
1612  关闭本地中断,获取所要保护的运行队列(runqueue)的自旋锁(spinlock),为查找可运行进程做准备。( & serialize readers )
1627  retries等于10
1628  success等于0
1629 retries自减循环
1634  head_page等于list of buffer pages
1635  如果非head_page退出
1637  prev_page等于链表前项
1639  first_page等于链表后项
1640  last_page等于链表前项
1642  head_page_with_bit等于head_page按位或RB_PAGE_HEAD
1645  链表后项等于head_page_with_bit
1646  链表前项等于prev_page
1648  r等于cmpxchg( & 链表后项, head_page_with_bit, first_page)
1650  如果r恒等于head_page_with_bit
1656  链表前项等于last_page
1657  success等于1
1658  退出
1662  如果success初始化链表头
1668  uffer may be either ring_buffer or ring_buffer_per_cpu (cpu_buffer, !success)
1669  raw_spin_unlock_irq( & serialize readers )
1672  如果非success
1676  删除链表项并重新初始化
1677  Also stolen from mm/slob.c. Thanks to Mathieu Desnoyers for pointing* this issue out.
1680  返回:success
调用者
名称描述
rb_update_pages