All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@kernel.org>
To: Matthew Wilcox <willy@infradead.org>
Cc: linux-mm@kvack.org
Subject: Re: [PATCH] Get 7% more pages in a pagevec
Date: Wed, 6 Dec 2017 13:38:42 +0100	[thread overview]
Message-ID: <20171206123842.GB7515@dhcp22.suse.cz> (raw)
In-Reply-To: <20171206022521.GM26021@bombadil.infradead.org>

On Tue 05-12-17 18:25:21, Matthew Wilcox wrote:
[...]
> From: Matthew Wilcox <mawilcox@microsoft.com>
> 
> 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@microsoft.com>
> 
> 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@suse.com>
-- 
Michal Hocko
SUSE Labs

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

  reply	other threads:[~2017-12-06 12:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-06  2:25 [PATCH] Get 7% more pages in a pagevec Matthew Wilcox
2017-12-06 12:38 ` Michal Hocko [this message]
2017-12-06 14:15   ` Matthew Wilcox
2017-12-06 14:23     ` Michal Hocko

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=20171206123842.GB7515@dhcp22.suse.cz \
    --to=mhocko@kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=willy@infradead.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 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.