函数源码

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source File:mm\oom_kill.c Create Date:2022-07-27 15:28:56
首页 Copyright©Brick

119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
#else
static bool oom_cpuset_eligible(struct task_struct *tsk, struct oom_control *oc)
{
    return true;
}
#endif /* CONFIG_NUMA */
 
/*
 * The process p may have detached its own ->mm while exiting or through
 * use_mm(), but one or more of its subthreads may still have a valid
 * pointer.  Return p, or any of its subthreads with a valid ->mm, with
 * task_lock() held.
 */
struct task_struct *find_lock_task_mm(struct task_struct *p)
{
    struct task_struct *t;
 
    rcu_read_lock();
 
    for_each_thread(p, t) {
        task_lock(t);
        if (likely(t->mm))
            goto found;
        task_unlock(t);
    }
    t = NULL;
found:
    rcu_read_unlock();
 
    return t;
}