ksummit.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [Ksummit-discuss] [TECH TOPIC] Consistent terminology for ring buffers
@ 2019-06-14 14:21 David Howells
  2019-06-17 13:45 ` Theodore Ts'o
  0 siblings, 1 reply; 2+ messages in thread
From: David Howells @ 2019-06-14 14:21 UTC (permalink / raw)
  To: ksummit-discuss; +Cc: peterz, paulmck, linux

Hi,

Can we settle on consistent terminology for ring buffers with regard to what
we call the producer index and the consumer index?

In linux/circ_buf.h and Documentation/core-api/circular-buffers.rst and
various other places "head" is the index at which insertion occurs and "tail"
is the index of the next object to be consumed.

However, we have other places, notably the new io_uring stuff, in which this
is reversed...

Looking online, I think head-as-insertion is more common, but I can find
references to head-as-consumption.

Should we settle on one of the following for internal kernel use, at least
inside the core documentation (not much we can do about UAPI necessarily):

	PRODUCER	CONSUMER
	===============	===============
	head		tail
	tail		head
	in		out
	insert		remove
	produce		consume

To quote Russell: "head is where the food goes in, the tail is where the ..."

David

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-06-17 13:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-14 14:21 [Ksummit-discuss] [TECH TOPIC] Consistent terminology for ring buffers David Howells
2019-06-17 13:45 ` Theodore Ts'o

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox