Lines Matching refs:thr

595 	struct task_struct *thr;                  /* thread */  member
618 d->thr = NULL; in crc32_threadfn()
637 struct task_struct *thr; /* thread */ member
665 d->thr = NULL; in compress_threadfn()
704 unsigned thr, run_threads, nr_threads; in save_compressed_image() local
744 for (thr = 0; thr < nr_threads; thr++) { in save_compressed_image()
745 init_waitqueue_head(&data[thr].go); in save_compressed_image()
746 init_waitqueue_head(&data[thr].done); in save_compressed_image()
748 data[thr].cc = crypto_alloc_comp(hib_comp_algo, 0, 0); in save_compressed_image()
749 if (IS_ERR_OR_NULL(data[thr].cc)) { in save_compressed_image()
750 pr_err("Could not allocate comp stream %ld\n", PTR_ERR(data[thr].cc)); in save_compressed_image()
755 data[thr].thr = kthread_run(compress_threadfn, in save_compressed_image()
756 &data[thr], in save_compressed_image()
757 "image_compress/%u", thr); in save_compressed_image()
758 if (IS_ERR(data[thr].thr)) { in save_compressed_image()
759 data[thr].thr = NULL; in save_compressed_image()
774 for (thr = 0; thr < nr_threads; thr++) { in save_compressed_image()
775 crc->unc[thr] = data[thr].unc; in save_compressed_image()
776 crc->unc_len[thr] = &data[thr].unc_len; in save_compressed_image()
779 crc->thr = kthread_run(crc32_threadfn, crc, "image_crc32"); in save_compressed_image()
780 if (IS_ERR(crc->thr)) { in save_compressed_image()
781 crc->thr = NULL; in save_compressed_image()
802 for (thr = 0; thr < nr_threads; thr++) { in save_compressed_image()
811 memcpy(data[thr].unc + off, in save_compressed_image()
822 data[thr].unc_len = off; in save_compressed_image()
824 atomic_set_release(&data[thr].ready, 1); in save_compressed_image()
825 wake_up(&data[thr].go); in save_compressed_image()
828 if (!thr) in save_compressed_image()
831 crc->run_threads = thr; in save_compressed_image()
835 for (run_threads = thr, thr = 0; thr < run_threads; thr++) { in save_compressed_image()
836 wait_event(data[thr].done, in save_compressed_image()
837 atomic_read_acquire(&data[thr].stop)); in save_compressed_image()
838 atomic_set(&data[thr].stop, 0); in save_compressed_image()
840 ret = data[thr].ret; in save_compressed_image()
847 if (unlikely(!data[thr].cmp_len || in save_compressed_image()
848 data[thr].cmp_len > in save_compressed_image()
849 bytes_worst_compress(data[thr].unc_len))) { in save_compressed_image()
855 *(size_t *)data[thr].cmp = data[thr].cmp_len; in save_compressed_image()
866 off < CMP_HEADER + data[thr].cmp_len; in save_compressed_image()
868 memcpy(page, data[thr].cmp + off, PAGE_SIZE); in save_compressed_image()
894 if (crc->thr) in save_compressed_image()
895 kthread_stop(crc->thr); in save_compressed_image()
899 for (thr = 0; thr < nr_threads; thr++) { in save_compressed_image()
900 if (data[thr].thr) in save_compressed_image()
901 kthread_stop(data[thr].thr); in save_compressed_image()
902 if (data[thr].cc) in save_compressed_image()
903 crypto_free_comp(data[thr].cc); in save_compressed_image()
1144 struct task_struct *thr; /* thread */ member
1169 d->thr = NULL; in decompress_threadfn()
1210 unsigned i, thr, run_threads, nr_threads; in load_compressed_image() local
1253 for (thr = 0; thr < nr_threads; thr++) { in load_compressed_image()
1254 init_waitqueue_head(&data[thr].go); in load_compressed_image()
1255 init_waitqueue_head(&data[thr].done); in load_compressed_image()
1257 data[thr].cc = crypto_alloc_comp(hib_comp_algo, 0, 0); in load_compressed_image()
1258 if (IS_ERR_OR_NULL(data[thr].cc)) { in load_compressed_image()
1259 pr_err("Could not allocate comp stream %ld\n", PTR_ERR(data[thr].cc)); in load_compressed_image()
1264 data[thr].thr = kthread_run(decompress_threadfn, in load_compressed_image()
1265 &data[thr], in load_compressed_image()
1266 "image_decompress/%u", thr); in load_compressed_image()
1267 if (IS_ERR(data[thr].thr)) { in load_compressed_image()
1268 data[thr].thr = NULL; in load_compressed_image()
1283 for (thr = 0; thr < nr_threads; thr++) { in load_compressed_image()
1284 crc->unc[thr] = data[thr].unc; in load_compressed_image()
1285 crc->unc_len[thr] = &data[thr].unc_len; in load_compressed_image()
1288 crc->thr = kthread_run(crc32_threadfn, crc, "image_crc32"); in load_compressed_image()
1289 if (IS_ERR(crc->thr)) { in load_compressed_image()
1290 crc->thr = NULL; in load_compressed_image()
1383 for (thr = 0; have && thr < nr_threads; thr++) { in load_compressed_image()
1384 data[thr].cmp_len = *(size_t *)page[pg]; in load_compressed_image()
1385 if (unlikely(!data[thr].cmp_len || in load_compressed_image()
1386 data[thr].cmp_len > in load_compressed_image()
1393 need = DIV_ROUND_UP(data[thr].cmp_len + CMP_HEADER, in load_compressed_image()
1404 off < CMP_HEADER + data[thr].cmp_len; in load_compressed_image()
1406 memcpy(data[thr].cmp + off, in load_compressed_image()
1414 atomic_set_release(&data[thr].ready, 1); in load_compressed_image()
1415 wake_up(&data[thr].go); in load_compressed_image()
1431 for (run_threads = thr, thr = 0; thr < run_threads; thr++) { in load_compressed_image()
1432 wait_event(data[thr].done, in load_compressed_image()
1433 atomic_read_acquire(&data[thr].stop)); in load_compressed_image()
1434 atomic_set(&data[thr].stop, 0); in load_compressed_image()
1436 ret = data[thr].ret; in load_compressed_image()
1443 if (unlikely(!data[thr].unc_len || in load_compressed_image()
1444 data[thr].unc_len > UNC_SIZE || in load_compressed_image()
1445 data[thr].unc_len & (PAGE_SIZE - 1))) { in load_compressed_image()
1452 off < data[thr].unc_len; off += PAGE_SIZE) { in load_compressed_image()
1454 data[thr].unc + off, PAGE_SIZE); in load_compressed_image()
1463 crc->run_threads = thr + 1; in load_compressed_image()
1471 crc->run_threads = thr; in load_compressed_image()
1502 if (crc->thr) in load_compressed_image()
1503 kthread_stop(crc->thr); in load_compressed_image()
1507 for (thr = 0; thr < nr_threads; thr++) { in load_compressed_image()
1508 if (data[thr].thr) in load_compressed_image()
1509 kthread_stop(data[thr].thr); in load_compressed_image()
1510 if (data[thr].cc) in load_compressed_image()
1511 crypto_free_comp(data[thr].cc); in load_compressed_image()