Skip to content

Commit 146500e

Browse files
Matthew Wilcoxtorvalds
authored andcommitted
mm: get 7% more pages in a pagevec
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. Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Matthew Wilcox <[email protected]> Acked-by: Michal Hocko <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 977fbdc commit 146500e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

include/linux/pagevec.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
#ifndef _LINUX_PAGEVEC_H
1010
#define _LINUX_PAGEVEC_H
1111

12-
/* 14 pointers + two long's align the pagevec structure to a power of two */
13-
#define PAGEVEC_SIZE 14
12+
/* 15 pointers + header align the pagevec structure to a power of two */
13+
#define PAGEVEC_SIZE 15
1414

1515
struct page;
1616
struct address_space;
1717

1818
struct pagevec {
19-
unsigned long nr;
19+
unsigned char nr;
2020
bool percpu_pvec_drained;
2121
struct page *pages[PAGEVEC_SIZE];
2222
};

0 commit comments

Comments
 (0)