All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fadvise: only initiate writeback for specified range with FADV_DONTNEED
@ 2011-10-31 16:16 ` Shawn Bohrer
  0 siblings, 0 replies; 6+ messages in thread
From: Shawn Bohrer @ 2011-10-31 16:16 UTC (permalink / raw)
  To: linux-mm; +Cc: linux-kernel, Shawn Bohrer

Previously POSIX_FADV_DONTNEED would start writeback for the entire file
when the bdi was not write congested.  This negatively impacts
performance if the file contians dirty pages outside of the requested
range.  This change uses __filemap_fdatawrite_range() to only initiate
writeback for the requested range.

Signed-off-by: Shawn Bohrer <sbohrer@rgmadvisors.com>
---
 mm/fadvise.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/mm/fadvise.c b/mm/fadvise.c
index 8d723c9..469491e 100644
--- a/mm/fadvise.c
+++ b/mm/fadvise.c
@@ -117,7 +117,8 @@ SYSCALL_DEFINE(fadvise64_64)(int fd, loff_t offset, loff_t len, int advice)
 		break;
 	case POSIX_FADV_DONTNEED:
 		if (!bdi_write_congested(mapping->backing_dev_info))
-			filemap_flush(mapping);
+			__filemap_fdatawrite_range(mapping, offset, endbyte,
+						   WB_SYNC_NONE);
 
 		/* First and last FULL page! */
 		start_index = (offset+(PAGE_CACHE_SIZE-1)) >> PAGE_CACHE_SHIFT;
-- 
1.7.6



---------------------------------------------------------------
This email, along with any attachments, is confidential. If you 
believe you received this message in error, please contact the 
sender immediately and delete all copies of the message.  
Thank you.


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH] fadvise: only initiate writeback for specified range with FADV_DONTNEED
@ 2011-10-31 16:16 ` Shawn Bohrer
  0 siblings, 0 replies; 6+ messages in thread
From: Shawn Bohrer @ 2011-10-31 16:16 UTC (permalink / raw)
  To: linux-mm; +Cc: linux-kernel, Shawn Bohrer

Previously POSIX_FADV_DONTNEED would start writeback for the entire file
when the bdi was not write congested.  This negatively impacts
performance if the file contians dirty pages outside of the requested
range.  This change uses __filemap_fdatawrite_range() to only initiate
writeback for the requested range.

Signed-off-by: Shawn Bohrer <sbohrer@rgmadvisors.com>
---
 mm/fadvise.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/mm/fadvise.c b/mm/fadvise.c
index 8d723c9..469491e 100644
--- a/mm/fadvise.c
+++ b/mm/fadvise.c
@@ -117,7 +117,8 @@ SYSCALL_DEFINE(fadvise64_64)(int fd, loff_t offset, loff_t len, int advice)
 		break;
 	case POSIX_FADV_DONTNEED:
 		if (!bdi_write_congested(mapping->backing_dev_info))
-			filemap_flush(mapping);
+			__filemap_fdatawrite_range(mapping, offset, endbyte,
+						   WB_SYNC_NONE);
 
 		/* First and last FULL page! */
 		start_index = (offset+(PAGE_CACHE_SIZE-1)) >> PAGE_CACHE_SHIFT;
-- 
1.7.6



---------------------------------------------------------------
This email, along with any attachments, is confidential. If you 
believe you received this message in error, please contact the 
sender immediately and delete all copies of the message.  
Thank you.

--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] fadvise: only initiate writeback for specified range with FADV_DONTNEED
  2011-10-31 16:16 ` Shawn Bohrer
@ 2011-11-01 15:05   ` Johannes Weiner
  -1 siblings, 0 replies; 6+ messages in thread
From: Johannes Weiner @ 2011-11-01 15:05 UTC (permalink / raw)
  To: Shawn Bohrer; +Cc: linux-mm, linux-kernel

On Mon, Oct 31, 2011 at 11:16:59AM -0500, Shawn Bohrer wrote:
> Previously POSIX_FADV_DONTNEED would start writeback for the entire file
> when the bdi was not write congested.  This negatively impacts
> performance if the file contians dirty pages outside of the requested
> range.  This change uses __filemap_fdatawrite_range() to only initiate
> writeback for the requested range.
> 
> Signed-off-by: Shawn Bohrer <sbohrer@rgmadvisors.com>

It probably makes sense for some cases to take advantage of the disk
head being nearby and flush more than requested.

But I can certainly see this go wrong by taking away the write-caching
benefits for the rest of the file just because a small part of it was
fadvised.

