All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3] mm, thp: propagation of conditional compilation in khugepaged.c
@ 2016-11-14 20:34 Jérémy Lefaure
  2016-11-14 20:42 ` Kirill A. Shutemov
  2016-11-15  3:03 ` Hillf Danton
  0 siblings, 2 replies; 3+ messages in thread
From: Jérémy Lefaure @ 2016-11-14 20:34 UTC (permalink / raw)
  To: Andrew Morton, Kirill A. Shutemov; +Cc: linux-mm, Jérémy Lefaure

Commit b46e756f5e47 ("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.

Signed-off-by: JA(C)rA(C)my Lefaure <jeremy.lefaure@lse.epita.fr>
---
Sorry for the typo in v2. Thank you Kirill.
I hope that everything is ok this time.

 mm/khugepaged.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/mm/khugepaged.c b/mm/khugepaged.c
index 728d779..87e1a7ca 100644
--- a/mm/khugepaged.c
+++ b/mm/khugepaged.c
@@ -103,6 +103,7 @@ static struct khugepaged_scan khugepaged_scan = {
 	.mm_head = LIST_HEAD_INIT(khugepaged_scan.mm_head),
 };
 
+#ifdef CONFIG_SYSFS
 static ssize_t scan_sleep_millisecs_show(struct kobject *kobj,
 					 struct kobj_attribute *attr,
 					 char *buf)
@@ -295,6 +296,7 @@ struct attribute_group khugepaged_attr_group = {
 	.attrs = khugepaged_attr,
 	.name = "khugepaged",
 };
+#endif /* CONFIG_SYSFS */
 
 #define VM_NO_KHUGEPAGED (VM_SPECIAL | VM_HUGETLB)
 
-- 
2.10.2

--
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] 3+ messages in thread

* Re: [PATCH v3] mm, thp: propagation of conditional compilation in khugepaged.c
  2016-11-14 20:34 [PATCH v3] mm, thp: propagation of conditional compilation in khugepaged.c Jérémy Lefaure
@ 2016-11-14 20:42 ` Kirill A. Shutemov
  2016-11-15  3:03 ` Hillf Danton
  1 sibling, 0 replies; 3+ messages in thread
From: Kirill A. Shutemov @ 2016-11-14 20:42 UTC (permalink / raw)
  To: Jérémy Lefaure; +Cc: Andrew Morton, Kirill A. Shutemov, linux-mm

On Mon, Nov 14, 2016 at 03:34:48PM -0500, Jeremy Lefaure wrote:
> Commit b46e756f5e47 ("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.
> 
> Signed-off-by: Jeremy Lefaure <jeremy.lefaure@lse.epita.fr>

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] 3+ messages in thread

* Re: [PATCH v3] mm, thp: propagation of conditional compilation in khugepaged.c
  2016-11-14 20:34 [PATCH v3] mm, thp: propagation of conditional compilation in khugepaged.c Jérémy Lefaure
  2016-11-14 20:42 ` Kirill A. Shutemov
@ 2016-11-15  3:03 ` Hillf Danton
  1 sibling, 0 replies; 3+ messages in thread
From: Hillf Danton @ 2016-11-15  3:03 UTC (permalink / raw)
  To: 'Jérémy Lefaure', 'Andrew Morton',
	'Kirill A. Shutemov'
  Cc: linux-mm

> 
> Commit b46e756f5e47 ("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.
> 
> Signed-off-by: Jérémy Lefaure <jeremy.lefaure@lse.epita.fr>

Acked-by: Hillf Danton <hillf.zj@alibaba-inc.com>


--
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] 3+ messages in thread

end of thread, other threads:[~2016-11-15  3:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-14 20:34 [PATCH v3] mm, thp: propagation of conditional compilation in khugepaged.c Jérémy Lefaure
2016-11-14 20:42 ` Kirill A. Shutemov
2016-11-15  3:03 ` Hillf Danton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.