Lines Matching full:ps

167  * @ps: padatashell
180 int padata_do_parallel(struct padata_shell *ps, in padata_do_parallel() argument
183 struct padata_instance *pinst = ps->pinst; in padata_do_parallel()
190 pd = rcu_dereference_bh(ps->pd); in padata_do_parallel()
289 struct padata_instance *pinst = pd->ps->pinst; in padata_reorder()
444 struct padata_mt_job_state *ps = pw->pw_data; in padata_mt_helper() local
445 struct padata_mt_job *job = ps->job; in padata_mt_helper()
448 spin_lock(&ps->lock); in padata_mt_helper()
455 size = roundup(start + 1, ps->chunk_size) - start; in padata_mt_helper()
462 spin_unlock(&ps->lock); in padata_mt_helper()
464 spin_lock(&ps->lock); in padata_mt_helper()
467 ++ps->nworks_fini; in padata_mt_helper()
468 done = (ps->nworks_fini == ps->nworks); in padata_mt_helper()
469 spin_unlock(&ps->lock); in padata_mt_helper()
472 complete(&ps->completion); in padata_mt_helper()
486 struct padata_mt_job_state ps; in padata_do_multithreaded() local
503 spin_lock_init(&ps.lock); in padata_do_multithreaded()
504 init_completion(&ps.completion); in padata_do_multithreaded()
505 ps.job = job; in padata_do_multithreaded()
506 ps.nworks = padata_work_alloc_mt(nworks, &ps, &works); in padata_do_multithreaded()
507 ps.nworks_fini = 0; in padata_do_multithreaded()
515 ps.chunk_size = job->size / (ps.nworks * load_balance_factor); in padata_do_multithreaded()
516 ps.chunk_size = max(ps.chunk_size, job->min_chunk); in padata_do_multithreaded()
517 ps.chunk_size = roundup(ps.chunk_size, job->align); in padata_do_multithreaded()
523 padata_work_init(&my_work, padata_mt_helper, &ps, PADATA_WORK_ONSTACK); in padata_do_multithreaded()
527 wait_for_completion(&ps.completion); in padata_do_multithreaded()
566 static struct parallel_data *padata_alloc_pd(struct padata_shell *ps) in padata_alloc_pd() argument
568 struct padata_instance *pinst = ps->pinst; in padata_alloc_pd()
583 pd->ps = ps; in padata_alloc_pd()
640 static int padata_replace_one(struct padata_shell *ps) in padata_replace_one() argument
644 pd_new = padata_alloc_pd(ps); in padata_replace_one()
648 ps->opd = rcu_dereference_protected(ps->pd, 1); in padata_replace_one()
649 rcu_assign_pointer(ps->pd, pd_new); in padata_replace_one()
656 struct padata_shell *ps; in padata_replace() local
661 list_for_each_entry(ps, &pinst->pslist, list) { in padata_replace()
662 err = padata_replace_one(ps); in padata_replace()
669 list_for_each_entry_continue_reverse(ps, &pinst->pslist, list) in padata_replace()
670 if (atomic_dec_and_test(&ps->opd->refcnt)) in padata_replace()
671 padata_free_pd(ps->opd); in padata_replace()
1069 struct padata_shell *ps; in padata_alloc_shell() local
1071 ps = kzalloc(sizeof(*ps), GFP_KERNEL); in padata_alloc_shell()
1072 if (!ps) in padata_alloc_shell()
1075 ps->pinst = pinst; in padata_alloc_shell()
1078 pd = padata_alloc_pd(ps); in padata_alloc_shell()
1085 RCU_INIT_POINTER(ps->pd, pd); in padata_alloc_shell()
1086 list_add(&ps->list, &pinst->pslist); in padata_alloc_shell()
1089 return ps; in padata_alloc_shell()
1092 kfree(ps); in padata_alloc_shell()
1101 * @ps: padata shell to free
1103 void padata_free_shell(struct padata_shell *ps) in padata_free_shell() argument
1105 if (!ps) in padata_free_shell()
1108 mutex_lock(&ps->pinst->lock); in padata_free_shell()
1109 list_del(&ps->list); in padata_free_shell()
1110 padata_free_pd(rcu_dereference_protected(ps->pd, 1)); in padata_free_shell()
1111 mutex_unlock(&ps->pinst->lock); in padata_free_shell()
1113 kfree(ps); in padata_free_shell()