Acked-by: Johannes Weiner <jweiner@redhat.com>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] fadvise: only initiate writeback for specified range with FADV_DONTNEED
@ 2011-11-01 15:05   ` Johannes Weiner
  0 siblings, 0 replies; 6+ messages in thread
From: Johannes Weiner @ 2011-11-01 15:05 UTC (permalink / raw)
  To: Shawn Bohrer; +Cc: linux-mm, linux-kernel

On Mon, Oct 31, 2011 at 11:16:59AM -0500, Shawn Bohrer wrote:
> Previously POSIX_FADV_DONTNEED would start writeback for the entire file
> when the bdi was not write congested.  This negatively impacts
> performance if the file contians dirty pages outside of the requested
> range.  This change uses __filemap_fdatawrite_range() to only initiate
> writeback for the requested range.
> 
> Signed-off-by: Shawn Bohrer <sbohrer@rgmadvisors.com>

It probably makes sense for some cases to take advantage of the disk
head being nearby and flush more than requested.

But I can certainly see this go wrong by taking away the write-caching
benefits for the rest of the file just because a small part of it was
fadvised.

Acked-by: Johannes Weiner <jweiner@redhat.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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH resend] fadvise: only initiate writeback for specified range with FADV_DONTNEED
  2011-11-01 15:05   ` Johannes Weiner
@ 2011-11-22 23:01     ` Shawn Bohrer
  -1 siblings, 0 replies; 6+ messages in thread
From: Shawn Bohrer @ 2011-11-22 23:01 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Johannes Weiner, linux-mm, linux-kernel, Shawn Bohrer

Previously POSIX_FADV_DONTNEED would start writeback for the entire file
when the bdi was not write congested.  This negatively impacts
performance if the file contians dirty pages outside of the requested
range.  This change uses __filemap_fdatawrite_range() to only initiate
writeback for the requested range.

Signed-off-by: Shawn Bohrer <sbohrer@rgmadvisors.com>
---

Andrew is this something you could apply?

 mm/fadvise.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/mm/fadvise.c b/mm/fadvise.c
index 8d723c9..469491e 100644
--- a/mm/fadvise.c
+++ b/mm/fadvise.c
@@ -117,7 +117,8 @@ SYSCALL_DEFINE(fadvise64_64)(int fd, loff_t offset, loff_t len, int advice)
 		break;
 	case POSIX_FADV_DONTNEED:
 		if (!bdi_write_congested(mapping->backing_dev_info))
-			filemap_flush(mapping);
+			__filemap_fdatawrite_range(mapping, offset, endbyte,
+						   WB_SYNC_NONE);
 
 		/* First and last FULL page! */
 		start_index = (offset+(PAGE_CACHE_SIZE-1)) >> PAGE_CACHE_SHIFT;
-- 
1.7.6



---------------------------------------------------------------
This email, along with any attachments, is confidential. If you 
believe you received this message in error, please contact the 
sender immediately and delete all copies of the message.  
Thank you.


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH resend] fadvise: only initiate writeback for specified range with FADV_DONTNEED
@ 2011-11-22 23:01     ` Shawn Bohrer
  0 siblings, 0 replies; 6+ messages in thread
From: Shawn Bohrer @ 2011-11-22 23:01 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Johannes Weiner, linux-mm, linux-kernel, Shawn Bohrer

Previously POSIX_FADV_DONTNEED would start writeback for the entire file
when the bdi was not write congested.  This negatively impacts
performance if the file contians dirty pages outside of the requested
range.  This change uses __filemap_fdatawrite_range() to only initiate
writeback for the requested range.

Signed-off-by: Shawn Bohrer <sbohrer@rgmadvisors.com>
---

Andrew is this something you could apply?

 mm/fadvise.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/mm/fadvise.c b/mm/fadvise.c
index 8d723c9..469491e 100644
--- a/mm/fadvise.c
+++ b/mm/fadvise.c
@@ -117,7 +117,8 @@ SYSCALL_DEFINE(fadvise64_64)(int fd, loff_t offset, loff_t len, int advice)
 		break;
 	case POSIX_FADV_DONTNEED:
 		if (!bdi_write_congested(mapping->backing_dev_info))
-			filemap_flush(mapping);
+			__filemap_fdatawrite_range(mapping, offset, endbyte,
+						   WB_SYNC_NONE);
 
 		/* First and last FULL page! */
 		start_index = (offset+(PAGE_CACHE_SIZE-1)) >> PAGE_CACHE_SHIFT;
-- 
1.7.6



---------------------------------------------------------------
This email, along with any attachments, is confidential. If you 
believe you received this message in error, please contact the 
sender immediately and delete all copies of the message.  
Thank you.

--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-11-22 23:01 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-31 16:16 [PATCH] fadvise: only initiate writeback for specified range with FADV_DONTNEED Shawn Bohrer
2011-10-31 16:16 ` Shawn Bohrer
2011-11-01 15:05 ` Johannes Weiner
2011-11-01 15:05   ` Johannes Weiner
2011-11-22 23:01   ` [PATCH resend] " Shawn Bohrer
2011-11-22 23:01     ` Shawn Bohrer

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.