Home
last modified time | relevance | path

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

12345678910>>...27

/linux/tools/lib/
H A Dlist_sort.c16 struct list_head *head, **tail = &head; in merge() local
21 *tail = a; in merge()
22 tail = &a->next; in merge()
25 *tail = b; in merge()
29 *tail = b; in merge()
30 tail = &b->next; in merge()
33 *tail = a; in merge()
52 struct list_head *tail = head; in merge_final() local
57 tail->next = a; in merge_final()
58 a->prev = tail; in merge_final()
[all …]
/linux/Documentation/translations/zh_CN/core-api/
H A 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/drivers/net/ethernet/intel/fm10k/
H A 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/drivers/rpmsg/
H A 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/include/linux/
H A 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/arch/arm/kernel/
H A 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/drivers/net/wireguard/
H A 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/drivers/gpu/drm/i915/gt/
H A Dintel_ring.h25 void intel_ring_reset(struct intel_ring *ring, u32 tail);
90 assert_ring_tail_valid(const struct intel_ring *ring, unsigned int tail) in assert_ring_tail_valid() argument
94 GEM_BUG_ON(!intel_ring_offset_valid(ring, tail)); in assert_ring_tail_valid()
111 GEM_BUG_ON(cacheline(tail) == cacheline(head) && tail < head); in assert_ring_tail_valid()
116 intel_ring_set_tail(struct intel_ring *ring, unsigned int tail) in intel_ring_set_tail() argument
124 assert_ring_tail_valid(ring, tail); in intel_ring_set_tail()
125 ring->tail = tail; in intel_ring_set_tail()
126 return tail; in intel_ring_set_tail()
130 __intel_ring_space(unsigned int head, unsigned int tail, unsigned int size) in __intel_ring_space() argument
138 return (head - tail - CACHELINE_BYTES) & (size - 1); in __intel_ring_space()
/linux/Documentation/trace/
H A 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/net/sunrpc/
H A Dxdr.c152 const struct kvec *tail = xdr->tail; in xdr_buf_to_bvec() local
180 if (tail->iov_len) { in xdr_buf_to_bvec()
183 bvec_set_virt(bvec, tail->iov_base, tail->iov_len); in xdr_buf_to_bvec()
267 if (offset < buf->tail[0].iov_len) { in xdr_buf_to_sg()
269 buf->tail[0].iov_len - offset, len); in xdr_buf_to_sg()
272 sg_set_buf(cur, buf->tail[0].iov_base + offset, in xdr_buf_to_sg()
326 if (offset < buf->tail[0].iov_len) in xdr_buf_sg_nents()
407 struct kvec *tail = xdr->tail; in xdr_inline_pages() local
417 tail->iov_base = buf + offset; in xdr_inline_pages()
418 tail->iov_len = buflen - offset; in xdr_inline_pages()
[all …]
/linux/include/drm/
H A 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
76 tail = (struct spsc_node **)atomic_long_xchg(&queue->tail, (long)&node->next); in spsc_queue_push()
77 WRITE_ONCE(*tail, node); in spsc_queue_push()
87 return tail == &queue->head; in spsc_queue_push()
109 if (atomic_long_cmpxchg(&queue->tail, in spsc_queue_pop()
/linux/tools/testing/selftests/bpf/progs/
H A Dbpf_arena_spin_lock.h
/linux/tools/testing/selftests/bpf/libarena/include/
H A Dbpf_arena_spin_lock.h38 u16 tail; member
42 u16 tail; member
110 u32 tail; in encode_tail() local
112 tail = (cpu + 1) << _Q_TAIL_CPU_OFFSET; in encode_tail()
113 tail |= idx << _Q_TAIL_IDX_OFFSET; /* assume < 4 */ in encode_tail()
115 return tail; in encode_tail()
118 static inline struct arena_mcs_spinlock __arena *decode_tail(u32 tail) in decode_tail() argument
120 u32 cpu = (tail >> _Q_TAIL_CPU_OFFSET) - 1; in decode_tail()
121 u32 idx = (tail & _Q_TAIL_IDX_MASK) >> _Q_TAIL_IDX_OFFSET; in decode_tail()
144 static __always_inline u32 xchg_tail(arena_spinlock_t __arena *lock, u32 tail) in xchg_tail() argument
[all …]
/linux/net/sched/
H A 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()
102 /* Move tail pointer backwards to reuse 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()
177 * Will return NULL if queue is empty (q->head == q->tail)
384 unsigned int oqlen = sch->q.qlen, tail = 0; choke_change() local
[all...]
/linux/drivers/infiniband/hw/vmw_pvrdma/
H A 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/arch/arm64/kernel/
H A Dstacktrace.c516 unwind_user_frame(struct frame_tail __user *tail, void *cookie, in unwind_user_frame() argument
524 if (!access_ok(tail, sizeof(buftail))) in unwind_user_frame()
528 err = __copy_from_user_inatomic(&buftail, tail, sizeof(buftail)); in unwind_user_frame()
543 if (tail >= buftail.fp) in unwind_user_frame()
565 unwind_compat_user_frame(struct compat_frame_tail __user *tail, void *cookie, in unwind_compat_user_frame() argument
572 if (!access_ok(tail, sizeof(buftail))) in unwind_compat_user_frame()
576 err = __copy_from_user_inatomic(&buftail, tail, sizeof(buftail)); in unwind_compat_user_frame()
589 if (tail + 1 >= (struct compat_frame_tail __user *) in unwind_compat_user_frame()
606 struct frame_tail __user *tail; in arch_stack_walk_user() local
608 tail = (struct frame_tail __user *)regs->regs[29]; in arch_stack_walk_user()
[all …]
/linux/net/rxrpc/
H A Dcall_accept.c45 unsigned int head, tail, call_head, call_tail; in rxrpc_service_prealloc_one() local
69 tail = READ_ONCE(b->peer_backlog_tail); in rxrpc_service_prealloc_one()
70 if (CIRC_CNT(head, tail, size) < max) { in rxrpc_service_prealloc_one()
82 tail = READ_ONCE(b->conn_backlog_tail); in rxrpc_service_prealloc_one()
83 if (CIRC_CNT(head, tail, size) < max) { in rxrpc_service_prealloc_one()
183 unsigned int size = RXRPC_BACKLOG_MAX, head, tail; in rxrpc_discard_prealloc() local
196 tail = b->peer_backlog_tail; in rxrpc_discard_prealloc()
197 while (CIRC_CNT(head, tail, size) > 0) { in rxrpc_discard_prealloc()
198 struct rxrpc_peer *peer = b->peer_backlog[tail]; in rxrpc_discard_prealloc()
201 tail in rxrpc_discard_prealloc()
[all...]
/linux/drivers/tty/
H A Dn_tty.c161 static void tty_copy(const struct tty_struct *tty, void *to, size_t tail, in tty_copy() argument
165 size_t size = N_TTY_BUF_SIZE - tail; in tty_copy()
166 void *from = read_buf_addr(ldata, tail); in tty_copy()
560 static int n_tty_process_echo_ops(struct tty_struct *tty, size_t *tail, in n_tty_process_echo_ops() argument
570 if (MASK(ldata->echo_commit) == MASK(*tail + 1)) in n_tty_process_echo_ops()
577 op = echo_buf(ldata, *tail + 1); in n_tty_process_echo_ops()
583 if (MASK(ldata->echo_commit) == MASK(*tail + 2)) in n_tty_process_echo_ops()
586 num_chars = echo_buf(ldata, *tail + 2); in n_tty_process_echo_ops()
608 *tail += 3; in n_tty_process_echo_ops()
613 *tail += 2; in n_tty_process_echo_ops()
[all …]
/linux/drivers/infiniband/sw/rdmavt/
H A 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/fs/
H A 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
254 } else if (pipe_full(head, tail, pipe->max_usage)) { in add_to_pipe()
446 unsigned int tail = pipe->tail; in splice_from_pipe_feed() local
449 while (!pipe_empty(head, tail)) { in splice_from_pipe_feed()
450 struct pipe_buffer *buf = pipe_buf(pipe, tail); in splice_from_pipe_feed()
477 tail++; in splice_from_pipe_feed()
478 pipe->tail = tail; in splice_from_pipe_feed()
493 unsigned int tail = pipe->tail; in eat_empty_buffer() local
[all …]
/linux/include/net/
H A Desp.h15 static inline void esp_output_fill_trailer(u8 *tail, int tfclen, int plen, __u8 proto) in esp_output_fill_trailer() argument
19 memset(tail, 0, tfclen); in esp_output_fill_trailer()
20 tail += tfclen; in esp_output_fill_trailer()
25 tail[i] = i + 1; in esp_output_fill_trailer()
27 tail[plen - 2] = plen - 2; in esp_output_fill_trailer()
28 tail[plen - 1] = proto; in esp_output_fill_trailer()
/linux/fs/netfs/
H A Drolling_buffer.c76 roll->tail = fq; in rolling_buffer_init()
138 if (!roll->tail) in rolling_buffer_bulk_load_from_ra()
139 roll->tail = fq; in rolling_buffer_bulk_load_from_ra()
163 iov_iter_folio_queue(&roll->iter, ITER_DEST, roll->tail, 0, 0, loaded); in rolling_buffer_bulk_load_from_ra()
167 for (fq = roll->tail; fq; fq = fq->next) { in rolling_buffer_bulk_load_from_ra()
175 roll->tail = NULL; in rolling_buffer_bulk_load_from_ra()
211 struct folio_queue *spent = roll->tail, *next = READ_ONCE(spent->next); in rolling_buffer_delete_spent()
217 roll->tail = next; in rolling_buffer_delete_spent()
231 while ((p = roll->tail)) { in rolling_buffer_clear()
232 roll->tail = p->next; in rolling_buffer_clear()
/linux/tools/perf/util/
H A Dblock-range.c201 struct block_range *tail = malloc(sizeof(struct block_range)); in block_range__create() local
202 if (!tail) in block_range__create()
205 *tail = (struct block_range){ in block_range__create()
221 rb_link_right_of_node(&tail->node, &entry->node); in block_range__create()
222 rb_insert_color(&tail->node, &block_ranges.root); in block_range__create()
243 * If @end is in beyond @entry but not inside @next, add tail. in block_range__create()
245 if (end < next->start) { /* add tail: [...e->end][...end] */ in block_range__create()
246 struct block_range *tail; in block_range__create() local
248 tail = malloc(sizeof(struct block_range)); in block_range__create()
249 if (!tail) in block_range__create()
[all...]
/linux/tools/testing/selftests/drivers/net/netdevsim/
H A Dethtool-fec.sh13 configured=$($ETHTOOL --show-fec $NSIM_NETDEV | tail -2 | head -1 | cut -d' ' -f1)
16 s=$($ETHTOOL --show-fec $NSIM_NETDEV | tail -2)
23 s=$($ETHTOOL --show-fec $NSIM_NETDEV | tail -2)
31 s=$($ETHTOOL --show-fec $NSIM_NETDEV | tail -2)
39 s=$($ETHTOOL --show-fec $NSIM_NETDEV | tail -2)
47 s=$($ETHTOOL --show-fec $NSIM_NETDEV | tail -2)
55 s=$($ETHTOOL --show-fec $NSIM_NETDEV | tail -2)
61 s=$($ETHTOOL --show-fec $NSIM_NETDEV | tail -2)
/linux/kernel/rcu/
H A Drcu_segcblist.c22 rclp->tail = &rclp->head; in rcu_cblist_init()
31 *rclp->tail = rhp; in rcu_cblist_enqueue()
32 rclp->tail = &rhp->next; in rcu_cblist_enqueue()
50 drclp->tail = srclp->tail; in rcu_cblist_flush_enqueue()
52 drclp->tail = &drclp->head; in rcu_cblist_flush_enqueue()
59 srclp->tail = &rhp->next; in rcu_cblist_flush_enqueue()
78 rclp->tail = &rclp->head; in rcu_cblist_dequeue()
383 *rclp->tail = rsclp->head; in rcu_segcblist_extract_done_cbs()
386 rclp->tail = rsclp->tails[RCU_DONE_TAIL]; in rcu_segcblist_extract_done_cbs()
408 *rclp->tail = *rsclp->tails[RCU_DONE_TAIL]; in rcu_segcblist_extract_pend_cbs()
[all …]

12345678910>>...27