Hi Michal, Michal Koutný <mkoutny@xxxxxxxx> writes: >> + if (!page_counter_try_charge(&h_cg->hugepage[idx], nr_pages, >> + &counter)) { >> ret = -ENOMEM; >> + hugetlb_event(h_cg, idx, HUGETLB_MAX); > Here should be something like > > - hugetlb_event(h_cg, idx, HUGETLB_MAX); > + hugetlb_event(hugetlb_cgroup_from_counter(counter), idx, HUGETLB_MAX); > > in order to have consistent behavior with memcg events (because > page_counter_try_charge may fail higher in the hierarchy than h_cg). thanks for the review and the hint. I've sent another version, where the event is generated in the correct cgroup as memcg does. Giuseppe