]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
drop broken padata patch from 4.14, 4.4, and 4.9
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 14 Feb 2020 21:15:11 +0000 (16:15 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 14 Feb 2020 21:15:11 +0000 (16:15 -0500)
queue-4.14/padata-remove-broken-queue-flushing.patch [deleted file]
queue-4.14/series
queue-4.4/padata-remove-broken-queue-flushing.patch [deleted file]
queue-4.4/series
queue-4.9/padata-remove-broken-queue-flushing.patch [deleted file]
queue-4.9/series

diff --git a/queue-4.14/padata-remove-broken-queue-flushing.patch b/queue-4.14/padata-remove-broken-queue-flushing.patch
deleted file mode 100644 (file)
index 99ae55a..0000000
+++ /dev/null
@@ -1,144 +0,0 @@
-From b382112579378624c4dff73beef511ca530d8326 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Tue, 19 Nov 2019 13:17:31 +0800
-Subject: padata: Remove broken queue flushing
-
-From: Herbert Xu <herbert@gondor.apana.org.au>
-
-[ Upstream commit 07928d9bfc81640bab36f5190e8725894d93b659 ]
-
-The function padata_flush_queues is fundamentally broken because
-it cannot force padata users to complete the request that is
-underway.  IOW padata has to passively wait for the completion
-of any outstanding work.
-
-As it stands flushing is used in two places.  Its use in padata_stop
-is simply unnecessary because nothing depends on the queues to
-be flushed afterwards.
-
-The other use in padata_replace is more substantial as we depend
-on it to free the old pd structure.  This patch instead uses the
-pd->refcnt to dynamically free the pd structure once all requests
-are complete.
-
-Fixes: 2b73b07ab8a4 ("padata: Flush the padata queues actively")
-Cc: <stable@vger.kernel.org>
-Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-Reviewed-by: Daniel Jordan <daniel.m.jordan@oracle.com>
-Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- kernel/padata.c | 46 ++++++++++++----------------------------------
- 1 file changed, 12 insertions(+), 34 deletions(-)
-
-diff --git a/kernel/padata.c b/kernel/padata.c
-index 87540ce72aea6..ef4ba3d664dab 100644
---- a/kernel/padata.c
-+++ b/kernel/padata.c
-@@ -34,6 +34,8 @@
- #define MAX_OBJ_NUM 1000
-+static void padata_free_pd(struct parallel_data *pd);
-+
- static int padata_index_to_cpu(struct parallel_data *pd, int cpu_index)
- {
-       int cpu, target_cpu;
-@@ -292,6 +294,7 @@ static void padata_serial_worker(struct work_struct *serial_work)
-       struct padata_serial_queue *squeue;
-       struct parallel_data *pd;
-       LIST_HEAD(local_list);
-+      int cnt;
-       local_bh_disable();
-       squeue = container_of(serial_work, struct padata_serial_queue, work);
-@@ -301,6 +304,8 @@ static void padata_serial_worker(struct work_struct *serial_work)
-       list_replace_init(&squeue->serial.list, &local_list);
-       spin_unlock(&squeue->serial.lock);
-+      cnt = 0;
-+
-       while (!list_empty(&local_list)) {
-               struct padata_priv *padata;
-@@ -310,9 +315,12 @@ static void padata_serial_worker(struct work_struct *serial_work)
-               list_del_init(&padata->list);
-               padata->serial(padata);
--              atomic_dec(&pd->refcnt);
-+              cnt++;
-       }
-       local_bh_enable();
-+
-+      if (atomic_sub_and_test(cnt, &pd->refcnt))
-+              padata_free_pd(pd);
- }
- /**
-@@ -435,8 +443,7 @@ static struct parallel_data *padata_alloc_pd(struct padata_instance *pinst,
-       setup_timer(&pd->timer, padata_reorder_timer, (unsigned long)pd);
-       atomic_set(&pd->seq_nr, -1);
-       atomic_set(&pd->reorder_objects, 0);
--      atomic_set(&pd->refcnt, 0);
--      pd->pinst = pinst;
-+      atomic_set(&pd->refcnt, 1);
-       spin_lock_init(&pd->lock);
-       return pd;
-@@ -460,31 +467,6 @@ static void padata_free_pd(struct parallel_data *pd)
-       kfree(pd);
- }
--/* Flush all objects out of the padata queues. */
--static void padata_flush_queues(struct parallel_data *pd)
--{
--      int cpu;
--      struct padata_parallel_queue *pqueue;
--      struct padata_serial_queue *squeue;
--
--      for_each_cpu(cpu, pd->cpumask.pcpu) {
--              pqueue = per_cpu_ptr(pd->pqueue, cpu);
--              flush_work(&pqueue->work);
--      }
--
--      del_timer_sync(&pd->timer);
--
--      if (atomic_read(&pd->reorder_objects))
--              padata_reorder(pd);
--
--      for_each_cpu(cpu, pd->cpumask.cbcpu) {
--              squeue = per_cpu_ptr(pd->squeue, cpu);
--              flush_work(&squeue->work);
--      }
--
--      BUG_ON(atomic_read(&pd->refcnt) != 0);
--}
--
- static void __padata_start(struct padata_instance *pinst)
- {
-       pinst->flags |= PADATA_INIT;
-@@ -498,10 +480,6 @@ static void __padata_stop(struct padata_instance *pinst)
-       pinst->flags &= ~PADATA_INIT;
-       synchronize_rcu();
--
--      get_online_cpus();
--      padata_flush_queues(pinst->pd);
--      put_online_cpus();
- }
- /* Replace the internal control structure with a new one. */
-@@ -522,8 +500,8 @@ static void padata_replace(struct padata_instance *pinst,
-       if (!cpumask_equal(pd_old->cpumask.cbcpu, pd_new->cpumask.cbcpu))
-               notification_mask |= PADATA_CPU_SERIAL;
--      padata_flush_queues(pd_old);
--      padata_free_pd(pd_old);
-+      if (atomic_dec_and_test(&pd_old->refcnt))
-+              padata_free_pd(pd_old);
-       if (notification_mask)
-               blocking_notifier_call_chain(&pinst->cpumask_change_notifier,
--- 
-2.20.1
-
index 454404789e507623a07f7e0b3f323d226a27b71e..c2648214752e80c84233515fd019ff7de1a1e245 100644 (file)
@@ -54,7 +54,6 @@ of-add-of_dma_default_coherent-select-it-on-powerpc.patch
 dm-zoned-support-zone-sizes-smaller-than-128mib.patch
 dm-space-map-common-fix-to-ensure-new-block-isn-t-already-in-use.patch
 dm-crypt-fix-benbi-iv-constructor-crash-if-used-in-authenticated-mode.patch
-padata-remove-broken-queue-flushing.patch
 tracing-annotate-ftrace_graph_hash-pointer-with-__rc.patch
 tracing-annotate-ftrace_graph_notrace_hash-pointer-w.patch
 ftrace-add-comment-to-why-rcu_dereference_sched-is-o.patch
diff --git a/queue-4.4/padata-remove-broken-queue-flushing.patch b/queue-4.4/padata-remove-broken-queue-flushing.patch
deleted file mode 100644 (file)
index e3b44b1..0000000
+++ /dev/null
@@ -1,144 +0,0 @@
-From ebd6b41ce3a926d28af493905a97e784b4db8eb9 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Tue, 19 Nov 2019 13:17:31 +0800
-Subject: padata: Remove broken queue flushing
-
-From: Herbert Xu <herbert@gondor.apana.org.au>
-
-[ Upstream commit 07928d9bfc81640bab36f5190e8725894d93b659 ]
-
-The function padata_flush_queues is fundamentally broken because
-it cannot force padata users to complete the request that is
-underway.  IOW padata has to passively wait for the completion
-of any outstanding work.
-
-As it stands flushing is used in two places.  Its use in padata_stop
-is simply unnecessary because nothing depends on the queues to
-be flushed afterwards.
-
-The other use in padata_replace is more substantial as we depend
-on it to free the old pd structure.  This patch instead uses the
-pd->refcnt to dynamically free the pd structure once all requests
-are complete.
-
-Fixes: 2b73b07ab8a4 ("padata: Flush the padata queues actively")
-Cc: <stable@vger.kernel.org>
-Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-Reviewed-by: Daniel Jordan <daniel.m.jordan@oracle.com>
-Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- kernel/padata.c | 46 ++++++++++++----------------------------------
- 1 file changed, 12 insertions(+), 34 deletions(-)
-
-diff --git a/kernel/padata.c b/kernel/padata.c
-index 282b489a286db..bb632033e6887 100644
---- a/kernel/padata.c
-+++ b/kernel/padata.c
-@@ -33,6 +33,8 @@
- #define MAX_OBJ_NUM 1000
-+static void padata_free_pd(struct parallel_data *pd);
-+
- static int padata_index_to_cpu(struct parallel_data *pd, int cpu_index)
- {
-       int cpu, target_cpu;
-@@ -300,6 +302,7 @@ static void padata_serial_worker(struct work_struct *serial_work)
-       struct padata_serial_queue *squeue;
-       struct parallel_data *pd;
-       LIST_HEAD(local_list);
-+      int cnt;
-       local_bh_disable();
-       squeue = container_of(serial_work, struct padata_serial_queue, work);
-@@ -309,6 +312,8 @@ static void padata_serial_worker(struct work_struct *serial_work)
-       list_replace_init(&squeue->serial.list, &local_list);
-       spin_unlock(&squeue->serial.lock);
-+      cnt = 0;
-+
-       while (!list_empty(&local_list)) {
-               struct padata_priv *padata;
-@@ -318,9 +323,12 @@ static void padata_serial_worker(struct work_struct *serial_work)
-               list_del_init(&padata->list);
-               padata->serial(padata);
--              atomic_dec(&pd->refcnt);
-+              cnt++;
-       }
-       local_bh_enable();
-+
-+      if (atomic_sub_and_test(cnt, &pd->refcnt))
-+              padata_free_pd(pd);
- }
- /**
-@@ -443,8 +451,7 @@ static struct parallel_data *padata_alloc_pd(struct padata_instance *pinst,
-       setup_timer(&pd->timer, padata_reorder_timer, (unsigned long)pd);
-       atomic_set(&pd->seq_nr, -1);
-       atomic_set(&pd->reorder_objects, 0);
--      atomic_set(&pd->refcnt, 0);
--      pd->pinst = pinst;
-+      atomic_set(&pd->refcnt, 1);
-       spin_lock_init(&pd->lock);
-       return pd;
-@@ -468,31 +475,6 @@ static void padata_free_pd(struct parallel_data *pd)
-       kfree(pd);
- }
--/* Flush all objects out of the padata queues. */
--static void padata_flush_queues(struct parallel_data *pd)
--{
--      int cpu;
--      struct padata_parallel_queue *pqueue;
--      struct padata_serial_queue *squeue;
--
--      for_each_cpu(cpu, pd->cpumask.pcpu) {
--              pqueue = per_cpu_ptr(pd->pqueue, cpu);
--              flush_work(&pqueue->work);
--      }
--
--      del_timer_sync(&pd->timer);
--
--      if (atomic_read(&pd->reorder_objects))
--              padata_reorder(pd);
--
--      for_each_cpu(cpu, pd->cpumask.cbcpu) {
--              squeue = per_cpu_ptr(pd->squeue, cpu);
--              flush_work(&squeue->work);
--      }
--
--      BUG_ON(atomic_read(&pd->refcnt) != 0);
--}
--
- static void __padata_start(struct padata_instance *pinst)
- {
-       pinst->flags |= PADATA_INIT;
-@@ -506,10 +488,6 @@ static void __padata_stop(struct padata_instance *pinst)
-       pinst->flags &= ~PADATA_INIT;
-       synchronize_rcu();
--
--      get_online_cpus();
--      padata_flush_queues(pinst->pd);
--      put_online_cpus();
- }
- /* Replace the internal control structure with a new one. */
-@@ -530,8 +508,8 @@ static void padata_replace(struct padata_instance *pinst,
-       if (!cpumask_equal(pd_old->cpumask.cbcpu, pd_new->cpumask.cbcpu))
-               notification_mask |= PADATA_CPU_SERIAL;
--      padata_flush_queues(pd_old);
--      padata_free_pd(pd_old);
-+      if (atomic_dec_and_test(&pd_old->refcnt))
-+              padata_free_pd(pd_old);
-       if (notification_mask)
-               blocking_notifier_call_chain(&pinst->cpumask_change_notifier,
--- 
-2.20.1
-
index 123db66a5f15cae3f470dae361cb4d61fb0ae271..040544a289e2dc823f607d3c7337b2b41f031675 100644 (file)
@@ -24,7 +24,6 @@ power-supply-ltc2941-battery-gauge-fix-use-after-free.patch
 revert-ovl-modify-ovl_permission-to-do-checks-on-two-inodes.patch
 of-add-of_dma_default_coherent-select-it-on-powerpc.patch
 dm-space-map-common-fix-to-ensure-new-block-isn-t-already-in-use.patch
-padata-remove-broken-queue-flushing.patch
 crypto-pcrypt-do-not-clear-may_sleep-flag-in-original-request.patch
 crypto-api-fix-race-condition-in-crypto_spawn_alg.patch
 crypto-picoxcell-adjust-the-position-of-tasklet_init-and-fix-missed-tasklet_kill.patch
diff --git a/queue-4.9/padata-remove-broken-queue-flushing.patch b/queue-4.9/padata-remove-broken-queue-flushing.patch
deleted file mode 100644 (file)
index 75d7ca6..0000000
+++ /dev/null
@@ -1,144 +0,0 @@
-From 922e632cbb5d408ccacb45addde1285f360bdeb2 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Tue, 19 Nov 2019 13:17:31 +0800
-Subject: padata: Remove broken queue flushing
-
-From: Herbert Xu <herbert@gondor.apana.org.au>
-
-[ Upstream commit 07928d9bfc81640bab36f5190e8725894d93b659 ]
-
-The function padata_flush_queues is fundamentally broken because
-it cannot force padata users to complete the request that is
-underway.  IOW padata has to passively wait for the completion
-of any outstanding work.
-
-As it stands flushing is used in two places.  Its use in padata_stop
-is simply unnecessary because nothing depends on the queues to
-be flushed afterwards.
-
-The other use in padata_replace is more substantial as we depend
-on it to free the old pd structure.  This patch instead uses the
-pd->refcnt to dynamically free the pd structure once all requests
-are complete.
-
-Fixes: 2b73b07ab8a4 ("padata: Flush the padata queues actively")
-Cc: <stable@vger.kernel.org>
-Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-Reviewed-by: Daniel Jordan <daniel.m.jordan@oracle.com>
-Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- kernel/padata.c | 46 ++++++++++++----------------------------------
- 1 file changed, 12 insertions(+), 34 deletions(-)
-
-diff --git a/kernel/padata.c b/kernel/padata.c
-index 63449fc584daf..9ba611b42abac 100644
---- a/kernel/padata.c
-+++ b/kernel/padata.c
-@@ -34,6 +34,8 @@
- #define MAX_OBJ_NUM 1000
-+static void padata_free_pd(struct parallel_data *pd);
-+
- static int padata_index_to_cpu(struct parallel_data *pd, int cpu_index)
- {
-       int cpu, target_cpu;
-@@ -301,6 +303,7 @@ static void padata_serial_worker(struct work_struct *serial_work)
-       struct padata_serial_queue *squeue;
-       struct parallel_data *pd;
-       LIST_HEAD(local_list);
-+      int cnt;
-       local_bh_disable();
-       squeue = container_of(serial_work, struct padata_serial_queue, work);
-@@ -310,6 +313,8 @@ static void padata_serial_worker(struct work_struct *serial_work)
-       list_replace_init(&squeue->serial.list, &local_list);
-       spin_unlock(&squeue->serial.lock);
-+      cnt = 0;
-+
-       while (!list_empty(&local_list)) {
-               struct padata_priv *padata;
-@@ -319,9 +324,12 @@ static void padata_serial_worker(struct work_struct *serial_work)
-               list_del_init(&padata->list);
-               padata->serial(padata);
--              atomic_dec(&pd->refcnt);
-+              cnt++;
-       }
-       local_bh_enable();
-+
-+      if (atomic_sub_and_test(cnt, &pd->refcnt))
-+              padata_free_pd(pd);
- }
- /**
-@@ -444,8 +452,7 @@ static struct parallel_data *padata_alloc_pd(struct padata_instance *pinst,
-       setup_timer(&pd->timer, padata_reorder_timer, (unsigned long)pd);
-       atomic_set(&pd->seq_nr, -1);
-       atomic_set(&pd->reorder_objects, 0);
--      atomic_set(&pd->refcnt, 0);
--      pd->pinst = pinst;
-+      atomic_set(&pd->refcnt, 1);
-       spin_lock_init(&pd->lock);
-       return pd;
-@@ -469,31 +476,6 @@ static void padata_free_pd(struct parallel_data *pd)
-       kfree(pd);
- }
--/* Flush all objects out of the padata queues. */
--static void padata_flush_queues(struct parallel_data *pd)
--{
--      int cpu;
--      struct padata_parallel_queue *pqueue;
--      struct padata_serial_queue *squeue;
--
--      for_each_cpu(cpu, pd->cpumask.pcpu) {
--              pqueue = per_cpu_ptr(pd->pqueue, cpu);
--              flush_work(&pqueue->work);
--      }
--
--      del_timer_sync(&pd->timer);
--
--      if (atomic_read(&pd->reorder_objects))
--              padata_reorder(pd);
--
--      for_each_cpu(cpu, pd->cpumask.cbcpu) {
--              squeue = per_cpu_ptr(pd->squeue, cpu);
--              flush_work(&squeue->work);
--      }
--
--      BUG_ON(atomic_read(&pd->refcnt) != 0);
--}
--
- static void __padata_start(struct padata_instance *pinst)
- {
-       pinst->flags |= PADATA_INIT;
-@@ -507,10 +489,6 @@ static void __padata_stop(struct padata_instance *pinst)
-       pinst->flags &= ~PADATA_INIT;
-       synchronize_rcu();
--
--      get_online_cpus();
--      padata_flush_queues(pinst->pd);
--      put_online_cpus();
- }
- /* Replace the internal control structure with a new one. */
-@@ -531,8 +509,8 @@ static void padata_replace(struct padata_instance *pinst,
-       if (!cpumask_equal(pd_old->cpumask.cbcpu, pd_new->cpumask.cbcpu))
-               notification_mask |= PADATA_CPU_SERIAL;
--      padata_flush_queues(pd_old);
--      padata_free_pd(pd_old);
-+      if (atomic_dec_and_test(&pd_old->refcnt))
-+              padata_free_pd(pd_old);
-       if (notification_mask)
-               blocking_notifier_call_chain(&pinst->cpumask_change_notifier,
--- 
-2.20.1
-
index 3c4474f3027ba3f63f412ee9073dc5c3aeb51038..fe867c43a97c846c883771a112870cddf92cf364 100644 (file)
@@ -32,7 +32,6 @@ scsi-qla2xxx-fix-mtcp-dump-collection-failure.patch
 power-supply-ltc2941-battery-gauge-fix-use-after-free.patch
 of-add-of_dma_default_coherent-select-it-on-powerpc.patch
 dm-space-map-common-fix-to-ensure-new-block-isn-t-already-in-use.patch
-padata-remove-broken-queue-flushing.patch
 crypto-pcrypt-do-not-clear-may_sleep-flag-in-original-request.patch
 crypto-atmel-aes-fix-counter-overflow-in-ctr-mode.patch
 crypto-api-fix-race-condition-in-crypto_spawn_alg.patch