All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nick Piggin <piggin@cyberone.com.au>
To: John Levon <levon@movementarian.org>
Cc: Andrew Morton <akpm@osdl.org>, Philippe Elie <phil.el@wanadoo.fr>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] oprofile per-cpu buffer overrun
Date: Mon, 26 Jan 2004 22:07:58 +1100	[thread overview]
Message-ID: <4014F50E.6020201@cyberone.com.au> (raw)
In-Reply-To: <20040126103237.GA52771@compsoc.man.ac.uk>



John Levon wrote:

>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.
>

You needn't worry about integer overflow - it is handled properly ;)



  reply	other threads:[~2004-01-26 11:10 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
2004-01-26 11:07     ` Nick Piggin [this message]
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=4014F50E.6020201@cyberone.com.au \
    --to=piggin@cyberone.com.au \
    --cc=akpm@osdl.org \
    --cc=levon@movementarian.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 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.