Files
linux/mm
Alexander Duyck a7d897774f mm: Use fixed constant in page_frag_alloc instead of size + 1
commit 8644772637 upstream.

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: 2c2ade8174 ("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>
Cc: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-05-15 17:14:44 +09:00
..
2023-05-15 11:34:46 +09:00
2015-09-08 15:35:28 -07:00
2018-04-17 17:58:08 -08:00
2015-11-05 19:34:48 -08:00
2017-08-24 17:12:19 -07:00
2023-05-15 17:11:06 +09:00
2016-03-17 15:09:34 -07:00
2018-04-17 17:58:08 -08:00
2023-05-15 14:47:39 +09:00
2023-05-15 17:11:06 +09:00