lkml.org 
[lkml]   [2008]   [Sep]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v10 Golden] Unified trace buffer

On Tue, 30 Sep 2008, Peter Zijlstra wrote:
>
> The problem with storing the page link information inside the page is
> that it doesnt transfer to another address space, so if you do indeed
> mmap these pages, then the link information is bogus.
>
> Of course, in such a situation you could ignore these headers, but
> somehow that doesn't sound too apealing.


No that's not what I'm proposing. I'm proposing to allocate a page_header
structure for every page we alloc, and make a link list of them.
In other words:


struct ring_buffer_per_cpu {
[...]
struct list_head pages;
[...]
};

struct buffer_page {
[...];
void *page;
struct list_head list;
[...];
};

In ring_buffer_allocate_cpu:

struct buffer_page *bpage;
struct unsigned long addr;

[...]

for every page() {
bpage = kzalloc(sizeof(*bpage), GFP_KERNEL);
addr = get_free_page();
bpage->page = (void *)addr;
list_add(&bpage->list, &cpu_buffer->pages);
}


Obviously need to add the error checking, but you get the idea. Here I do
not need to change any of the later logic, because we are still dealing
with the buffer_page. I only need to update way to index the page which is
already encapsulated in its own function.

-- Steve




\
 
 \ /
  Last update: 2008-09-30 19:59    [W:0.211 / U:0.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site