All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: linux-kernel@vger.kernel.org, mingo@elte.hu, fweisbec@gmail.com,
	srostedt@redhat.com, Rusty Russell <rusty@rustcorp.com.au>
Subject: Re: [PATCH 3/5] ring-buffer: read page interface
Date: Tue, 2 Dec 2008 13:36:54 -0800	[thread overview]
Message-ID: <20081202133654.2dfa51cd.akpm@linux-foundation.org> (raw)
In-Reply-To: <20081202203425.040910271@goodmis.org>

On Tue, 02 Dec 2008 15:34:07 -0500
Steven Rostedt <rostedt@goodmis.org> wrote:

> From: Steven Rostedt <srostedt@redhat.com>
> 
> Impact: new API to ring buffer
> 
> This patch adds a new interface into the ring buffer that allows a
> page to be read from the ring buffer on a given CPU. For every page
> read, one must also be given to allow for a "swap" of the pages.
> 
>  rpage = ring_buffer_alloc_read_page(buffer);
>  if (!rpage)
> 	goto err;
>  ret = ring_buffer_read_page(buffer, &rpage, cpu, full);
>  if (!ret)
> 	goto empty;
>  process_page(rpage);
>  ring_buffer_free_read_page(rpage);
> 
> The caller of these functions must handle any waits that are
> needed to wait for new data. The ring_buffer_read_page will simply
> return 0 if there is no data, or if "full" is set and the writer
> is still on the current page.
> 
>  ...
>
> +static inline void *
> +__rb_data_page_index(struct buffer_data_page *page, unsigned index)
> +{
> +	return page->data + index;
> +}

Many kernel developers will fall over stunned and confused when they
see a variable called `page' which does not have type `struct page *'. 
This is a very strong kernel convention and this code tromps all over
it :(

How's about renaming all of these everywhere to `bpage' or whatever?

>
> ...
>
> +	if (!local_read(&cpu_buffer->reader_page->page->commit))
>

Rusty (I think it was Rusty) has convincingly argued that local_t is
irredeemably busted.  I forget the details?


  reply	other threads:[~2008-12-02 21:39 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-02 20:34 [PATCH 0/5] ftrace updates for tip Steven Rostedt
2008-12-02 20:34 ` [PATCH 1/5] ftrace: replace raw_local_irq_save with local_irq_save Steven Rostedt
2008-12-03  9:21   ` Wang Liming
2008-12-02 20:34 ` [PATCH 2/5] ring-buffer: move some metadata into buffer page Steven Rostedt
2008-12-02 20:34 ` [PATCH 3/5] ring-buffer: read page interface Steven Rostedt
2008-12-02 21:36   ` Andrew Morton [this message]
2008-12-02 22:25     ` Steven Rostedt
2008-12-02 23:09     ` Rusty Russell
2008-12-02 20:34 ` [PATCH 4/5] ftrace: clean up function graph asm Steven Rostedt
2008-12-02 21:24   ` Frédéric Weisbecker
2008-12-02 20:34 ` [PATCH 5/5] ftrace: have function graph use mcount caller address Steven Rostedt
2008-12-03  7:57 ` [PATCH 0/5] ftrace updates for tip Ingo Molnar

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=20081202133654.2dfa51cd.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rostedt@goodmis.org \
    --cc=rusty@rustcorp.com.au \
    --cc=srostedt@redhat.com \
    /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.