lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 2 Dec 2008 13:36:54 -0800
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Steven Rostedt <rostedt@...dmis.org>
Cc:	linux-kernel@...r.kernel.org, mingo@...e.hu, fweisbec@...il.com,
	srostedt@...hat.com, Rusty Russell <rusty@...tcorp.com.au>
Subject: Re: [PATCH 3/5] ring-buffer: read page interface

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

> From: Steven Rostedt <srostedt@...hat.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?

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