Re: [PATCH 1/7] ring-buffer: remove unneeded conditional inrb_reserve_next

From: Ingo Molnar
Date: Thu May 07 2009 - 04:23:42 EST



* Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:

> From: Steven Rostedt <srostedt@xxxxxxxxxx>
>
> The code in __rb_reserve_next checks on page overflow if it is the
> original commiter and then resets the page back to the original
> setting. Although this is fine, and the code is correct, it is
> a bit fragil. Some experimental work I did breaks it easily.

s/fragil/fragile

> The better and more robust solution is to have all commiters that
> overflow the page, simply subtract what they added.
>
> [ Impact: more robust ring buffer account management ]

it's a bit faster too (eliminates two branches) - so a
micro-optimization as well.

Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/