In linux CFS scheduler, how do we know a task has a task_group or not?
===

I want to some CPU CFS bandwidth control. The structure cfs_bandwidth is inside the structure task_group. However, not every task is associated with a task_group because some task may be just a task and not belong to any group.
I have found this function:

    static inline struct task_group *task_group(struct task_struct *p)
    {
    	struct task_group *tg;
    	struct cgroup_subsys_state *css;
    
    	css = task_subsys_state_check(p, cpu_cgroup_subsys_id,
    			lockdep_is_held(&p->pi_lock) ||
    			lockdep_is_held(&task_rq(p)->lock));
    	tg = container_of(css, struct task_group, css);
    
    	return autogroup_task_group(p, tg);
    }
I do not know if I give a task with no task_group to this function, whether a NULL will return or not?