Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

cgroup: switch to css_is_online() helper

Use the new css_is_online() helper that has been introduced to check css
online state, instead of testing the CSS_ONLINE flag directly. This
improves readability and centralizes the state check logic.

No functional changes intended.

Signed-off-by: Chen Ridong <chenridong@huawei.com>
Acked-by: Shakeel Butt <shakeel.butt@linux.dev>
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Tejun Heo <tj@kernel.org>

authored by

Chen Ridong and committed by
Tejun Heo
82d7e59e 50133c09

+6 -6
+1 -1
fs/fs-writeback.c
··· 981 981 982 982 css = mem_cgroup_css_from_folio(folio); 983 983 /* dead cgroups shouldn't contribute to inode ownership arbitration */ 984 - if (!(css->flags & CSS_ONLINE)) 984 + if (!css_is_online(css)) 985 985 return; 986 986 987 987 id = css->id;
+1 -1
include/linux/memcontrol.h
··· 893 893 { 894 894 if (mem_cgroup_disabled()) 895 895 return true; 896 - return !!(memcg->css.flags & CSS_ONLINE); 896 + return css_is_online(&memcg->css); 897 897 } 898 898 899 899 void mem_cgroup_update_lru_size(struct lruvec *lruvec, enum lru_list lru,
+2 -2
kernel/cgroup/cgroup.c
··· 4948 4948 4949 4949 rcu_read_lock(); 4950 4950 css_for_each_child(child, css) { 4951 - if (child->flags & CSS_ONLINE) { 4951 + if (css_is_online(child)) { 4952 4952 ret = true; 4953 4953 break; 4954 4954 } ··· 5753 5753 5754 5754 lockdep_assert_held(&cgroup_mutex); 5755 5755 5756 - if (!(css->flags & CSS_ONLINE)) 5756 + if (!css_is_online(css)) 5757 5757 return; 5758 5758 5759 5759 if (ss->css_offline)
+1 -1
mm/memcontrol.c
··· 281 281 /* page_folio() is racy here, but the entire function is racy anyway */ 282 282 memcg = folio_memcg_check(page_folio(page)); 283 283 284 - while (memcg && !(memcg->css.flags & CSS_ONLINE)) 284 + while (memcg && !css_is_online(&memcg->css)) 285 285 memcg = parent_mem_cgroup(memcg); 286 286 if (memcg) 287 287 ino = cgroup_ino(memcg->css.cgroup);
+1 -1
mm/page_owner.c
··· 530 530 if (!memcg) 531 531 goto out_unlock; 532 532 533 - online = (memcg->css.flags & CSS_ONLINE); 533 + online = css_is_online(&memcg->css); 534 534 cgroup_name(memcg->css.cgroup, name, sizeof(name)); 535 535 ret += scnprintf(kbuf + ret, count - ret, 536 536 "Charged %sto %smemcg %s\n",