All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lai Jiangshan <laijs@cn.fujitsu.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: linux-kernel@vger.kernel.org, Ingo Molnar <mingo@elte.hu>,
	Andrew Morton <akpm@linux-foundation.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Peter Zijlstra <peterz@infradead.org>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Theodore Tso <tytso@mit.edu>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Mathieu Desnoyers <compudj@krystal.dyndns.org>,
	"Martin J. Bligh" <mbligh@mbligh.org>,
	Christoph Hellwig <hch@infradead.org>,
	Li Zefan <lizf@cn.fujitsu.com>, Huang Ying <ying.huang@intel.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>,
	Masami Hiramatsu <mhiramat@redhat.com>,
	Steven Rostedt <srostedt@redhat.com>
Subject: Re: [PATCH 1/3] ring-buffer: make the buffer a true circular link list
Date: Thu, 11 Jun 2009 11:25:48 +0800	[thread overview]
Message-ID: <4A30793C.6090208@cn.fujitsu.com> (raw)
In-Reply-To: <alpine.DEB.2.00.0906102200180.30552@gandalf.stny.rr.com>

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.


  reply	other threads:[~2009-06-11  3:24 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-10 19:53 [PATCH 0/3] [GIT PULL][for 2.6.32] lockless ring buffer Steven Rostedt
2009-06-10 19:53 ` [PATCH 1/3] ring-buffer: make the buffer a true circular link list Steven Rostedt
2009-06-11  1:12   ` Lai Jiangshan
2009-06-11  2:00     ` Steven Rostedt
2009-06-11  3:25       ` Lai Jiangshan [this message]
2009-06-11  3:35         ` Steven Rostedt
2009-06-10 19:53 ` [PATCH 2/3] ring-buffer: make lockless Steven Rostedt
2009-06-10 19:53 ` [PATCH 3/3] ring-buffer: add design document Steven Rostedt
2009-06-10 22:13   ` Mathieu Desnoyers
2009-06-11  1:55     ` Steven Rostedt
2009-06-11  3:51       ` Mathieu Desnoyers
2009-06-11  3:59         ` Mathieu Desnoyers
2009-06-11  4:15           ` Steven Rostedt
2009-06-11 18:09             ` Mathieu Desnoyers
2009-06-11  0:51   ` Huang Ying
2009-06-11  0:54     ` H. Peter Anvin
2009-06-11  1:58     ` Steven Rostedt
2009-06-11  2:33       ` Huang Ying
2009-06-11  2:38         ` Mathieu Desnoyers
2009-06-12  3:13           ` Huang Ying
2009-06-12  3:46             ` H. Peter Anvin
2009-06-11  3:15   ` Hidetoshi Seto
2009-06-11  3:25     ` Steven Rostedt
2009-06-13  1:54   ` Frederic Weisbecker
2009-06-13  2:16     ` Steven Rostedt
2009-06-13 22:36       ` Frederic Weisbecker
2009-06-14 12:39         ` Steven Rostedt
2009-06-15  0:05           ` Frederic Weisbecker
2009-06-15  0:56   ` Frederic Weisbecker
  -- strict thread matches above, loose matches on Subject: below --
2009-07-08 20:13 [PATCH 0/3] [GIT PULL] rebase of lockless ring buffer Steven Rostedt
2009-07-08 20:13 ` [PATCH 1/3] ring-buffer: make the buffer a true circular link list Steven Rostedt

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=4A30793C.6090208@cn.fujitsu.com \
    --to=laijs@cn.fujitsu.com \
    --cc=acme@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=compudj@krystal.dyndns.org \
    --cc=fweisbec@gmail.com \
    --cc=hch@infradead.org \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizf@cn.fujitsu.com \
    --cc=mbligh@mbligh.org \
    --cc=mhiramat@redhat.com \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=seto.hidetoshi@jp.fujitsu.com \
    --cc=srostedt@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=tytso@mit.edu \
    --cc=ying.huang@intel.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.