All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rasmus Villemoes <ravi@prevas.dk>
To: Simon Glass <sjg@chromium.org>
Cc: U-Boot Mailing List <u-boot@lists.denx.de>,
	 Alexander Sverdlin <alexander.sverdlin@siemens.com>,
	 Caleb Connolly <caleb.connolly@linaro.org>,
	 Francis Laniel <francis.laniel@amarulasolutions.com>,
	 Heinrich Schuchardt <xypron.glpk@gmx.de>,
	 Ilias Apalodimas <ilias.apalodimas@linaro.org>,
	Ion Agorria <ion@agorria.com>,
	 Jerome Forissier <jerome.forissier@linaro.org>,
	 Marek Vasut <marex@denx.de>,
	 Martyn Welch <martyn.welch@collabora.com>,
	 Mattijs Korpershoek <mkorpershoek@baylibre.com>,
	 Neil Armstrong <neil.armstrong@linaro.org>,
	Patrice Chotard <patrice.chotard@foss.st.com>,
	 Peter Robinson <pbrobinson@gmail.com>,
	 Quentin Schulz <quentin.schulz@cherry.de>,
	Raymond Mao <raymond.mao@linaro.org>,
	 Robert Marko <robert.marko@sartura.hr>,
	 Sam Protsenko <semen.protsenko@linaro.org>,
	Sughosh Ganu <sughosh.ganu@linaro.org>,
	 Sumit Garg <sumit.garg@linaro.org>,
	 Svyatoslav Ryhel <clamor95@gmail.com>,
	 Tom Rini <trini@konsulko.com>
Subject: Re: [PATCH 0/8] membuff: Add tests and update to support a flag for empty/full
Date: Tue, 04 Mar 2025 19:55:32 +0100	[thread overview]
Message-ID: <87pliw62xn.fsf@prevas.dk> (raw)
In-Reply-To: <CAFLszThznjs9Ama40sMtnrdMhThB0TfS4usVSH+yAZw-2Tj0tQ@mail.gmail.com> (Simon Glass's message of "Tue, 4 Mar 2025 08:35:10 -0700")

On Tue, Mar 04 2025, Simon Glass <sjg@chromium.org> wrote:

> Hi Rasmus,
>
> On Fri, 18 Oct 2024 at 08:55, Simon Glass <sjg@chromium.org> wrote:
>>
>> Hi Rasmus,
>>
>> On Fri, 18 Oct 2024 at 01:05, Rasmus Villemoes <ravi@prevas.dk> wrote:
>> >
>> > On tor, okt 17 2024, Simon Glass <sjg@chromium.org> wrote:
>> >
>> > >
>> > >   membuf: Support a flag for being full
>> > >
>> >
>> > No, that is the worst of all worlds, especially with it being a
>> > build-time flag. The right implementation is the one where the head and
>> > tail indices are free-running, where you get such a "flag" for
>> > free, because you're not wasting the top bits of the indices.
>> >
>> > https://www.snellman.net/blog/archive/2016-12-13-ring-buffers/
>>
>> >
>> > If you want to do the churn of renaming anyway, I suggest doing it by
>> > adding an implementation using the proper scheme under the new name,
>> > switch users over, and dropping the old. IMO, this series as-is brings
>> > no value (except for the tests, of course).
>>
>> OK. Do you think this series gets us closer to that, or further away?
>
> I didn't get a response to this (which is not a problem, I miss things
> all the time). Anyway I don't like the power-of-two restriction and
> you can see my other responses above. I've applied this to my tree as
> I want to have the tests in place.

I stand by my earlier comments that this is the wrong way to implement a
circular buffer. I hope Tom doesn't pull this.

Rasmus

  reply	other threads:[~2025-03-04 18:55 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-18  3:00 [PATCH 0/8] membuff: Add tests and update to support a flag for empty/full Simon Glass
2024-10-18  3:00 ` [PATCH 1/8] membuff: Rename functions to have membuf_ prefix Simon Glass
2025-03-04 15:37   ` Simon Glass
2024-10-18  3:00 ` [PATCH 2/8] membuff: Rename the files to membuf Simon Glass
2024-10-18  3:00 ` [PATCH 3/8] membuf: Rename struct Simon Glass
2025-03-04 15:37   ` Simon Glass
2024-10-18  3:00 ` [PATCH 4/8] membuf: Include stdbool Simon Glass
2025-03-04 15:37   ` Simon Glass
2024-10-18  3:00 ` [PATCH 5/8] membuf: Correct implementation of membuf_dispose() Simon Glass
2025-03-04 15:37   ` Simon Glass
2024-10-18  3:00 ` [PATCH 6/8] membuf: Add some tests Simon Glass
2025-03-04 15:37   ` Simon Glass
2024-10-18  3:00 ` [PATCH 7/8] membuf: Minor code-style improvements Simon Glass
2025-03-04 15:36   ` Simon Glass
2024-10-18  3:00 ` [PATCH 8/8] membuf: Support a flag for being full Simon Glass
2025-03-04 15:36   ` Simon Glass
2024-10-18  7:05 ` [PATCH 0/8] membuff: Add tests and update to support a flag for empty/full Rasmus Villemoes
2024-10-18 14:55   ` Simon Glass
2025-03-04 15:35     ` Simon Glass
2025-03-04 18:55       ` Rasmus Villemoes [this message]
2025-03-05 13:53         ` Simon Glass
2025-03-06 14:21           ` Rasmus Villemoes
2025-03-06 16:07             ` Simon Glass

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=87pliw62xn.fsf@prevas.dk \
    --to=ravi@prevas.dk \
    --cc=alexander.sverdlin@siemens.com \
    --cc=caleb.connolly@linaro.org \
    --cc=clamor95@gmail.com \
    --cc=francis.laniel@amarulasolutions.com \
    --cc=ilias.apalodimas@linaro.org \
    --cc=ion@agorria.com \
    --cc=jerome.forissier@linaro.org \
    --cc=marex@denx.de \
    --cc=martyn.welch@collabora.com \
    --cc=mkorpershoek@baylibre.com \
    --cc=neil.armstrong@linaro.org \
    --cc=patrice.chotard@foss.st.com \
    --cc=pbrobinson@gmail.com \
    --cc=quentin.schulz@cherry.de \
    --cc=raymond.mao@linaro.org \
    --cc=robert.marko@sartura.hr \
    --cc=semen.protsenko@linaro.org \
    --cc=sjg@chromium.org \
    --cc=sughosh.ganu@linaro.org \
    --cc=sumit.garg@linaro.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    --cc=xypron.glpk@gmx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.