+++ /dev/null
-From d2ae7485cc17a3217e5d79b14de45b844c2d363f Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Thu, 30 Apr 2020 16:48:29 -0400
-Subject: dm mpath: pass IO start time to path selector
-
-From: Gabriel Krisman Bertazi <krisman@collabora.com>
-
-[ Upstream commit 087615bf3acdafd0ba7c7c9ed5286e7b7c80fe1b ]
-
-The HST path selector needs this information to perform path
-prediction. For request-based mpath, struct request's io_start_time_ns
-is used, while for bio-based, use the start_time stored in dm_io.
-
-Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.com>
-Signed-off-by: Mike Snitzer <snitzer@redhat.com>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- drivers/md/dm-mpath.c | 9 ++++++---
- drivers/md/dm-path-selector.h | 2 +-
- drivers/md/dm-queue-length.c | 2 +-
- drivers/md/dm-service-time.c | 2 +-
- drivers/md/dm.c | 9 +++++++++
- include/linux/device-mapper.h | 2 ++
- 6 files changed, 20 insertions(+), 6 deletions(-)
-
-diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c
-index f2de4c73cc8fa..d7ebed50895f0 100644
---- a/drivers/md/dm-mpath.c
-+++ b/drivers/md/dm-mpath.c
-@@ -558,7 +558,8 @@ static void multipath_release_clone(struct request *clone,
- if (pgpath && pgpath->pg->ps.type->end_io)
- pgpath->pg->ps.type->end_io(&pgpath->pg->ps,
- &pgpath->path,
-- mpio->nr_bytes);
-+ mpio->nr_bytes,
-+ clone->io_start_time_ns);
- }
-
- blk_put_request(clone);
-@@ -1560,7 +1561,8 @@ static int multipath_end_io(struct dm_target *ti, struct request *clone,
- struct path_selector *ps = &pgpath->pg->ps;
-
- if (ps->type->end_io)
-- ps->type->end_io(ps, &pgpath->path, mpio->nr_bytes);
-+ ps->type->end_io(ps, &pgpath->path, mpio->nr_bytes,
-+ clone->io_start_time_ns);
- }
-
- return r;
-@@ -1604,7 +1606,8 @@ static int multipath_end_io_bio(struct dm_target *ti, struct bio *clone,
- struct path_selector *ps = &pgpath->pg->ps;
-
- if (ps->type->end_io)
-- ps->type->end_io(ps, &pgpath->path, mpio->nr_bytes);
-+ ps->type->end_io(ps, &pgpath->path, mpio->nr_bytes,
-+ dm_start_time_ns_from_clone(clone));
- }
-
- return r;
-diff --git a/drivers/md/dm-path-selector.h b/drivers/md/dm-path-selector.h
-index b6eb5365b1a46..c47bc0e20275b 100644
---- a/drivers/md/dm-path-selector.h
-+++ b/drivers/md/dm-path-selector.h
-@@ -74,7 +74,7 @@ struct path_selector_type {
- int (*start_io) (struct path_selector *ps, struct dm_path *path,
- size_t nr_bytes);
- int (*end_io) (struct path_selector *ps, struct dm_path *path,
-- size_t nr_bytes);
-+ size_t nr_bytes, u64 start_time);
- };
-
- /* Register a path selector */
-diff --git a/drivers/md/dm-queue-length.c b/drivers/md/dm-queue-length.c
-index 969c4f1a36336..5fd018d184187 100644
---- a/drivers/md/dm-queue-length.c
-+++ b/drivers/md/dm-queue-length.c
-@@ -227,7 +227,7 @@ static int ql_start_io(struct path_selector *ps, struct dm_path *path,
- }
-
- static int ql_end_io(struct path_selector *ps, struct dm_path *path,
-- size_t nr_bytes)
-+ size_t nr_bytes, u64 start_time)
- {
- struct path_info *pi = path->pscontext;
-
-diff --git a/drivers/md/dm-service-time.c b/drivers/md/dm-service-time.c
-index f006a9005593b..9cfda665e9ebd 100644
---- a/drivers/md/dm-service-time.c
-+++ b/drivers/md/dm-service-time.c
-@@ -309,7 +309,7 @@ static int st_start_io(struct path_selector *ps, struct dm_path *path,
- }
-
- static int st_end_io(struct path_selector *ps, struct dm_path *path,
-- size_t nr_bytes)
-+ size_t nr_bytes, u64 start_time)
- {
- struct path_info *pi = path->pscontext;
-
-diff --git a/drivers/md/dm.c b/drivers/md/dm.c
-index 3cf5b354568e5..1e7ad2ad48295 100644
---- a/drivers/md/dm.c
-+++ b/drivers/md/dm.c
-@@ -649,6 +649,15 @@ static bool md_in_flight(struct mapped_device *md)
- return md_in_flight_bios(md);
- }
-
-+u64 dm_start_time_ns_from_clone(struct bio *bio)
-+{
-+ struct dm_target_io *tio = container_of(bio, struct dm_target_io, clone);
-+ struct dm_io *io = tio->io;
-+
-+ return jiffies_to_nsecs(io->start_time);
-+}
-+EXPORT_SYMBOL_GPL(dm_start_time_ns_from_clone);
-+
- static void start_io_acct(struct dm_io *io)
- {
- struct mapped_device *md = io->md;
-diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h
-index 399ad86323568..ec19222f67666 100644
---- a/include/linux/device-mapper.h
-+++ b/include/linux/device-mapper.h
-@@ -328,6 +328,8 @@ void *dm_per_bio_data(struct bio *bio, size_t data_size);
- struct bio *dm_bio_from_per_bio_data(void *data, size_t data_size);
- unsigned dm_bio_get_target_bio_nr(const struct bio *bio);
-
-+u64 dm_start_time_ns_from_clone(struct bio *bio);
-+
- int dm_register_target(struct target_type *t);
- void dm_unregister_target(struct target_type *t);
-
---
-2.25.1
-
arm-dts-imx6qdl-gw551x-fix-audio-ssi.patch
dmabuf-use-spinlock-to-access-dmabuf-name.patch
drm-amd-display-check-dmcu-exists-before-loading.patch
-dm-mpath-pass-io-start-time-to-path-selector.patch
dm-do-not-use-waitqueue-for-request-based-dm.patch
sunrpc-reverting-d03727b248d0-nfsv4-fix-close-not-waiting-for-direct-io-compeletion.patch
btrfs-reloc-fix-reloc-root-leak-and-null-pointer-dereference.patch
+++ /dev/null
-From a45cbc3d80352780654f270b02d15c169f6b473b Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Thu, 30 Apr 2020 16:48:29 -0400
-Subject: dm mpath: pass IO start time to path selector
-
-From: Gabriel Krisman Bertazi <krisman@collabora.com>
-
-[ Upstream commit 087615bf3acdafd0ba7c7c9ed5286e7b7c80fe1b ]
-
-The HST path selector needs this information to perform path
-prediction. For request-based mpath, struct request's io_start_time_ns
-is used, while for bio-based, use the start_time stored in dm_io.
-
-Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.com>
-Signed-off-by: Mike Snitzer <snitzer@redhat.com>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- drivers/md/dm-mpath.c | 9 ++++++---
- drivers/md/dm-path-selector.h | 2 +-
- drivers/md/dm-queue-length.c | 2 +-
- drivers/md/dm-service-time.c | 2 +-
- drivers/md/dm.c | 9 +++++++++
- include/linux/device-mapper.h | 2 ++
- 6 files changed, 20 insertions(+), 6 deletions(-)
-
-diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c
-index e0c800cf87a9b..74246d7c7d68e 100644
---- a/drivers/md/dm-mpath.c
-+++ b/drivers/md/dm-mpath.c
-@@ -567,7 +567,8 @@ static void multipath_release_clone(struct request *clone,
- if (pgpath && pgpath->pg->ps.type->end_io)
- pgpath->pg->ps.type->end_io(&pgpath->pg->ps,
- &pgpath->path,
-- mpio->nr_bytes);
-+ mpio->nr_bytes,
-+ clone->io_start_time_ns);
- }
-
- blk_put_request(clone);
-@@ -1617,7 +1618,8 @@ static int multipath_end_io(struct dm_target *ti, struct request *clone,
- struct path_selector *ps = &pgpath->pg->ps;
-
- if (ps->type->end_io)
-- ps->type->end_io(ps, &pgpath->path, mpio->nr_bytes);
-+ ps->type->end_io(ps, &pgpath->path, mpio->nr_bytes,
-+ clone->io_start_time_ns);
- }
-
- return r;
-@@ -1661,7 +1663,8 @@ static int multipath_end_io_bio(struct dm_target *ti, struct bio *clone,
- struct path_selector *ps = &pgpath->pg->ps;
-
- if (ps->type->end_io)
-- ps->type->end_io(ps, &pgpath->path, mpio->nr_bytes);
-+ ps->type->end_io(ps, &pgpath->path, mpio->nr_bytes,
-+ dm_start_time_ns_from_clone(clone));
- }
-
- return r;
-diff --git a/drivers/md/dm-path-selector.h b/drivers/md/dm-path-selector.h
-index b6eb5365b1a46..c47bc0e20275b 100644
---- a/drivers/md/dm-path-selector.h
-+++ b/drivers/md/dm-path-selector.h
-@@ -74,7 +74,7 @@ struct path_selector_type {
- int (*start_io) (struct path_selector *ps, struct dm_path *path,
- size_t nr_bytes);
- int (*end_io) (struct path_selector *ps, struct dm_path *path,
-- size_t nr_bytes);
-+ size_t nr_bytes, u64 start_time);
- };
-
- /* Register a path selector */
-diff --git a/drivers/md/dm-queue-length.c b/drivers/md/dm-queue-length.c
-index 969c4f1a36336..5fd018d184187 100644
---- a/drivers/md/dm-queue-length.c
-+++ b/drivers/md/dm-queue-length.c
-@@ -227,7 +227,7 @@ static int ql_start_io(struct path_selector *ps, struct dm_path *path,
- }
-
- static int ql_end_io(struct path_selector *ps, struct dm_path *path,
-- size_t nr_bytes)
-+ size_t nr_bytes, u64 start_time)
- {
- struct path_info *pi = path->pscontext;
-
-diff --git a/drivers/md/dm-service-time.c b/drivers/md/dm-service-time.c
-index f006a9005593b..9cfda665e9ebd 100644
---- a/drivers/md/dm-service-time.c
-+++ b/drivers/md/dm-service-time.c
-@@ -309,7 +309,7 @@ static int st_start_io(struct path_selector *ps, struct dm_path *path,
- }
-
- static int st_end_io(struct path_selector *ps, struct dm_path *path,
-- size_t nr_bytes)
-+ size_t nr_bytes, u64 start_time)
- {
- struct path_info *pi = path->pscontext;
-
-diff --git a/drivers/md/dm.c b/drivers/md/dm.c
-index 9793b04e9ff3b..cefda95c9abb7 100644
---- a/drivers/md/dm.c
-+++ b/drivers/md/dm.c
-@@ -676,6 +676,15 @@ static bool md_in_flight(struct mapped_device *md)
- return md_in_flight_bios(md);
- }
-
-+u64 dm_start_time_ns_from_clone(struct bio *bio)
-+{
-+ struct dm_target_io *tio = container_of(bio, struct dm_target_io, clone);
-+ struct dm_io *io = tio->io;
-+
-+ return jiffies_to_nsecs(io->start_time);
-+}
-+EXPORT_SYMBOL_GPL(dm_start_time_ns_from_clone);
-+
- static void start_io_acct(struct dm_io *io)
- {
- struct mapped_device *md = io->md;
-diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h
-index af48d9da39160..934037d938b9a 100644
---- a/include/linux/device-mapper.h
-+++ b/include/linux/device-mapper.h
-@@ -332,6 +332,8 @@ void *dm_per_bio_data(struct bio *bio, size_t data_size);
- struct bio *dm_bio_from_per_bio_data(void *data, size_t data_size);
- unsigned dm_bio_get_target_bio_nr(const struct bio *bio);
-
-+u64 dm_start_time_ns_from_clone(struct bio *bio);
-+
- int dm_register_target(struct target_type *t);
- void dm_unregister_target(struct target_type *t);
-
---
-2.25.1
-
drm-nouveau-nouveau-fix-page-fault-on-device-private.patch
drm-amd-display-check-dmcu-exists-before-loading.patch
drm-amd-display-add-dmcub-check-on-renoir.patch
-dm-mpath-pass-io-start-time-to-path-selector.patch
dm-do-not-use-waitqueue-for-request-based-dm.patch
sunrpc-reverting-d03727b248d0-nfsv4-fix-close-not-waiting-for-direct-io-compeletion.patch
exfat-fix-overflow-issue-in-exfat_cluster_to_sector.patch