Home
last modified time | relevance | path

Searched refs:tail (Results 1 – 25 of 892) sorted by relevance

12345678910>>...36

/linux-6.6.21/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/
Ddebug_private.h30 return (debug_data_ptr->head == debug_data_ptr->tail); in is_debug_buffer_empty()
56 if (remote_tail > debug_data_ptr->tail) { in debug_synch_queue()
57 size_t delta = remote_tail - debug_data_ptr->tail; in debug_synch_queue()
60 debug_data_ptr->tail * sizeof(uint32_t), in debug_synch_queue()
61 (void *)&debug_data_ptr->buf[debug_data_ptr->tail], delta * sizeof(uint32_t)); in debug_synch_queue()
62 } else if (remote_tail < debug_data_ptr->tail) { in debug_synch_queue()
63 size_t delta = DEBUG_BUF_SIZE - debug_data_ptr->tail; in debug_synch_queue()
66 debug_data_ptr->tail * sizeof(uint32_t), in debug_synch_queue()
67 (void *)&debug_data_ptr->buf[debug_data_ptr->tail], delta * sizeof(uint32_t)); in debug_synch_queue()
72 debug_data_ptr->tail = remote_tail; in debug_synch_queue()
[all …]
/linux-6.6.21/tools/lib/
Dlist_sort.c18 struct list_head *head, **tail = &head; in merge() local
23 *tail = a; in merge()
24 tail = &a->next; in merge()
27 *tail = b; in merge()
31 *tail = b; in merge()
32 tail = &b->next; in merge()
35 *tail = a; in merge()
54 struct list_head *tail = head; in merge_final() local
60 tail->next = a; in merge_final()
61 a->prev = tail; in merge_final()
[all …]
/linux-6.6.21/lib/
Dlist_sort.c19 struct list_head *head, **tail = &head; in merge() local
24 *tail = a; in merge()
25 tail = &a->next; in merge()
28 *tail = b; in merge()
32 *tail = b; in merge()
33 tail = &b->next; in merge()
36 *tail = a; in merge()
55 struct list_head *tail = head; in merge_final() local
61 tail->next = a; in merge_final()
62 a->prev = tail; in merge_final()
[all …]
/linux-6.6.21/arch/arm64/kernel/
Dperf_callchain.c23 user_backtrace(struct frame_tail __user *tail, in user_backtrace() argument
31 if (!access_ok(tail, sizeof(buftail))) in user_backtrace()
35 err = __copy_from_user_inatomic(&buftail, tail, sizeof(buftail)); in user_backtrace()
49 if (tail >= buftail.fp) in user_backtrace()
71 compat_user_backtrace(struct compat_frame_tail __user *tail, in compat_user_backtrace() argument
78 if (!access_ok(tail, sizeof(buftail))) in compat_user_backtrace()
82 err = __copy_from_user_inatomic(&buftail, tail, sizeof(buftail)); in compat_user_backtrace()
94 if (tail + 1 >= (struct compat_frame_tail __user *) in compat_user_backtrace()
114 struct frame_tail __user *tail; in perf_callchain_user() local
116 tail = (struct frame_tail __user *)regs->regs[29]; in perf_callchain_user()
[all …]
/linux-6.6.21/Documentation/translations/zh_CN/core-api/
Dcircular-buffers.rst55 (2) 'tail'索引 - 消费者在缓冲区中找到下一个元素的位置。
57 通常,当tail指针等于head指针时,表明缓冲区是空的;而当head指针比tail指针少一个时,
60 添加元素时,递增head索引;删除元素时,递增tail索引。tail索引不应该跳过head索引,
111 产者控制着head索引,但消费者可能仍然在另一个CPU上耗尽缓冲区并移动tail索引。
116 者控制着tail索引,但生产者可能仍然在另一个CPU上填充缓冲区并移动head索引。
146 unsigned long tail = READ_ONCE(buffer->tail);
148 if (CIRC_SPACE(head, tail, buffer->size) >= 1) {
181 unsigned long tail = buffer->tail;
183 if (CIRC_CNT(head, tail, buffer->size) >= 1) {
186 struct item *item = buffer[tail];
[all …]
/linux-6.6.21/drivers/rpmsg/
Dqcom_glink_smem.c53 __le32 *tail; member
70 u32 tail; in glink_smem_rx_avail() local
86 tail = le32_to_cpu(*pipe->tail); in glink_smem_rx_avail()
88 if (head < tail) in glink_smem_rx_avail()
89 return pipe->native.length - tail + head; in glink_smem_rx_avail()
91 return head - tail; in glink_smem_rx_avail()
99 u32 tail; in glink_smem_rx_peek() local
101 tail = le32_to_cpu(*pipe->tail); in glink_smem_rx_peek()
102 tail += offset; in glink_smem_rx_peek()
103 if (tail >= pipe->native.length) in glink_smem_rx_peek()
[all …]
Dqcom_glink_rpm.c51 void __iomem *tail; member
73 unsigned int tail; in glink_rpm_rx_avail() local
76 tail = readl(pipe->tail); in glink_rpm_rx_avail()
78 if (head < tail) in glink_rpm_rx_avail()
79 return pipe->native.length - tail + head; in glink_rpm_rx_avail()
81 return head - tail; in glink_rpm_rx_avail()
88 unsigned int tail; in glink_rpm_rx_peek() local
91 tail = readl(pipe->tail); in glink_rpm_rx_peek()
92 tail += offset; in glink_rpm_rx_peek()
93 if (tail >= pipe->native.length) in glink_rpm_rx_peek()
[all …]
/linux-6.6.21/drivers/infiniband/sw/rdmavt/
Dcq.c34 u32 tail; in rvt_cq_enter() local
42 tail = RDMA_READ_UAPI_ATOMIC(u_wc->tail); in rvt_cq_enter()
47 tail = k_wc->tail; in rvt_cq_enter()
61 if (unlikely(next == tail || cq->cq_full)) { in rvt_cq_enter()
319 RDMA_READ_UAPI_ATOMIC(cq->queue->tail)) in rvt_req_notify_cq()
322 if (cq->kqueue->head != cq->kqueue->tail) in rvt_req_notify_cq()
341 u32 head, tail, n; in rvt_resize_cq() local
386 tail = RDMA_READ_UAPI_ATOMIC(old_u_wc->tail); in rvt_resize_cq()
390 tail = old_k_wc->tail; in rvt_resize_cq()
395 if (tail > (u32)cq->ibcq.cqe) in rvt_resize_cq()
[all …]
Dsrq.c137 u32 sz, size, n, head, tail; in rvt_modify_srq() local
175 tail = RDMA_READ_UAPI_ATOMIC(owq->tail); in rvt_modify_srq()
179 tail = okwq->tail; in rvt_modify_srq()
181 if (head >= srq->rq.size || tail >= srq->rq.size) { in rvt_modify_srq()
186 if (n < tail) in rvt_modify_srq()
187 n += srq->rq.size - tail; in rvt_modify_srq()
189 n -= tail; in rvt_modify_srq()
196 while (tail != head) { in rvt_modify_srq()
200 wqe = rvt_get_rwqe_ptr(&srq->rq, tail); in rvt_modify_srq()
207 if (++tail >= srq->rq.size) in rvt_modify_srq()
[all …]
Drc.c66 u32 tail; in rvt_compute_aeth() local
73 tail = RDMA_READ_UAPI_ATOMIC(qp->r_rq.wq->tail); in rvt_compute_aeth()
76 tail = READ_ONCE(qp->r_rq.kwq->tail); in rvt_compute_aeth()
80 if (tail >= qp->r_rq.size) in rvt_compute_aeth()
81 tail = 0; in rvt_compute_aeth()
88 credits = rvt_get_rq_count(&qp->r_rq, head, tail); in rvt_compute_aeth()
/linux-6.6.21/drivers/net/ethernet/intel/fm10k/
Dfm10k_mbx.c17 fifo->tail = 0; in fm10k_fifo_init()
28 return fifo->tail - fifo->head; in fm10k_fifo_used()
39 return fifo->size + fifo->head - fifo->tail; in fm10k_fifo_unused()
50 return fifo->head == fifo->tail; in fm10k_fifo_empty()
74 return (fifo->tail + offset) & (fifo->size - 1); in fm10k_fifo_tail_offset()
120 fifo->head = fifo->tail; in fm10k_fifo_drop_all()
132 static u16 fm10k_mbx_index_len(struct fm10k_mbx_info *mbx, u16 head, u16 tail) in fm10k_mbx_index_len() argument
134 u16 len = tail - head; in fm10k_mbx_index_len()
137 if (len > tail) in fm10k_mbx_index_len()
153 u16 tail = (mbx->tail + offset + 1) & ((mbx->mbmem_len << 1) - 1); in fm10k_mbx_tail_add() local
[all …]
/linux-6.6.21/include/linux/
Dcirc_buf.h12 int tail; member
16 #define CIRC_CNT(head,tail,size) (((head) - (tail)) & ((size)-1)) argument
21 #define CIRC_SPACE(head,tail,size) CIRC_CNT((tail),((head)+1),(size)) argument
26 #define CIRC_CNT_TO_END(head,tail,size) \ argument
27 ({int end = (size) - (tail); \
32 #define CIRC_SPACE_TO_END(head,tail,size) \ argument
34 int n = (end + (tail)) & ((size)-1); \
/linux-6.6.21/drivers/net/wireguard/
Dqueueing.c56 queue->head = queue->tail = STUB(queue); in wg_prev_queue_init()
82 struct sk_buff *tail = queue->tail, *next = smp_load_acquire(&NEXT(tail)); in wg_prev_queue_dequeue() local
84 if (tail == STUB(queue)) { in wg_prev_queue_dequeue()
87 queue->tail = next; in wg_prev_queue_dequeue()
88 tail = next; in wg_prev_queue_dequeue()
92 queue->tail = next; in wg_prev_queue_dequeue()
94 return tail; in wg_prev_queue_dequeue()
96 if (tail != READ_ONCE(queue->head)) in wg_prev_queue_dequeue()
99 next = smp_load_acquire(&NEXT(tail)); in wg_prev_queue_dequeue()
101 queue->tail = next; in wg_prev_queue_dequeue()
[all …]
/linux-6.6.21/drivers/gpu/drm/i915/gt/
Dintel_ring.h26 void intel_ring_reset(struct intel_ring *ring, u32 tail);
91 assert_ring_tail_valid(const struct intel_ring *ring, unsigned int tail) in assert_ring_tail_valid() argument
95 GEM_BUG_ON(!intel_ring_offset_valid(ring, tail)); in assert_ring_tail_valid()
112 GEM_BUG_ON(cacheline(tail) == cacheline(head) && tail < head); in assert_ring_tail_valid()
117 intel_ring_set_tail(struct intel_ring *ring, unsigned int tail) in intel_ring_set_tail() argument
125 assert_ring_tail_valid(ring, tail); in intel_ring_set_tail()
126 ring->tail = tail; in intel_ring_set_tail()
127 return tail; in intel_ring_set_tail()
131 __intel_ring_space(unsigned int head, unsigned int tail, unsigned int size) in __intel_ring_space() argument
139 return (head - tail - CACHELINE_BYTES) & (size - 1); in __intel_ring_space()
/linux-6.6.21/arch/arm/kernel/
Dperf_callchain.c34 user_backtrace(struct frame_tail __user *tail, in user_backtrace() argument
40 if (!access_ok(tail, sizeof(buftail))) in user_backtrace()
44 err = __copy_from_user_inatomic(&buftail, tail, sizeof(buftail)); in user_backtrace()
56 if (tail + 1 >= buftail.fp) in user_backtrace()
65 struct frame_tail __user *tail; in perf_callchain_user() local
72 tail = (struct frame_tail __user *)regs->ARM_fp - 1; in perf_callchain_user()
75 tail && !((unsigned long)tail & 0x3)) in perf_callchain_user()
76 tail = user_backtrace(tail, entry); in perf_callchain_user()
/linux-6.6.21/kernel/locking/
Dqspinlock.c118 u32 tail; in encode_tail() local
120 tail = (cpu + 1) << _Q_TAIL_CPU_OFFSET; in encode_tail()
121 tail |= idx << _Q_TAIL_IDX_OFFSET; /* assume < 4 */ in encode_tail()
123 return tail; in encode_tail()
126 static inline __pure struct mcs_spinlock *decode_tail(u32 tail) in decode_tail() argument
128 int cpu = (tail >> _Q_TAIL_CPU_OFFSET) - 1; in decode_tail()
129 int idx = (tail & _Q_TAIL_IDX_MASK) >> _Q_TAIL_IDX_OFFSET; in decode_tail()
177 static __always_inline u32 xchg_tail(struct qspinlock *lock, u32 tail) in xchg_tail() argument
183 return (u32)xchg_relaxed(&lock->tail, in xchg_tail()
184 tail >> _Q_TAIL_OFFSET) << _Q_TAIL_OFFSET; in xchg_tail()
[all …]
/linux-6.6.21/include/drm/
Dspsc_queue.h43 atomic_long_t tail; member
51 atomic_long_set(&queue->tail, (long)&queue->head); in spsc_queue_init()
67 struct spsc_node **tail; in spsc_queue_push() local
73 tail = (struct spsc_node **)atomic_long_xchg(&queue->tail, (long)&node->next); in spsc_queue_push()
74 WRITE_ONCE(*tail, node); in spsc_queue_push()
85 return tail == &queue->head; in spsc_queue_push()
107 if (atomic_long_cmpxchg(&queue->tail, in spsc_queue_pop()
/linux-6.6.21/drivers/media/test-drivers/vidtv/
Dvidtv_channel.c165 struct vidtv_psi_table_eit_event *tail = NULL; in vidtv_channel_eit_event_cat_into_new() local
182 tail = vidtv_psi_eit_event_init(tail, event_id); in vidtv_channel_eit_event_cat_into_new()
183 if (!tail) { in vidtv_channel_eit_event_cat_into_new()
189 vidtv_psi_desc_assign(&tail->descriptor, desc); in vidtv_channel_eit_event_cat_into_new()
192 head = tail; in vidtv_channel_eit_event_cat_into_new()
211 struct vidtv_psi_table_sdt_service *tail = NULL; in vidtv_channel_sdt_serv_cat_into_new() local
229 tail = vidtv_psi_sdt_service_init(tail, in vidtv_channel_sdt_serv_cat_into_new()
233 if (!tail) in vidtv_channel_sdt_serv_cat_into_new()
239 vidtv_psi_desc_assign(&tail->descriptor, desc); in vidtv_channel_sdt_serv_cat_into_new()
242 head = tail; in vidtv_channel_sdt_serv_cat_into_new()
[all …]
/linux-6.6.21/Documentation/trace/
Dring-buffer-design.rst21 tail
191 It is possible that the page swapped is the commit page and the tail page,
196 reader page commit page tail page
227 tail page
253 +---------+ <--- tail pointer
278 +---------+ <--- tail pointer
291 +---------+ <--- tail pointer
302 +---------+ <--(last full commit and tail pointer)
311 The tail page points to the page with the last write (before
314 The tail page is always equal to or after the commit page. It may
[all …]
/linux-6.6.21/net/sunrpc/
Dxdr.c179 const struct kvec *tail = xdr->tail; in xdr_buf_to_bvec() local
204 if (tail->iov_len) { in xdr_buf_to_bvec()
205 bvec_set_virt(bvec, tail->iov_base, tail->iov_len); in xdr_buf_to_bvec()
231 struct kvec *tail = xdr->tail; in xdr_inline_pages() local
241 tail->iov_base = buf + offset; in xdr_inline_pages()
242 tail->iov_len = buflen - offset; in xdr_inline_pages()
501 xdr_buf_iov_zero(buf->tail, pgbase - buf->page_len, len); in xdr_buf_pages_zero()
505 xdr_buf_iov_zero(buf->tail, 0, pgbase + len - buf->page_len); in xdr_buf_pages_zero()
561 struct kvec *tail = buf->tail; in xdr_buf_try_expand() local
562 unsigned int sum = head->iov_len + buf->page_len + tail->iov_len; in xdr_buf_try_expand()
[all …]
/linux-6.6.21/fs/
Dsplice.c201 unsigned int tail = pipe->tail; in splice_to_pipe() local
215 while (!pipe_full(head, tail, pipe->max_usage)) { in splice_to_pipe()
248 unsigned int tail = pipe->tail; in add_to_pipe() local
255 } else if (pipe_full(head, tail, pipe->max_usage)) { in add_to_pipe()
333 used = pipe_occupancy(pipe->head, pipe->tail); in copy_splice_read()
448 unsigned int tail = pipe->tail; in splice_from_pipe_feed() local
452 while (!pipe_empty(head, tail)) { in splice_from_pipe_feed()
453 struct pipe_buffer *buf = &pipe->bufs[tail & mask]; in splice_from_pipe_feed()
480 tail++; in splice_from_pipe_feed()
481 pipe->tail = tail; in splice_from_pipe_feed()
[all …]
Dpipe.c224 unsigned int tail = READ_ONCE(pipe->tail); in pipe_readable() local
227 return !pipe_empty(head, tail) || !writers; in pipe_readable()
254 was_full = pipe_full(pipe->head, pipe->tail, pipe->max_usage); in pipe_read()
258 unsigned int tail = pipe->tail; in pipe_read() local
285 if (!pipe_empty(head, tail)) { in pipe_read()
286 struct pipe_buffer *buf = &pipe->bufs[tail & mask]; in pipe_read()
330 tail++; in pipe_read()
331 pipe->tail = tail; in pipe_read()
337 if (!pipe_empty(head, tail)) /* More to do? */ in pipe_read()
383 was_full = pipe_full(pipe->head, pipe->tail, pipe->max_usage); in pipe_read()
[all …]
/linux-6.6.21/net/sched/
Dsch_choke.c67 unsigned int tail; member
77 return (q->tail - q->head) & q->tab_mask; in choke_len()
97 if (q->head == q->tail) in choke_zap_head_holes()
106 q->tail = (q->tail - 1) & q->tab_mask; in choke_zap_tail_holes()
107 if (q->head == q->tail) in choke_zap_tail_holes()
109 } while (q->tab[q->tail] == NULL); in choke_zap_tail_holes()
123 if (idx == q->tail) in choke_drop_by_idx()
205 if (q->head == q->tail) in choke_match_random()
268 q->tab[q->tail] = skb; in choke_enqueue()
269 q->tail = (q->tail + 1) & q->tab_mask; in choke_enqueue()
[all …]
/linux-6.6.21/drivers/infiniband/hw/vmw_pvrdma/
Dpvrdma_ring.h89 const __u32 tail = atomic_read(&r->prod_tail); in pvrdma_idx_ring_has_space() local
92 if (pvrdma_idx_valid(tail, max_elems) && in pvrdma_idx_ring_has_space()
94 *out_tail = tail & (max_elems - 1); in pvrdma_idx_ring_has_space()
95 return tail != (head ^ max_elems); in pvrdma_idx_ring_has_space()
103 const __u32 tail = atomic_read(&r->prod_tail); in pvrdma_idx_ring_has_data() local
106 if (pvrdma_idx_valid(tail, max_elems) && in pvrdma_idx_ring_has_data()
109 return tail != head; in pvrdma_idx_ring_has_data()
/linux-6.6.21/net/rxrpc/
Dcall_accept.c46 unsigned int head, tail, call_head, call_tail; in rxrpc_service_prealloc_one() local
70 tail = READ_ONCE(b->peer_backlog_tail); in rxrpc_service_prealloc_one()
71 if (CIRC_CNT(head, tail, size) < max) { in rxrpc_service_prealloc_one()
83 tail = READ_ONCE(b->conn_backlog_tail); in rxrpc_service_prealloc_one()
84 if (CIRC_CNT(head, tail, size) < max) { in rxrpc_service_prealloc_one()
182 unsigned int size = RXRPC_BACKLOG_MAX, head, tail; in rxrpc_discard_prealloc() local
195 tail = b->peer_backlog_tail; in rxrpc_discard_prealloc()
196 while (CIRC_CNT(head, tail, size) > 0) { in rxrpc_discard_prealloc()
197 struct rxrpc_peer *peer = b->peer_backlog[tail]; in rxrpc_discard_prealloc()
200 tail = (tail + 1) & (size - 1); in rxrpc_discard_prealloc()
[all …]

12345678910>>...36