Ksummit-Discuss Archive mirror
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: ksummit-discuss@lists.linuxfoundation.org
Cc: peterz@infradead.org, paulmck@linux.ibm.com, linux@armlinux.org.uk
Subject: [Ksummit-discuss] [TECH TOPIC] Consistent terminology for ring buffers
Date: Fri, 14 Jun 2019 15:21:19 +0100	[thread overview]
Message-ID: <20265.1560522079@warthog.procyon.org.uk> (raw)

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

             reply	other threads:[~2019-06-14 14:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-14 14:21 David Howells [this message]
2019-06-17 13:45 ` [Ksummit-discuss] [TECH TOPIC] Consistent terminology for ring buffers Theodore Ts'o

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20265.1560522079@warthog.procyon.org.uk \
    --to=dhowells@redhat.com \
    --cc=ksummit-discuss@lists.linuxfoundation.org \
    --cc=linux@armlinux.org.uk \
    --cc=paulmck@linux.ibm.com \
    --cc=peterz@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).