lkml.org 
[lkml]   [2006]   [Dec]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch] add an iterator index in struct pagevec
On Mon, 4 Dec 2006 21:21:31 -0800
"Chen, Kenneth W" <kenneth.w.chen@intel.com> wrote:

> pagevec is never expected to be more than PAGEVEC_SIZE, I think a
> unsigned char is enough to count them. This patch makes nr, cold
> to be unsigned char

Is that on the right side of the speed/space tradeoff?

> and also adds an iterator index. With that,
> the size can be even bumped up by 1 to 15.
>
> Signed-off-by: Ken Chen <kenneth.w.chen@intel.com>
>
>
> diff -Nurp linux-2.6.19/include/linux/pagevec.h linux-2.6.19.ken/include/linux/pagevec.h
> --- linux-2.6.19/include/linux/pagevec.h 2006-11-29 13:57:37.000000000 -0800
> +++ linux-2.6.19.ken/include/linux/pagevec.h 2006-12-04 19:18:21.000000000 -0800
> @@ -8,15 +8,16 @@
> #ifndef _LINUX_PAGEVEC_H
> #define _LINUX_PAGEVEC_H
>
> -/* 14 pointers + two long's align the pagevec structure to a power of two */
> -#define PAGEVEC_SIZE 14
> +/* 15 pointers + 3 char's align the pagevec structure to a power of two */
> +#define PAGEVEC_SIZE 15
>
> struct page;
> struct address_space;
>
> struct pagevec {
> - unsigned long nr;
> - unsigned long cold;
> + unsigned char nr;
> + unsigned char cold;
> + unsigned char idx;
> struct page *pages[PAGEVEC_SIZE];
> };
>

I'd have thought that pagevec_init() would want to be involved in this, no?

I must say I'm a bit skeptical about the need for this. But I haven't
looked closely at the blockdev-specific dio code yet.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-12-05 06:49    [W:0.032 / U:0.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site