Skip to contentSkip to conversation

xfs_io: make MADV_SOFT_OFFLINE conditional

PATCH Superseded Bastian Germann 2 participants 3 messages May 22, 2024 – May 25, 2024

Subsystems (2)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 xfs_io: make MADV_SOFT_OFFLINE conditional

mips64el does not have the symbol MADV_SOFT_OFFLINE, so wrap it in an ifdef.

---
 io/madvise.c | 4 ++++
 1 file changed, 4 insertions(+)
io/madvise.c +4 -0
index ede23395..644c85e0 100644
@@ -40,7 +40,9 @@ madvise_help(void)
 " -H -- enable transparent hugepages (MADV_HUGEPAGE)\n"
 " -m -- mark the range mergeable (MADV_MERGEABLE)\n"
 " -M -- mark the range unmergeable (MADV_UNMERGEABLE)\n"
+#ifdef MADV_SOFT_OFFLINE
 " -o -- mark the range offline (MADV_SOFT_OFFLINE)\n"
+#endif
 " -p -- punch a hole in the file (MADV_REMOVE)\n"
 " -P -- poison the page cache (MADV_HWPOISON)\n"
 #ifdef MADV_POPULATE_READ
@@ -101,9 +103,11 @@ madvise_f(
 		case 'M':	/* disable merging */
 			advise = MADV_UNMERGEABLE;
 			break;
+#ifdef MADV_SOFT_OFFLINE
 		case 'o':	/* offline */
 			advise = MADV_SOFT_OFFLINE;
 			break;
+#endif
 		case 'p':	/* punch hole */
 			advise = MADV_REMOVE;
 			break;
Signature · 1 line
2.45.0
#1 lore raw
Quoted 1 line

+#ifdef MADV_SOFT_OFFLINE

Can you add a comment here that this is missing on mips as of Linux 6.9?

Also adding the mips maintainer so he can add it, as missing a madvise random feature on a random architecture looks like a bug that should be fixed.

#2 lore raw

Am 24.05.24 um 10:18 schrieb Christoph Hellwig:

Quoted 4 lines
Quoted 1 line

+#ifdef MADV_SOFT_OFFLINE

Can you add a comment here that this is missing on mips as of Linux 6.9?

Sure.

Quoted 3 lines

Also adding the mips maintainer so he can add it, as missing a madvise random feature on a random architecture looks like a bug that should be fixed.

There are more of this class of bugs which f82b77462b ("tools include:
Add mman macros needed by perf for all arch") presents.