]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blobdiff - kernel/bpf/syscall.c
bpf: Add schedule points in batch ops
[mirror_ubuntu-jammy-kernel.git] / kernel / bpf / syscall.c
index ecd51a8a8680c8151c9a348a1713effe3520ad64..53384622e8dac34a69c5d5e50067b30a1e96dfe8 100644 (file)
@@ -1337,6 +1337,7 @@ int generic_map_delete_batch(struct bpf_map *map,
                maybe_wait_bpf_programs(map);
                if (err)
                        break;
+               cond_resched();
        }
        if (copy_to_user(&uattr->batch.count, &cp, sizeof(cp)))
                err = -EFAULT;
@@ -1394,6 +1395,7 @@ int generic_map_update_batch(struct bpf_map *map,
 
                if (err)
                        break;
+               cond_resched();
        }
 
        if (copy_to_user(&uattr->batch.count, &cp, sizeof(cp)))
@@ -1491,6 +1493,7 @@ int generic_map_lookup_batch(struct bpf_map *map,
                swap(prev_key, key);
                retry = MAP_LOOKUP_RETRIES;
                cp++;
+               cond_resched();
        }
 
        if (err == -EFAULT)