Remove __init from padata_do_multithreaded and padata_mt_helper.
Subsystems (2)
PATCH v2 1/1 Remove __init from padata_do_multithreaded and padata_mt_helper.
Allow padata_do_multithreaded function to be called after bootstrap.
v2: removed __init from padata_work_alloc_mt and padata_works_free
--- include/linux/padata.h | 2 +- kernel/padata.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-)
include/linux/padata.h +1 -1
@@ -201,7 +201,7 @@ extern void padata_free_shell(struct padata_shell *ps);extern int padata_do_parallel (struct padata_shell *ps,struct padata_priv *padata,int *cb_cpu);extern void padata_do_serial (struct padata_priv *padata); -extern void __init padata_do_multithreaded (struct padata_mt_job *job); +extern void padata_do_multithreaded (struct padata_mt_job *job);extern int padata_set_cpumask (struct padata_instance *pinst,int cpumask_type,cpumask_var_t cpumask);extern int padata_start (struct padata_instance *pinst);
kernel/padata.c +5 -5
@@ -58,7 +58,7 @@ struct padata_mt_job_state { };static void padata_free_pd (struct parallel_data *pd); -static void __init padata_mt_helper (struct work_struct *work); +static void padata_mt_helper (struct work_struct *work);static int padata_index_to_cpu (struct parallel_data *pd,int cpu_index) {
@@ -106,7 +106,7 @@ static void padata_work_init(struct padata_work *pw, work_func_t work_fn, pw->pw_data = data; } -static int __init padata_work_alloc_mt (int nworks,void *data, +static int padata_work_alloc_mt (int nworks,void *data,struct list_head *head) {int i;
@@ -132,7 +132,7 @@ static void padata_work_free(struct padata_work *pw)list_add (&pw->pw_list, &padata_free_works); } -static void __init padata_works_free (struct list_head *works) +static void padata_works_free (struct list_head *works) {struct padata_work *cur, *next;
@@ -463,7 +463,7 @@ static int pd_setup_cpumasks(struct parallel_data *pd,return err; } -static void __init padata_mt_helper (struct work_struct *w) +static void padata_mt_helper (struct work_struct *w) { struct padata_work *pw = container_of(w, struct padata_work, pw_work);struct padata_mt_job_state *ps = pw->pw_data;
@@ -503,7 +503,7 @@ static void __init padata_mt_helper(struct work_struct *w)* * See the definition of struct padata_mt_job for more details. */ -void __init padata_do_multithreaded (struct padata_mt_job *job) +void padata_do_multithreaded (struct padata_mt_job *job) {/* In case threads finish at different times. */ static const unsigned long load_balance_factor =4 ;
Signature · 1 line
2.18.1
Daniel Jordan
maintainer(I was away for a while)
Quoted 1 line · Nico Pache
Allow
padata_do_multithreadedfunction to be called after bootstrap.
The functions are __init because they're currently only needed during boot, and using __init allows the text to be freed once it's over, saving some memory.
So this change, in isolation, doesn't make sense. If there were an enhancement you were thinking of making, this patch could then be bundled with it so the change is made only when it's used.
However, there's still work that needs to be merged before padata_do_multithreaded can be called after boot. See the parts about priority adjustments (MAX_NICE/renicing) and concurrency limits in this branch
and the ktask discussions from linux-mm/lkml where concerns about these issues were raised. I plan to post these parts fairly soon and can include you if you want.
Daniel Jordan
maintainerQuoted 19 lines · Nico Pache
Quoted 18 lines · Daniel Jordan
(I was away for a while)
Quoted 1 line · Nico Pache
Allow
padata_do_multithreadedfunction to be called after bootstrap.The functions are
__initbecause they're currently only needed during boot, and using__initallows the text to be freed once it's over, saving some memory.So this change, in isolation, doesn't make sense. If there were an enhancement you were thinking of making, this patch could then be bundled with it so the change is made only when it's used.
However, there's still work that needs to be merged before
padata_do_multithreadedcan be called after boot. See the parts about priority adjustments (MAX_NICE/renicing) and concurrency limits in this branch
Quoted 7 lines
Quoted 3 lines
and the ktask discussions from linux-mm/lkml where concerns about these issues were raised. I plan to post these parts fairly soon and can include you if you want.
I really like the speed benefits I've been able to achieve by using your padata multithreaded interface in the branch you linked me to. Do you still have plans on moving forward with this upstream?
Yes, I'm still planning to push these patches upstream, but it's going to take some time with all the prerequisites. I'm working on remote charging in the CPU controller now, which is the biggest unfinished task. A little background on that here: