Skip to contentSkip to conversation

padata-allocate-work-structures-for-parallel-jobs-from-a-pool.patch removed from -mm tree

merged [email protected] 1 participant 1 message Jun 4, 2020

lore
Share & tools
lore

[email protected]

author tree notice Applied
#0 lore raw

The patch titled
Subject: padata: allocate work structures for parallel jobs from a pool
has been removed from the -mm tree. Its filename was
padata-allocate-work-structures-for-parallel-jobs-from-a-pool.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: Daniel Jordan <[email protected]>
Subject: padata: allocate work structures for parallel jobs from a pool

padata allocates per-CPU, per-instance work structs for parallel jobs. A do_parallel call assigns a job to a sequence number and hashes the number to a CPU, where the job will eventually run using the corresponding work.

This approach fit with how padata used to bind a job to each CPU round-robin, makes less sense after commit bfde23ce200e6 ("padata: unbind parallel jobs from specific CPUs") because a work isn't bound to a particular CPU anymore, and isn't needed at all for multithreaded jobs because they don't have sequence numbers.

Replace the per-CPU works with a preallocated pool, which allows sharing them between existing padata users and the upcoming multithreaded user. The pool will also facilitate setting NUMA-aware concurrency limits with later users.

The pool is sized according to the number of possible CPUs. With this limit, MAX_OBJ_NUM no longer makes sense, so remove it.

If the global pool is exhausted, a parallel job is run in the current task instead to throttle a system trying to do too much in parallel.

Cc Alexander Duyck <[email protected]>
Cc Alex Williamson <[email protected]>
Cc Dan Williams <[email protected]>
Cc Dave Hansen <[email protected]>
Cc David Hildenbrand <[email protected]>
Cc Herbert Xu <[email protected]>
Cc Jason Gunthorpe <[email protected]>
Cc Jonathan Corbet <[email protected]>
Cc Kirill Tkhai <[email protected]>
Cc Michal Hocko <[email protected]>
Cc Pavel Machek <[email protected]>
Cc Pavel Tatashin <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Randy Dunlap <[email protected]>
Cc Robert Elliott <[email protected]>
Cc Shile Zhang <[email protected]>
Cc Steffen Klassert <[email protected]>
Cc Steven Sistare <[email protected]>
Cc Tejun Heo <[email protected]>
Cc Zi Yan <[email protected]>

---

 include/linux/padata.h |    8 --
 kernel/padata.c        |  118 +++++++++++++++++++++++++--------------
 2 files changed, 78 insertions(+), 48 deletions(-)
include/linux/padata.h renamed from include/linux/padata.h~padata-allocate-work-structures-for-parallel-jobs-from-a-pool +1 -7
@@ -24,7 +24,6 @@
  * @list: List entry, to attach to the padata lists.
  * @pd: Pointer to the internal control structure.
  * @cb_cpu: Callback cpu for serializatioon.
- * @cpu: Cpu for parallelization.
  * @seq_nr: Sequence number of the parallelized data object.
  * @info: Used to pass information from the parallel to the serial function.
  * @parallel: Parallel execution function.
@@ -34,7 +33,6 @@ struct padata_priv {
 	struct list_head	list;
 	struct parallel_data	*pd;
 	int			cb_cpu;
-	int			cpu;
 	unsigned int		seq_nr;
 	int			info;
 	void                    (*parallel)(struct padata_priv *padata);
@@ -68,15 +66,11 @@ struct padata_serial_queue {
 /**
  * struct padata_parallel_queue - The percpu padata parallel queue
  *
- * @parallel: List to wait for parallelization.
  * @reorder: List to wait for reordering after parallel processing.
- * @work: work struct for parallelization.
  * @num_obj: Number of objects that are processed by this cpu.
  */
 struct padata_parallel_queue {
-       struct padata_list    parallel;
        struct padata_list    reorder;
-       struct work_struct    work;
        atomic_t              num_obj;
 };
 
@@ -111,7 +105,7 @@ struct parallel_data {
 	struct padata_parallel_queue	__percpu *pqueue;
 	struct padata_serial_queue	__percpu *squeue;
 	atomic_t			refcnt;
-	atomic_t			seq_nr;
+	unsigned int			seq_nr;
 	unsigned int			processed;
 	int				cpu;
 	struct padata_cpumask		cpumask;
kernel/padata.c renamed from kernel/padata.c~padata-allocate-work-structures-for-parallel-jobs-from-a-pool +77 -41

190 lines not on this page · raw message

_

Patches currently in -mm which might be from [email protected] are