Lines Matching refs:ps

167 int padata_do_parallel(struct padata_shell *ps,  in padata_do_parallel()  argument
170 struct padata_instance *pinst = ps->pinst; in padata_do_parallel()
177 pd = rcu_dereference_bh(ps->pd); in padata_do_parallel()
276 struct padata_instance *pinst = pd->ps->pinst; in padata_reorder()
431 struct padata_mt_job_state *ps = pw->pw_data; in padata_mt_helper() local
432 struct padata_mt_job *job = ps->job; in padata_mt_helper()
435 spin_lock(&ps->lock); in padata_mt_helper()
442 size = roundup(start + 1, ps->chunk_size) - start; in padata_mt_helper()
449 spin_unlock(&ps->lock); in padata_mt_helper()
451 spin_lock(&ps->lock); in padata_mt_helper()
454 ++ps->nworks_fini; in padata_mt_helper()
455 done = (ps->nworks_fini == ps->nworks); in padata_mt_helper()
456 spin_unlock(&ps->lock); in padata_mt_helper()
459 complete(&ps->completion); in padata_mt_helper()
473 struct padata_mt_job_state ps; in padata_do_multithreaded() local
490 spin_lock_init(&ps.lock); in padata_do_multithreaded()
491 init_completion(&ps.completion); in padata_do_multithreaded()
492 ps.job = job; in padata_do_multithreaded()
493 ps.nworks = padata_work_alloc_mt(nworks, &ps, &works); in padata_do_multithreaded()
494 ps.nworks_fini = 0; in padata_do_multithreaded()
502 ps.chunk_size = job->size / (ps.nworks * load_balance_factor); in padata_do_multithreaded()
503 ps.chunk_size = max(ps.chunk_size, job->min_chunk); in padata_do_multithreaded()
504 ps.chunk_size = roundup(ps.chunk_size, job->align); in padata_do_multithreaded()
510 padata_work_init(&my_work, padata_mt_helper, &ps, PADATA_WORK_ONSTACK); in padata_do_multithreaded()
514 wait_for_completion(&ps.completion); in padata_do_multithreaded()
553 static struct parallel_data *padata_alloc_pd(struct padata_shell *ps) in padata_alloc_pd() argument
555 struct padata_instance *pinst = ps->pinst; in padata_alloc_pd()
570 pd->ps = ps; in padata_alloc_pd()
627 static int padata_replace_one(struct padata_shell *ps) in padata_replace_one() argument
631 pd_new = padata_alloc_pd(ps); in padata_replace_one()
635 ps->opd = rcu_dereference_protected(ps->pd, 1); in padata_replace_one()
636 rcu_assign_pointer(ps->pd, pd_new); in padata_replace_one()
643 struct padata_shell *ps; in padata_replace() local
648 list_for_each_entry(ps, &pinst->pslist, list) { in padata_replace()
649 err = padata_replace_one(ps); in padata_replace()
656 list_for_each_entry_continue_reverse(ps, &pinst->pslist, list) in padata_replace()
657 if (refcount_dec_and_test(&ps->opd->refcnt)) in padata_replace()
658 padata_free_pd(ps->opd); in padata_replace()
1056 struct padata_shell *ps; in padata_alloc_shell() local
1058 ps = kzalloc(sizeof(*ps), GFP_KERNEL); in padata_alloc_shell()
1059 if (!ps) in padata_alloc_shell()
1062 ps->pinst = pinst; in padata_alloc_shell()
1065 pd = padata_alloc_pd(ps); in padata_alloc_shell()
1072 RCU_INIT_POINTER(ps->pd, pd); in padata_alloc_shell()
1073 list_add(&ps->list, &pinst->pslist); in padata_alloc_shell()
1076 return ps; in padata_alloc_shell()
1079 kfree(ps); in padata_alloc_shell()
1090 void padata_free_shell(struct padata_shell *ps) in padata_free_shell() argument
1092 if (!ps) in padata_free_shell()
1095 mutex_lock(&ps->pinst->lock); in padata_free_shell()
1096 list_del(&ps->list); in padata_free_shell()
1097 padata_free_pd(rcu_dereference_protected(ps->pd, 1)); in padata_free_shell()
1098 mutex_unlock(&ps->pinst->lock); in padata_free_shell()
1100 kfree(ps); in padata_free_shell()