public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Li Zefan <lizf@cn.fujitsu.com>
To: David Rientjes <rientjes@google.com>
Cc: Dave Hansen <dave@linux.vnet.ibm.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [patch 3/4 -mm] flex_array: poison free elements
Date: Wed, 09 Sep 2009 11:31:01 +0800	[thread overview]
Message-ID: <4AA72175.5000108@cn.fujitsu.com> (raw)
In-Reply-To: <alpine.DEB.1.00.0909081959030.5084@chino.kir.corp.google.com>

David Rientjes wrote:
> On Wed, 9 Sep 2009, Li Zefan wrote:
> 
>>> I'm struggling to find other examples.  Dave, do you know of any 
>>> subsystems in the kernel that can readily be converted to using flex 
>>> array?
>> Actually I'm planing to try to convert to use flex array in
>> kernel/trace/ftrace.c, and it needs some change in flex array,
>> and I'll have to check if it will have a performance effect
>> or not.
>>
> 
> That's cool, but it looks like none of those allocations currently would 
> ever exceed PAGE_SIZE.  The return stack for each task would be a flex 
> array of 50 elements, each element being 40 bytes for a maximum array 
> size of 2KB.  The tasklist would allocate a flex array of pointers to 
> struct ftrace_ret_stack with a maximum of 32 elements.  On x86_64, that 
> has a maximum size of 256 bytes.
> 
> So while you would be converting existing kernel code to use the new 
> interface, which is great, it doesn't have any advantage over the existing 
> implementation.  I was looking for a current use-case that would otherwise 
> use vmalloc because the entire array could not fit into a single page.
> 

I was not talking about ftrace_ret_stack, I was talking about
struct ftrace_page and struct ftrace_profile_page. ;)

Each page holds an array of records, and there is a list linking
those pages. The total nr of elements can be the nr of functions
in kernel.

I think flex array can be used here to remove duplicate
implementation.


  reply	other threads:[~2009-09-09  3:32 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-21 23:21 [patch 1/4 -mm] flex_array: convert element_nr formals to unsigned David Rientjes
2009-08-21 23:21 ` [patch 2/4 -mm] flex_array: add flex_array_clear function David Rientjes
2009-08-24 15:41   ` Dave Hansen
2009-08-24 20:29     ` David Rientjes
2009-08-24 20:38       ` Dave Hansen
2009-08-24 20:50         ` David Rientjes
2009-08-24 21:28           ` Dave Hansen
2009-08-24 22:32             ` David Rientjes
2009-08-21 23:21 ` [patch 3/4 -mm] flex_array: poison free elements David Rientjes
2009-08-24 15:56   ` Dave Hansen
2009-08-24 20:41     ` David Rientjes
2009-08-24 21:16       ` Dave Hansen
2009-08-24 22:40         ` David Rientjes
2009-08-24 21:42       ` Dave Hansen
2009-08-24 22:44         ` David Rientjes
2009-09-08 22:26           ` David Rientjes
2009-09-09  2:05             ` Li Zefan
2009-09-09  3:18               ` David Rientjes
2009-09-09  3:31                 ` Li Zefan [this message]
2009-09-09  3:41                   ` David Rientjes
2009-09-09  3:45                     ` Li Zefan
2009-09-09  4:15                       ` David Rientjes
2009-09-09 15:28             ` Dave Hansen
2009-09-09 19:18               ` David Rientjes
2009-09-09 19:22                 ` Dave Hansen
2009-09-09 19:34                   ` David Rientjes
2009-08-21 23:21 ` [patch 4/4 -mm] flex_array: add flex_array_shrink function David Rientjes
2009-08-21 23:49   ` Andrew Morton
2009-08-22  0:02     ` Randy Dunlap
2009-08-22 21:28     ` David Rientjes

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=4AA72175.5000108@cn.fujitsu.com \
    --to=lizf@cn.fujitsu.com \
    --cc=akpm@linux-foundation.org \
    --cc=dave@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rientjes@google.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox