Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1379809

Re: [patch v2] mm, hugetlb_cgroup: round limit_in_bytes down to hugepage size

From Michal Hocko <mhocko@kernel.org>
Newsgroups linux.kernel
Subject Re: [patch v2] mm, hugetlb_cgroup: round limit_in_bytes down to hugepage size
Date 2016-04-15 15:30 +0200
Message-ID <robYR-3E4-3@gated-at.bofh.it> (permalink)
References (1 earlier) <rkQ4y-nZ-9@gated-at.bofh.it> <rkQee-sD-11@gated-at.bofh.it> <rl3XP-2ep-3@gated-at.bofh.it> <rlhHs-3TE-19@gated-at.bofh.it> <rnW3L-7VI-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu 14-04-16 13:22:30, David Rientjes wrote:
> On Thu, 7 Apr 2016, Michal Hocko wrote:
> 
> > > +static void hugetlb_cgroup_init(struct hugetlb_cgroup *h_cgroup,
> > > +				struct hugetlb_cgroup *parent_h_cgroup)
> > > +{
> > > +	int idx;
> > > +
> > > +	for (idx = 0; idx < HUGE_MAX_HSTATE; idx++) {
> > > +		struct page_counter *counter = &h_cgroup->hugepage[idx];
> > > +		struct page_counter *parent = NULL;
> > > +		unsigned long limit;
> > > +		int ret;
> > > +
> > > +		if (parent_h_cgroup)
> > > +			parent = &parent_h_cgroup->hugepage[idx];
> > > +		page_counter_init(counter, parent);
> > > +
> > > +		limit = round_down(PAGE_COUNTER_MAX,
> > > +				   1 << huge_page_order(&hstates[idx]));
> > > +		ret = page_counter_limit(counter, limit);
> > > +		VM_BUG_ON(ret);
> > > +	}
> > > +}
> > 
> > I fail to see the point for this. Why would want to round down
> > PAGE_COUNTER_MAX? It will never make a real difference. Or am I missing
> > something?
> 
> Did you try the patch?
> 
> If we're rounding down the user value, it makes sense to be consistent 
> with the upper bound default to specify intent.

The point I've tried to raise is why do we care and add a code if we can
never reach that value? Does actually anybody checks for the alignment.
-- 
Michal Hocko
SUSE Labs

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[patch] mm, hugetlb_cgroup: round limit_in_bytes down to hugepage  size David Rientjes <rientjes@google.com> - 2016-04-06 03:30 +0200
  Re: [patch] mm, hugetlb_cgroup: round limit_in_bytes down to hugepage  size Nikolay Borisov <kernel@kyup.com> - 2016-04-06 09:30 +0200
    Re: [patch] mm, hugetlb_cgroup: round limit_in_bytes down to hugepage  size Nikolay Borisov <kernel@kyup.com> - 2016-04-06 09:40 +0200
      Re: [patch] mm, hugetlb_cgroup: round limit_in_bytes down to  hugepage size Michal Hocko <mhocko@kernel.org> - 2016-04-06 11:20 +0200
      [patch v2] mm, hugetlb_cgroup: round limit_in_bytes down to hugepage  size David Rientjes <rientjes@google.com> - 2016-04-07 00:20 +0200
        Re: [patch v2] mm, hugetlb_cgroup: round limit_in_bytes down to  hugepage size Michal Hocko <mhocko@kernel.org> - 2016-04-07 15:00 +0200
          Re: [patch v2] mm, hugetlb_cgroup: round limit_in_bytes down to  hugepage size David Rientjes <rientjes@google.com> - 2016-04-14 22:30 +0200
            Re: [patch v2] mm, hugetlb_cgroup: round limit_in_bytes down to  hugepage size Michal Hocko <mhocko@kernel.org> - 2016-04-15 15:30 +0200
              Re: [patch v2] mm, hugetlb_cgroup: round limit_in_bytes down to  hugepage size David Rientjes <rientjes@google.com> - 2016-04-18 23:30 +0200
                Re: [patch v2] mm, hugetlb_cgroup: round limit_in_bytes down to  hugepage size Andrew Morton <akpm@linux-foundation.org> - 2016-04-26 00:00 +0200
                [patch v3] mm, hugetlb_cgroup: round limit_in_bytes down to hugepage  size David Rientjes <rientjes@google.com> - 2016-04-26 02:00 +0200
        Re: [patch v2] mm, hugetlb_cgroup: round limit_in_bytes down to  hugepage size David Rientjes <rientjes@google.com> - 2016-04-25 23:40 +0200

csiph-web