* [PATCH] shmem: Fix link error if huge pages support is disabled
@ 2016-08-03 17:58 Geert Uytterhoeven
2016-08-03 19:04 ` Kirill A. Shutemov
0 siblings, 1 reply; 2+ messages in thread
From: Geert Uytterhoeven @ 2016-08-03 17:58 UTC (permalink / raw)
To: Kirill A. Shutemov, Andrew Morton, Linus Torvalds, Hugh Dickins
Cc: linux-mm, linux-kernel, Geert Uytterhoeven
If CONFIG_TRANSPARENT_HUGE_PAGECACHE=n, HPAGE_PMD_NR evaluates to
BUILD_BUG_ON(), and may cause (e.g. with gcc 4.12):
mm/built-in.o: In function `shmem_alloc_hugepage':
shmem.c:(.text+0x17570): undefined reference to `__compiletime_assert_1365'
To fix this, move the assignment to hindex after the check for huge
pages support.
Fixes: 800d8c63b2e989c2 ("shmem: add huge pages support")
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
mm/shmem.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/mm/shmem.c b/mm/shmem.c
index 2ac19a61d5655b82..7f7748a0f9e1f738 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -1362,13 +1362,14 @@ static struct page *shmem_alloc_hugepage(gfp_t gfp,
struct vm_area_struct pvma;
struct inode *inode = &info->vfs_inode;
struct address_space *mapping = inode->i_mapping;
- pgoff_t idx, hindex = round_down(index, HPAGE_PMD_NR);
+ pgoff_t idx, hindex;
void __rcu **results;
struct page *page;
if (!IS_ENABLED(CONFIG_TRANSPARENT_HUGE_PAGECACHE))
return NULL;
+ hindex = round_down(index, HPAGE_PMD_NR);
rcu_read_lock();
if (radix_tree_gang_lookup_slot(&mapping->page_tree, &results, &idx,
hindex, 1) && idx < hindex + HPAGE_PMD_NR) {
--
1.9.1
--
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>
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] shmem: Fix link error if huge pages support is disabled
2016-08-03 17:58 [PATCH] shmem: Fix link error if huge pages support is disabled Geert Uytterhoeven
@ 2016-08-03 19:04 ` Kirill A. Shutemov
0 siblings, 0 replies; 2+ messages in thread
From: Kirill A. Shutemov @ 2016-08-03 19:04 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Kirill A. Shutemov, Andrew Morton, Linus Torvalds, Hugh Dickins,
linux-mm, linux-kernel
On Wed, Aug 03, 2016 at 07:58:19PM +0200, Geert Uytterhoeven wrote:
> If CONFIG_TRANSPARENT_HUGE_PAGECACHE=n, HPAGE_PMD_NR evaluates to
> BUILD_BUG_ON(), and may cause (e.g. with gcc 4.12):
>
> mm/built-in.o: In function `shmem_alloc_hugepage':
> shmem.c:(.text+0x17570): undefined reference to `__compiletime_assert_1365'
>
> To fix this, move the assignment to hindex after the check for huge
> pages support.
>
> Fixes: 800d8c63b2e989c2 ("shmem: add huge pages support")
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
--
Kirill A. Shutemov
--
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>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-08-03 19:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-03 17:58 [PATCH] shmem: Fix link error if huge pages support is disabled Geert Uytterhoeven
2016-08-03 19:04 ` Kirill A. Shutemov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).