From: John Levon <levon@movementarian.org>
To: Andrew Morton <akpm@osdl.org>
Cc: Philippe Elie <phil.el@wanadoo.fr>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] oprofile per-cpu buffer overrun
Date: Mon, 26 Jan 2004 10:32:37 +0000 [thread overview]
Message-ID: <20040126103237.GA52771@compsoc.man.ac.uk> (raw)
In-Reply-To: <20040125200701.3c7b769a.akpm@osdl.org>
On Sun, Jan 25, 2004 at 08:07:01PM -0800, Andrew Morton wrote:
> When implementing a circular buffer it is better to not constrain the head
> and tail indices - just let them grow and wrap without bound. You only need
> to bring them in-bounds when you actually use them to index the buffer.
I'm not sure why that's better.
> - head-tail is always the amount of used space, no need to futz around
> handling the case where one has wrapped and the other hasn't.
I admit I have a hangover, but it seems to me it would actually be more
complicated to make damn sure that the integer overflow case is
definitely handled properly.
I clearly can't write functioning ring buffers :), so I'd prefer it to
stay as simple as possible.
regards,
john
--
Khendon's Law:
If the same point is made twice by the same person, the thread is over.
next prev parent reply other threads:[~2004-01-26 10:32 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-01-26 2:37 [PATCH] oprofile per-cpu buffer overrun Philippe Elie
2004-01-26 4:07 ` Andrew Morton
2004-01-26 5:56 ` Anton Blanchard
2004-01-26 10:32 ` John Levon [this message]
2004-01-26 11:07 ` Nick Piggin
2004-01-26 15:52 ` Philippe Elie
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=20040126103237.GA52771@compsoc.man.ac.uk \
--to=levon@movementarian.org \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=phil.el@wanadoo.fr \
/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