lkml.org 
[lkml]   [2009]   [Jun]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/3] ring-buffer: make the buffer a true circular link list
Steven Rostedt wrote:
> On Thu, 11 Jun 2009, Lai Jiangshan wrote:
>
>>> - list_splice(&pages, head);
>>> + /*
>>> + * The ring buffer page list is a circular list that does not
>>> + * start and end with a list head. All page list items point to
>>> + * other pages. Remove one of the pages, init its list head,
>>> + * and use list splice to move the rest of the pages to it.
>>> + */
>>> + bpage = list_entry(pages.next, struct buffer_page, list);
>>> + list_del_init(&bpage->list);
>>> + cpu_buffer->pages = &bpage->list;
>>> +
>>> + list_splice(&pages, cpu_buffer->pages);
>>> +
>> Is it proper?
>>
>> cpu_buffer->pages = pages.next;
>> list_del(&pages);
>>
>
> Not sure what you are asking here?
>


I'm not sure whether these 4 lines:
bpage = list_entry(pages.next, struct buffer_page, list);
list_del_init(&bpage->list);
cpu_buffer->pages = &bpage->list;

list_splice(&pages, cpu_buffer->pages);
equal to these 2 lines:
cpu_buffer->pages = pages.next;
list_del(&pages);

If there are equivalent, I think the second one
are simpler. It may be not a really necessarily cleanup.

What I asked is: if there are equivalent, could you use these two line:
cpu_buffer->pages = pages.next;
list_del(&pages);

Lai.



\
 
 \ /
  Last update: 2009-06-11 05:27    [W:0.240 / U:0.528 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site