Re: [PATCH] Get 7% more pages in a pagevec

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue 05-12-17 18:25:21, Matthew Wilcox wrote:
[...]
> From: Matthew Wilcox <mawilcox@xxxxxxxxxxxxx>
> 
> We don't have to use an entire 'long' for the number of elements in the
> pagevec; we know it's a number between 0 and 14 (now 15).  So we can
> store it in a char, and then the bool packs next to it and we still have
> two or six bytes of padding for more elements in the header.  That gives
> us space to cram in an extra page.
> 
> Signed-off-by: Matthew Wilcox <mawilcox@xxxxxxxxxxxxx>
> 
> diff --git a/include/linux/pagevec.h b/include/linux/pagevec.h
> index 5fb6580f7f23..6dc456ac6136 100644
> --- a/include/linux/pagevec.h
> +++ b/include/linux/pagevec.h
> @@ -9,14 +9,14 @@
>  #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 + header align the pagevec structure to a power of two */
> +#define PAGEVEC_SIZE	15

And now you have ruined the ultimate constant of the whole MM :p
But seriously, I have completely missed that pagevec has such a bad
layout.

>  struct page;
>  struct address_space;
>  
>  struct pagevec {
> -	unsigned long nr;
> +	unsigned char nr;
>  	bool percpu_pvec_drained;
>  	struct page *pages[PAGEVEC_SIZE];
>  };

Anyway the change looks good to me.

Acked-by: Michal Hocko <mhocko@xxxxxxxx>
-- 
Michal Hocko
SUSE Labs

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]
  Powered by Linux