Linux-kselftest Archive on lore.kernel.org
 help / color / Atom feed
From: Mike Kravetz <mike.kravetz@oracle.com>
To: Mina Almasry <almasrymina@google.com>
Cc: shuah <shuah@kernel.org>, David Rientjes <rientjes@google.com>,
	Shakeel Butt <shakeelb@google.com>,
	Greg Thelen <gthelen@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	open list <linux-kernel@vger.kernel.org>,
	linux-mm@kvack.org, linux-kselftest@vger.kernel.org,
	cgroups@vger.kernel.org
Subject: Re: [PATCH v11 4/9] hugetlb: disable region_add file_region coalescing
Date: Wed, 5 Feb 2020 18:12:26 -0800
Message-ID: <dd097d06-6ac8-08b6-d484-b6bfc5922a70@oracle.com> (raw)
In-Reply-To: <CAHS8izONQEGMHJVR3cpgbn+LbYZ9eYa4jNkOwkCYwpGBHXHm8Q@mail.gmail.com>

On 2/5/20 5:43 PM, Mina Almasry wrote:
> On Wed, Feb 5, 2020 at 3:57 PM Mike Kravetz <mike.kravetz@oracle.com> wrote:
>>
>> On 2/3/20 3:22 PM, Mina Almasry wrote:
>>> A follow up patch in this series adds hugetlb cgroup uncharge info the
>>> file_region entries in resv->regions. The cgroup uncharge info may
>>> differ for different regions, so they can no longer be coalesced at
>>> region_add time. So, disable region coalescing in region_add in this
>>> patch.
>>>
>>> Behavior change:
>>>
>>> Say a resv_map exists like this [0->1], [2->3], and [5->6].
>>>
>>> Then a region_chg/add call comes in region_chg/add(f=0, t=5).
>>>
>>> Old code would generate resv->regions: [0->5], [5->6].
>>> New code would generate resv->regions: [0->1], [1->2], [2->3], [3->5],
>>> [5->6].
>>>
>>> Special care needs to be taken to handle the resv->adds_in_progress
>>> variable correctly. In the past, only 1 region would be added for every
>>> region_chg and region_add call. But now, each call may add multiple
>>> regions, so we can no longer increment adds_in_progress by 1 in region_chg,
>>> or decrement adds_in_progress by 1 after region_add or region_abort. Instead,
>>> region_chg calls add_reservation_in_range() to count the number of regions
>>> needed and allocates those, and that info is passed to region_add and
>>> region_abort to decrement adds_in_progress correctly.
>>>
>>> We've also modified the assumption that region_add after region_chg
>>> never fails. region_chg now pre-allocates at least 1 region for
>>> region_add. If region_add needs more regions than region_chg has
>>> allocated for it, then it may fail.
>>>
>>> Signed-off-by: Mina Almasry <almasrymina@google.com>
>>> Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com>
>>
>> This is the same as the previous version.  My late comment was that we
>> need to rethink the disabling of region coalescing.  This is especially
>> important for private mappings where there will be one region for huge
>> page.  I know that you are working on this issue.  Please remove my
>> Reviewed-by: when sending out the next version.
>>
> 
> Yes to address that there is a new patch in the series, which
> re-enables the coalescing when the hugetlb cgroup uncharge info is the
> same. I guess it could be squashed with this one but I thought it was
> better to implement that patch on top of the patch that enabled shared
> accounting, because that is the patch that sets hugetlb cgroup info on
> the file region entries.
> 
> Let me know what you think.

Thanks, I saw there was an additional patch but I did not get to it yet.
I'll take a look and see how involved the changes are.

-- 
Mike Kravetz

  reply index

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-03 23:22 [PATCH v11 1/9] hugetlb_cgroup: Add hugetlb_cgroup reservation counter Mina Almasry
2020-02-03 23:22 ` [PATCH v11 2/9] hugetlb_cgroup: add interface for charge/uncharge hugetlb reservations Mina Almasry
2020-02-05 22:08   ` Mike Kravetz
2020-02-06 18:16     ` Mina Almasry
2020-02-03 23:22 ` [PATCH v11 3/9] hugetlb_cgroup: add reservation accounting for private mappings Mina Almasry
2020-02-05 23:26   ` Mike Kravetz
2020-02-03 23:22 ` [PATCH v11 4/9] hugetlb: disable region_add file_region coalescing Mina Almasry
2020-02-05 23:57   ` Mike Kravetz
2020-02-06  1:43     ` Mina Almasry
2020-02-06  2:12       ` Mike Kravetz [this message]
2020-02-03 23:22 ` [PATCH v11 5/9] hugetlb_cgroup: add accounting for shared mappings Mina Almasry
2020-02-06 19:33   ` Mike Kravetz
2020-02-06 20:09     ` Mina Almasry
2020-02-03 23:22 ` [PATCH v11 6/9] hugetlb_cgroup: support noreserve mappings Mina Almasry
2020-02-06 22:31   ` Mike Kravetz
2020-02-07 18:16     ` Mike Kravetz
2020-02-11 21:35     ` Mina Almasry
2020-02-11 21:51       ` Mike Kravetz
2020-02-03 23:22 ` [PATCH v11 7/9] hugetlb: support file_region coalescing again Mina Almasry
2020-02-07  0:17   ` Mike Kravetz
2020-02-07 18:44     ` Mina Almasry
2020-02-03 23:22 ` [PATCH v11 8/9] hugetlb_cgroup: Add hugetlb_cgroup reservation tests Mina Almasry
2020-02-04 16:26   ` Sandipan Das
2020-02-04 20:36     ` Mina Almasry
2020-02-04 22:33       ` Mina Almasry
2020-02-05 12:42         ` Sandipan Das
2020-02-05 18:03           ` Mina Almasry
2020-02-03 23:22 ` [PATCH v11 9/9] hugetlb_cgroup: Add hugetlb_cgroup reservation docs Mina Almasry
2020-02-05 19:36 ` [PATCH v11 1/9] hugetlb_cgroup: Add hugetlb_cgroup reservation counter Mike Kravetz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=dd097d06-6ac8-08b6-d484-b6bfc5922a70@oracle.com \
    --to=mike.kravetz@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=almasrymina@google.com \
    --cc=cgroups@vger.kernel.org \
    --cc=gthelen@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=rientjes@google.com \
    --cc=shakeelb@google.com \
    --cc=shuah@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-kselftest Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-kselftest/0 linux-kselftest/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-kselftest linux-kselftest/ https://lore.kernel.org/linux-kselftest \
		linux-kselftest@vger.kernel.org
	public-inbox-index linux-kselftest

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-kselftest


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git