Lines Matching refs:thr
596 struct task_struct *thr; /* thread */ member
619 d->thr = NULL; in crc32_threadfn()
638 struct task_struct *thr; /* thread */ member
666 d->thr = NULL; in compress_threadfn()
707 unsigned thr, run_threads, nr_threads; in save_compressed_image() local
747 for (thr = 0; thr < nr_threads; thr++) { in save_compressed_image()
748 init_waitqueue_head(&data[thr].go); in save_compressed_image()
749 init_waitqueue_head(&data[thr].done); in save_compressed_image()
751 data[thr].cc = crypto_alloc_acomp(hib_comp_algo, 0, CRYPTO_ALG_ASYNC); in save_compressed_image()
752 if (IS_ERR_OR_NULL(data[thr].cc)) { in save_compressed_image()
753 pr_err("Could not allocate comp stream %ld\n", PTR_ERR(data[thr].cc)); in save_compressed_image()
758 data[thr].cr = acomp_request_alloc(data[thr].cc); in save_compressed_image()
759 if (!data[thr].cr) { in save_compressed_image()
765 data[thr].thr = kthread_run(compress_threadfn, in save_compressed_image()
766 &data[thr], in save_compressed_image()
767 "image_compress/%u", thr); in save_compressed_image()
768 if (IS_ERR(data[thr].thr)) { in save_compressed_image()
769 data[thr].thr = NULL; in save_compressed_image()
784 for (thr = 0; thr < nr_threads; thr++) { in save_compressed_image()
785 crc->unc[thr] = data[thr].unc; in save_compressed_image()
786 crc->unc_len[thr] = &data[thr].unc_len; in save_compressed_image()
789 crc->thr = kthread_run(crc32_threadfn, crc, "image_crc32"); in save_compressed_image()
790 if (IS_ERR(crc->thr)) { in save_compressed_image()
791 crc->thr = NULL; in save_compressed_image()
812 for (thr = 0; thr < nr_threads; thr++) { in save_compressed_image()
821 memcpy(data[thr].unc + off, in save_compressed_image()
832 data[thr].unc_len = off; in save_compressed_image()
834 atomic_set_release(&data[thr].ready, 1); in save_compressed_image()
835 wake_up(&data[thr].go); in save_compressed_image()
838 if (!thr) in save_compressed_image()
841 crc->run_threads = thr; in save_compressed_image()
845 for (run_threads = thr, thr = 0; thr < run_threads; thr++) { in save_compressed_image()
846 wait_event(data[thr].done, in save_compressed_image()
847 atomic_read_acquire(&data[thr].stop)); in save_compressed_image()
848 atomic_set(&data[thr].stop, 0); in save_compressed_image()
850 ret = data[thr].ret; in save_compressed_image()
857 if (unlikely(!data[thr].cmp_len || in save_compressed_image()
858 data[thr].cmp_len > in save_compressed_image()
859 bytes_worst_compress(data[thr].unc_len))) { in save_compressed_image()
865 *(size_t *)data[thr].cmp = data[thr].cmp_len; in save_compressed_image()
876 off < CMP_HEADER + data[thr].cmp_len; in save_compressed_image()
878 memcpy(page, data[thr].cmp + off, PAGE_SIZE); in save_compressed_image()
904 if (crc->thr) in save_compressed_image()
905 kthread_stop(crc->thr); in save_compressed_image()
909 for (thr = 0; thr < nr_threads; thr++) { in save_compressed_image()
910 if (data[thr].thr) in save_compressed_image()
911 kthread_stop(data[thr].thr); in save_compressed_image()
912 acomp_request_free(data[thr].cr); in save_compressed_image()
913 crypto_free_acomp(data[thr].cc); in save_compressed_image()
1154 struct task_struct *thr; /* thread */ member
1179 d->thr = NULL; in decompress_threadfn()
1223 unsigned i, thr, run_threads, nr_threads; in load_compressed_image() local
1266 for (thr = 0; thr < nr_threads; thr++) { in load_compressed_image()
1267 init_waitqueue_head(&data[thr].go); in load_compressed_image()
1268 init_waitqueue_head(&data[thr].done); in load_compressed_image()
1270 data[thr].cc = crypto_alloc_acomp(hib_comp_algo, 0, CRYPTO_ALG_ASYNC); in load_compressed_image()
1271 if (IS_ERR_OR_NULL(data[thr].cc)) { in load_compressed_image()
1272 pr_err("Could not allocate comp stream %ld\n", PTR_ERR(data[thr].cc)); in load_compressed_image()
1277 data[thr].cr = acomp_request_alloc(data[thr].cc); in load_compressed_image()
1278 if (!data[thr].cr) { in load_compressed_image()
1284 data[thr].thr = kthread_run(decompress_threadfn, in load_compressed_image()
1285 &data[thr], in load_compressed_image()
1286 "image_decompress/%u", thr); in load_compressed_image()
1287 if (IS_ERR(data[thr].thr)) { in load_compressed_image()
1288 data[thr].thr = NULL; in load_compressed_image()
1303 for (thr = 0; thr < nr_threads; thr++) { in load_compressed_image()
1304 crc->unc[thr] = data[thr].unc; in load_compressed_image()
1305 crc->unc_len[thr] = &data[thr].unc_len; in load_compressed_image()
1308 crc->thr = kthread_run(crc32_threadfn, crc, "image_crc32"); in load_compressed_image()
1309 if (IS_ERR(crc->thr)) { in load_compressed_image()
1310 crc->thr = NULL; in load_compressed_image()
1403 for (thr = 0; have && thr < nr_threads; thr++) { in load_compressed_image()
1404 data[thr].cmp_len = *(size_t *)page[pg]; in load_compressed_image()
1405 if (unlikely(!data[thr].cmp_len || in load_compressed_image()
1406 data[thr].cmp_len > in load_compressed_image()
1413 need = DIV_ROUND_UP(data[thr].cmp_len + CMP_HEADER, in load_compressed_image()
1424 off < CMP_HEADER + data[thr].cmp_len; in load_compressed_image()
1426 memcpy(data[thr].cmp + off, in load_compressed_image()
1434 atomic_set_release(&data[thr].ready, 1); in load_compressed_image()
1435 wake_up(&data[thr].go); in load_compressed_image()
1451 for (run_threads = thr, thr = 0; thr < run_threads; thr++) { in load_compressed_image()
1452 wait_event(data[thr].done, in load_compressed_image()
1453 atomic_read_acquire(&data[thr].stop)); in load_compressed_image()
1454 atomic_set(&data[thr].stop, 0); in load_compressed_image()
1456 ret = data[thr].ret; in load_compressed_image()
1463 if (unlikely(!data[thr].unc_len || in load_compressed_image()
1464 data[thr].unc_len > UNC_SIZE || in load_compressed_image()
1465 data[thr].unc_len & (PAGE_SIZE - 1))) { in load_compressed_image()
1472 off < data[thr].unc_len; off += PAGE_SIZE) { in load_compressed_image()
1474 data[thr].unc + off, PAGE_SIZE); in load_compressed_image()
1483 crc->run_threads = thr + 1; in load_compressed_image()
1491 crc->run_threads = thr; in load_compressed_image()
1522 if (crc->thr) in load_compressed_image()
1523 kthread_stop(crc->thr); in load_compressed_image()
1527 for (thr = 0; thr < nr_threads; thr++) { in load_compressed_image()
1528 if (data[thr].thr) in load_compressed_image()
1529 kthread_stop(data[thr].thr); in load_compressed_image()
1530 acomp_request_free(data[thr].cr); in load_compressed_image()
1531 crypto_free_acomp(data[thr].cc); in load_compressed_image()