Repository navigation
Commit 8644772
mm: Use fixed constant in page_frag_alloc instead of size + 1
This patch replaces the size + 1 value introduced with the recent fix for 1
byte allocs with a constant value.
The idea here is to reduce code overhead as the previous logic would have
to read size into a register, then increment it, and write it back to
whatever field was being used. By using a constant we can avoid those
memory reads and arithmetic operations in favor of just encoding the
maximum value into the operation itself.
Fixes: 2c2ade8 ("mm: page_alloc: fix ref bias in page_frag_alloc() for 1-byte allocs")
Signed-off-by: Alexander Duyck <alexander.h.duyck@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>1 parent e09c6a4 commit 8644772
1 file changed
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4675 | 4675 | | |
4676 | 4676 | | |
4677 | 4677 | | |
4678 | | - | |
| 4678 | + | |
4679 | 4679 | | |
4680 | 4680 | | |
4681 | 4681 | | |
4682 | | - | |
| 4682 | + | |
4683 | 4683 | | |
4684 | 4684 | | |
4685 | 4685 | | |
| |||
4695 | 4695 | | |
4696 | 4696 | | |
4697 | 4697 | | |
4698 | | - | |
| 4698 | + | |
4699 | 4699 | | |
4700 | 4700 | | |
4701 | | - | |
| 4701 | + | |
4702 | 4702 | | |
4703 | 4703 | | |
4704 | 4704 | | |
| |||
0 commit comments