Files
Sumanth Korikkar 66aa8b6920 mm/shmem: inline shmem_is_huge() for disabled transparent hugepages
In order to  minimize code size (CONFIG_CC_OPTIMIZE_FOR_SIZE=y),
compiler might choose to make a regular function call (out-of-line) for
shmem_is_huge() instead of inlining it. When transparent hugepages are
disabled (CONFIG_TRANSPARENT_HUGEPAGE=n), it can cause compilation
error.

mm/shmem.c: In function `shmem_getattr':
./include/linux/huge_mm.h:383:27: note: in expansion of macro `BUILD_BUG'
  383 | #define HPAGE_PMD_SIZE ({ BUILD_BUG(); 0; })
      |                           ^~~~~~~~~
mm/shmem.c:1148:33: note: in expansion of macro `HPAGE_PMD_SIZE'
 1148 |                 stat->blksize = HPAGE_PMD_SIZE;

To prevent the possible error, always inline shmem_is_huge() when
transparent hugepages are disabled.

Link: https://lkml.kernel.org/r/20240409155407.2322714-1-sumanthk@linux.ibm.com
Signed-off-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
Acked-by: David Hildenbrand <david@redhat.com>
Cc: Alexander Gordeev <agordeev@linux.ibm.com>
Cc: Heiko Carstens <hca@linux.ibm.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Ilya Leoshkevich <iii@linux.ibm.com>
Cc: Vasily Gorbik <gor@linux.ibm.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
(cherry picked from commit 1f737846aa3c45f07a06fa0d018b39e1afb8084a)
2025-06-12 19:55:00 +10:00
..
2023-06-16 12:27:04 -06:00
2023-08-23 08:21:37 +01:00
2023-09-11 15:24:16 -07:00
2023-08-09 08:21:22 +02:00
2023-09-19 16:41:26 -07:00
2023-05-31 13:06:57 +02:00
2024-05-13 09:15:20 +09:00
2023-08-24 16:20:30 -07:00
2023-09-01 00:29:34 +02:00
2023-06-13 16:49:23 +02:00
2023-09-13 10:48:48 +02:00
2023-08-04 11:02:46 +01:00
2023-08-05 08:18:04 -04:00
2023-07-14 13:47:07 -06:00
2024-05-13 09:15:20 +09:00
2023-08-18 10:12:10 -07:00
2023-08-15 14:57:25 -07:00
2023-08-18 10:18:59 -07:00
2023-07-11 14:12:19 -07:00
2023-06-20 20:17:10 -07:00
2023-08-18 10:12:25 -07:00
2023-08-21 14:28:45 -07:00
2023-06-23 16:59:30 -07:00
2023-06-05 09:36:39 +02:00
2023-07-18 10:07:47 +02:00
2023-09-29 17:20:46 -07:00
2023-08-12 09:18:47 -07:00
2023-10-06 11:01:23 +02:00
2023-10-06 11:01:23 +02:00
2023-09-02 15:17:33 -07:00
2023-07-15 11:34:49 -07:00
2023-06-23 16:59:28 -07:00
2023-06-11 18:22:47 +02:00
2023-10-10 19:35:54 -07:00
2023-07-18 10:07:47 +02:00
2023-06-05 09:36:39 +02:00
2023-06-24 15:50:13 -07:00
2023-08-21 13:37:26 -07:00
2024-05-13 09:15:20 +09:00
2023-08-06 08:24:55 +01:00
2023-08-07 17:55:54 +00:00
2023-08-11 21:12:47 +02:00
2023-08-24 13:27:47 -05:00
2023-08-21 14:52:16 +02:00
2023-08-21 13:37:27 -07:00