函数源码

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source File:fs\io-wq.c Create Date:2022-07-29 10:55:36
首页 Copyright©Brick

271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
/*
 * We need a worker. If we find a free one, we're good. If not, and we're
 * below the max number of workers, wake up the manager to create one.
 */
static void io_wqe_wake_worker(struct io_wqe *wqe, struct io_wqe_acct *acct)
{
    bool ret;
 
    /*
     * Most likely an attempt to queue unbounded work on an io_wq that
     * wasn't setup with any unbounded workers.
     */
    WARN_ON_ONCE(!acct->max_workers);
 
    rcu_read_lock();
    ret = io_wqe_activate_free_worker(wqe);
    rcu_read_unlock();
 
    if (!ret && acct->nr_workers < acct->max_workers)
        wake_up_process(wqe->wq->manager);
}