Skip to content

Commit e1465d1

Browse files
Jérémy Lefauretorvalds
authored andcommitted
mm, thp: propagation of conditional compilation in khugepaged.c
Commit b46e756 ("thp: extract khugepaged from mm/huge_memory.c") moved code from huge_memory.c to khugepaged.c. Some of this code should be compiled only when CONFIG_SYSFS is enabled but the condition around this code was not moved into khugepaged.c. The result is a compilation error when CONFIG_SYSFS is disabled: mm/built-in.o: In function `khugepaged_defrag_store': khugepaged.c:(.text+0x2d095): undefined reference to `single_hugepage_flag_store' mm/built-in.o: In function `khugepaged_defrag_show': khugepaged.c:(.text+0x2d0ab): undefined reference to `single_hugepage_flag_show' This commit adds the #ifdef CONFIG_SYSFS around the code related to sysfs. Link: http://lkml.kernel.org/r/20161114203448.24197-1-jeremy.lefaure@lse.epita.fr Signed-off-by: Jérémy Lefaure <jeremy.lefaure@lse.epita.fr> Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Acked-by: Hillf Danton <hillf.zj@alibaba-inc.com> Cc: <stable@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent ded6e84 commit e1465d1

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎mm/khugepaged.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ static struct khugepaged_scan khugepaged_scan = {
103103
.mm_head = LIST_HEAD_INIT(khugepaged_scan.mm_head),
104104
};
105105

106+
#ifdef CONFIG_SYSFS
106107
static ssize_t scan_sleep_millisecs_show(struct kobject *kobj,
107108
struct kobj_attribute *attr,
108109
char *buf)
@@ -295,6 +296,7 @@ struct attribute_group khugepaged_attr_group = {
295296
.attrs = khugepaged_attr,
296297
.name = "khugepaged",
297298
};
299+
#endif /* CONFIG_SYSFS */
298300

299301
#define VM_NO_KHUGEPAGED (VM_SPECIAL | VM_HUGETLB)
300302

0 commit comments

Comments
 (0)