Skip to contentSkip to conversation

mm: update the description for madvise_remove

PATCH In review Wang Sheng-Hui 3 participants 5 messages Jun 24, 2014 – Jun 25, 2014

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mm: update the description for madvise_remove

Currently, we have more filesystems supporting fallocate, e.g ext4/btrfs. Remove the outdated comment for madvise_remove.

---
 mm/madvise.c | 3 ---
 1 file changed, 3 deletions(-)
mm/madvise.c +0 -3
index a402f8f..0938b30 100644
@@ -292,9 +292,6 @@ static long madvise_dontneed(struct vm_area_struct *vma,
 /*
  * Application wants to free up the pages and associated backing store.
  * This is effectively punching a hole into the middle of a file.
- *
- * NOTE: Currently, only shmfs/tmpfs is supported for this operation.
- * Other filesystems return -ENOSYS.
  */
 static long madvise_remove(struct vm_area_struct *vma,
                                struct vm_area_struct **prev,
Signature · 7 lines
1.8.3.2

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Wang Sheng-Hui

Currently, we have more filesystems supporting fallocate, e.g ext4/btrfs. Remove the outdated comment for madvise_remove.

Looks good to me.

Quoted 27 lines
---
 mm/madvise.c | 3 ---
 1 file changed, 3 deletions(-)
mm/madvise.c +0 -3
index a402f8f..0938b30 100644
@@ -292,9 +292,6 @@ static long madvise_dontneed(struct vm_area_struct *vma,
 /*
  * Application wants to free up the pages and associated backing store.
  * This is effectively punching a hole into the middle of a file.
- *
- * NOTE: Currently, only shmfs/tmpfs is supported for this operation.
- * Other filesystems return -ENOSYS.
  */
 static long madvise_remove(struct vm_area_struct *vma,
                                struct vm_area_struct **prev,
Signature · 7 lines
1.8.3.2

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

#2 lore raw
In reply to Wang Sheng-Hui
Quoted 14 lines · Wang Sheng-Hui

Currently, we have more filesystems supporting fallocate, e.g ext4/btrfs. Remove the outdated comment for madvise_remove.

---
 mm/madvise.c | 3 ---
 1 file changed, 3 deletions(-)
mm/madvise.c +0 -0
index a402f8f..0938b30 100644

mm/madvise.c static long madvise_dontneed(struct vm_area_struct *vma, · line 297

Quoted 9 lines
mm/madvise.c +0 -3
@@ -292,9 +292,6 @@ static long madvise_dontneed(struct vm_area_struct *vma,
 /*
  * Application wants to free up the pages and associated backing store.
  * This is effectively punching a hole into the middle of a file.
- *
- * NOTE: Currently, only shmfs/tmpfs is supported for this operation.
- * Other filesystems return -ENOSYS.
  */
 static long madvise_remove(struct vm_area_struct *vma,
                                struct vm_area_struct **prev,

[For those without context: this patch has been merged into the -mm tree.]

This reference also exists in the man-page for madvise(2), are you planning on removing it as well?

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

#3 lore raw

Patch to man-page.

[PATCH] madvise.2: update the description for MADV_REMOVE

Currently we have more filesystems supporting fallcate, e.g ext4/btrfs, which can response to MADV_REMOVE gracefully.

And if filesystems don't support fallocate, the return error would be EOPNOTSUPP, instead of ENOSYS.

---
 man2/madvise.2 | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)
man2/madvise.2 +3 -7
index 032ead7..4ce869c 100644
@@ -99,13 +99,9 @@ or zero-fill-on-demand pages for mappings
 without an underlying file.
 .TP
 .BR MADV_REMOVE " (since Linux 2.6.16)"
-Free up a given range of pages
-and its associated backing store.
-Currently,
-.\" 2.6.18-rc5
-only shmfs/tmpfs supports this; other filesystems return with the
-error
-.BR ENOSYS .
+Free up a given range of pages and its associated backing store.
+Filesystems that don't support fallocate will return error
+.BR EOPNOTSUPP.
 .\" Databases want to use this feature to drop a section of their
 .\" bufferpool (shared memory segments) - without writing back to
 .\" disk/swap space.  This feature is also useful for supporting
Signature · 1 line
1.8.3.2
Quoted 31 lines · David Rientjes
Quoted 14 lines · Wang Sheng-Hui

Currently, we have more filesystems supporting fallocate, e.g ext4/btrfs. Remove the outdated comment for madvise_remove.

---
 mm/madvise.c | 3 ---
 1 file changed, 3 deletions(-)
mm/madvise.c +0 -0
index a402f8f..0938b30 100644

mm/madvise.c static long madvise_dontneed(struct vm_area_struct *vma, · line 297

Quoted 9 lines
mm/madvise.c +0 -3
@@ -292,9 +292,6 @@ static long madvise_dontneed(struct vm_area_struct *vma,
 /*
  * Application wants to free up the pages and associated backing store.
  * This is effectively punching a hole into the middle of a file.
- *
- * NOTE: Currently, only shmfs/tmpfs is supported for this operation.
- * Other filesystems return -ENOSYS.
  */
 static long madvise_remove(struct vm_area_struct *vma,
                                struct vm_area_struct **prev,

[For those without context: this patch has been merged into the -mm tree.]

This reference also exists in the man-page for madvise(2), are you planning on removing it as well?

#4 lore raw
Quoted 11 lines · Wang Sheng-Hui

Patch to man-page.

[PATCH] madvise.2: update the description for MADV_REMOVE

Currently we have more filesystems supporting fallcate, e.g ext4/btrfs, which can response to MADV_REMOVE gracefully.

And if filesystems don't support fallocate, the return error would be EOPNOTSUPP, instead of ENOSYS.

Great, thanks! This looks like it can be applied immediately and doesn't require us to wait for any kernel change.

Good catch with the return value.

Quoted 15 lines
---
 man2/madvise.2 | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)
man2/madvise.2 +0 -3
index 032ead7..4ce869c 100644
@@ -99,13 +99,9 @@ or zero-fill-on-demand pages for mappings
 without an underlying file.
 .TP
 .BR MADV_REMOVE " (since Linux 2.6.16)"
-Free up a given range of pages
-and its associated backing store.
-Currently,

man2/madvise.2 or zero-fill-on-demand pages for mappings · line 107

Quoted 10 lines
man2/madvise.2 +3 -4
-.\" 2.6.18-rc5
-only shmfs/tmpfs supports this; other filesystems return with the
-error
-.BR ENOSYS .
+Free up a given range of pages and its associated backing store.
+Filesystems that don't support fallocate will return error
+.BR EOPNOTSUPP.
 .\" Databases want to use this feature to drop a section of their
 .\" bufferpool (shared memory segments) - without writing back to
 .\" disk/swap space.  This feature is also useful for supporting

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>