All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dax: Fix inefficiency in dax_writeback_mapping_range()
@ 2017-06-19 12:45 ` Jan Kara
  0 siblings, 0 replies; 5+ messages in thread
From: Jan Kara @ 2017-06-19 12:45 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Jan Kara, linux-nvdimm, stable, linux-mm

dax_writeback_mapping_range() fails to update iteration index when
searching radix tree for entries needing cache flushing. Thus each
pagevec worth of entries is searched starting from the start which is
inefficient and prone to livelocks. Update index properly.

CC: stable@vger.kernel.org
Fixes: 9973c98ecfda3a1dfcab981665b5f1e39bcde64a
Signed-off-by: Jan Kara <jack@suse.cz>
---
 fs/dax.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/dax.c b/fs/dax.c
index 2a6889b3585f..9187f3b07f3e 100644
--- a/fs/dax.c
+++ b/fs/dax.c
@@ -859,6 +859,7 @@ int dax_writeback_mapping_range(struct address_space *mapping,
 			if (ret < 0)
 				goto out;
 		}
+		start_index = indices[pvec.nr - 1] + 1;
 	}
 out:
 	put_dax(dax_dev);
-- 
2.12.3

_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

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

* [PATCH] dax: Fix inefficiency in dax_writeback_mapping_range()
@ 2017-06-19 12:45 ` Jan Kara
  0 siblings, 0 replies; 5+ messages in thread
From: Jan Kara @ 2017-06-19 12:45 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Ross Zwisler, Dan Williams, linux-nvdimm, linux-mm, Jan Kara, stable

dax_writeback_mapping_range() fails to update iteration index when
searching radix tree for entries needing cache flushing. Thus each
pagevec worth of entries is searched starting from the start which is
inefficient and prone to livelocks. Update index properly.

CC: stable@vger.kernel.org
Fixes: 9973c98ecfda3a1dfcab981665b5f1e39bcde64a
Signed-off-by: Jan Kara <jack@suse.cz>
---
 fs/dax.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/dax.c b/fs/dax.c
index 2a6889b3585f..9187f3b07f3e 100644
--- a/fs/dax.c
+++ b/fs/dax.c
@@ -859,6 +859,7 @@ int dax_writeback_mapping_range(struct address_space *mapping,
 			if (ret < 0)
 				goto out;
 		}
+		start_index = indices[pvec.nr - 1] + 1;
 	}
 out:
 	put_dax(dax_dev);
-- 
2.12.3

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

* [PATCH] dax: Fix inefficiency in dax_writeback_mapping_range()
@ 2017-06-19 12:45 ` Jan Kara
  0 siblings, 0 replies; 5+ messages in thread
From: Jan Kara @ 2017-06-19 12:45 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Ross Zwisler, Dan Williams, linux-nvdimm, linux-mm, Jan Kara, stable

dax_writeback_mapping_range() fails to update iteration index when
searching radix tree for entries needing cache flushing. Thus each
pagevec worth of entries is searched starting from the start which is
inefficient and prone to livelocks. Update index properly.

CC: stable@vger.kernel.org
Fixes: 9973c98ecfda3a1dfcab981665b5f1e39bcde64a
Signed-off-by: Jan Kara <jack@suse.cz>
---
 fs/dax.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/dax.c b/fs/dax.c
index 2a6889b3585f..9187f3b07f3e 100644
--- a/fs/dax.c
+++ b/fs/dax.c
@@ -859,6 +859,7 @@ int dax_writeback_mapping_range(struct address_space *mapping,
 			if (ret < 0)
 				goto out;
 		}
+		start_index = indices[pvec.nr - 1] + 1;
 	}
 out:
 	put_dax(dax_dev);
-- 
2.12.3

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

* Re: [PATCH] dax: Fix inefficiency in dax_writeback_mapping_range()
  2017-06-19 12:45 ` Jan Kara
@ 2017-06-19 16:34   ` Ross Zwisler
  -1 siblings, 0 replies; 5+ messages in thread
From: Ross Zwisler @ 2017-06-19 16:34 UTC (permalink / raw)
  To: Jan Kara; +Cc: linux-nvdimm, stable, linux-mm, Andrew Morton

On Mon, Jun 19, 2017 at 02:45:31PM +0200, Jan Kara wrote:
> dax_writeback_mapping_range() fails to update iteration index when
> searching radix tree for entries needing cache flushing. Thus each
> pagevec worth of entries is searched starting from the start which is
> inefficient and prone to livelocks. Update index properly.
> 
> CC: stable@vger.kernel.org
> Fixes: 9973c98ecfda3a1dfcab981665b5f1e39bcde64a
> Signed-off-by: Jan Kara <jack@suse.cz>

Yep, this seems good, thanks.

Reviewed-by: Ross Zwisler <ross.zwisler@linux.intel.com>
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

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

* Re: [PATCH] dax: Fix inefficiency in dax_writeback_mapping_range()
@ 2017-06-19 16:34   ` Ross Zwisler
  0 siblings, 0 replies; 5+ messages in thread
From: Ross Zwisler @ 2017-06-19 16:34 UTC (permalink / raw)
  To: Jan Kara
  Cc: Andrew Morton, Ross Zwisler, Dan Williams, linux-nvdimm,
	linux-mm, stable

On Mon, Jun 19, 2017 at 02:45:31PM +0200, Jan Kara wrote:
> dax_writeback_mapping_range() fails to update iteration index when
> searching radix tree for entries needing cache flushing. Thus each
> pagevec worth of entries is searched starting from the start which is
> inefficient and prone to livelocks. Update index properly.
> 
> CC: stable@vger.kernel.org
> Fixes: 9973c98ecfda3a1dfcab981665b5f1e39bcde64a
> Signed-off-by: Jan Kara <jack@suse.cz>

Yep, this seems good, thanks.

Reviewed-by: Ross Zwisler <ross.zwisler@linux.intel.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] 5+ messages in thread

end of thread, other threads:[~2017-06-19 16:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-19 12:45 [PATCH] dax: Fix inefficiency in dax_writeback_mapping_range() Jan Kara
2017-06-19 12:45 ` Jan Kara
2017-06-19 12:45 ` Jan Kara
2017-06-19 16:34 ` Ross Zwisler
2017-06-19 16:34   ` Ross Zwisler

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.