public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Lai Jiangshan <laijs@cn.fujitsu.com>
Cc: Steven Rostedt <rostedt@goodmis.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] ring_bufer: fix BUF_PAGE_SIZE
Date: Thu, 18 Dec 2008 13:48:03 +0100	[thread overview]
Message-ID: <20081218124803.GA31763@elte.hu> (raw)
In-Reply-To: <4948CADF.6050205@cn.fujitsu.com>


* Lai Jiangshan <laijs@cn.fujitsu.com> wrote:

> 
> impact: make BUF_PAGE_SIZE changeable.
> 
> Except allocating/freeing page and the code using PAGE_MASK,
> all code expect buffer_page's length is BUF_PAGE_SIZE.
> 
> This patch make this behavior more concordant.
> 
> Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
> ---
> diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
> index 668bbb5..0cf6caf 100644
> --- a/kernel/trace/ring_buffer.c
> +++ b/kernel/trace/ring_buffer.c
> @@ -158,6 +158,10 @@ struct buffer_page {
>  	void *page;			/* Actual data page */
>  };
>  
> +#define BUF_PAGE_ORDER 0
> +#define BUF_PAGE_SIZE (PAGE_SIZE << BUF_PAGE_ORDER)
> +#define BUF_PAGE_MASK (~(BUF_PAGE_SIZE - 1))
> +
>  /*
>   * Also stolen from mm/slob.c. Thanks to Mathieu Desnoyers for pointing
>   * this issue out.
> @@ -165,7 +169,7 @@ struct buffer_page {
>  static inline void free_buffer_page(struct buffer_page *bpage)
>  {
>  	if (bpage->page)
> -		free_page((unsigned long)bpage->page);
> +		free_pages((unsigned long)bpage->page, BUF_PAGE_ORDER);

hm, why? Non-order-0 allocations are pretty evil - why would we ever want 
to do them?

	Ingo

  reply	other threads:[~2008-12-18 12:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-17  9:48 [PATCH] ring_bufer: fix BUF_PAGE_SIZE Lai Jiangshan
2008-12-18 12:48 ` Ingo Molnar [this message]
2008-12-20  9:31   ` Lai Jiangshan
2008-12-21  8:55     ` Ingo Molnar
2008-12-22 18:37       ` Steven Rostedt
2008-12-22 17:57     ` 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=20081218124803.GA31763@elte.hu \
    --to=mingo@elte.hu \
    --cc=laijs@cn.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox