linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: Michal Hocko <mhocko@kernel.org>
Cc: akpm@linux-foundation.org, aarcange@redhat.com,
	alexander.h.duyck@linux.intel.com, dan.j.williams@intel.com,
	dave.hansen@intel.com, konrad.wilk@oracle.com,
	lcapitulino@redhat.com, mgorman@techsingularity.net,
	mm-commits@vger.kernel.org, mst@redhat.com, osalvador@suse.de,
	pagupta@redhat.com, pbonzini@redhat.com, riel@surriel.com,
	vbabka@suse.cz, wei.w.wang@intel.com, willy@infradead.org,
	yang.zhang.wz@gmail.com, linux-mm@kvack.org
Subject: Re: + mm-introduce-reported-pages.patch added to -mm tree
Date: Wed, 6 Nov 2019 15:09:47 +0100	[thread overview]
Message-ID: <CD4A882A-91A7-43F2-B31C-3FFD85289907@redhat.com> (raw)
In-Reply-To: <20191106121605.GH8314@dhcp22.suse.cz>



> Am 06.11.2019 um 13:16 schrieb Michal Hocko <mhocko@kernel.org>:
> 
> I didn't have time to read through newer versions of this patch series
> but I remember there were concerns about this functionality being pulled
> into the page allocator previously both by me and Mel [1][2]. Have those been 
> addressed? I do not see an ack from Mel or any other MM people. Is there
> really a consensus that we want something like that living in the
> allocator?

I don‘t think there is. The discussion is still ongoing (although quiet, Nitesh is working on a new version AFAIK). I think we should not rush this.

> 
> There has also been a different approach discussed and from [3]
> (referenced by the cover letter) I can only see
> 
> : Then Nitesh's solution had changed to the bitmap approach[7]. However it
> : has been pointed out that this solution doesn't deal with sparse memory,
> : hotplug, and various other issues.
> 
> which looks more like something to be done than a fundamental
> roadblocks.

I second that. As I stated a couple of times already, it is totally fine to not support all environments initially (hotunplug, sparse zones). The major difference I am interested in is performance comparison. Then we have to decide if the gain in performance is worth core buddy modifications.

> 
> [1] http://lkml.kernel.org/r/20190912163525.GV2739@techsingularity.net
> [2] http://lkml.kernel.org/r/20190912091925.GM4023@dhcp22.suse.cz
> [3] http://lkml.kernel.org/r/29f43d5796feed0dec8e8bb98b187d9dac03b900.camel@linux.intel.com
> 
>> On Tue 05-11-19 16:05:47, Andrew Morton wrote:
>> From: Alexander Duyck <alexander.h.duyck@linux.intel.com>
>> Subject: mm: introduce Reported pages
>> 
>> In order to pave the way for free page reporting in virtualized
>> environments we will need a way to get pages out of the free lists and
>> identify those pages after they have been returned.  To accomplish this,
>> this patch adds the concept of a Reported Buddy, which is essentially
>> meant to just be the Uptodate flag used in conjunction with the Buddy page
>> type.
>> 
>> It adds a set of pointers we shall call "reported_boundary" which
>> represent the upper boundary between the unreported and reported pages. 
>> The general idea is that in order for a page to cross from one side of the
>> boundary to the other it will need to verify that it went through the
>> reporting process.  Ultimately a free list has been fully processed when
>> the boundary has been moved from the tail all they way up to occupying the
>> first entry in the list.  Without this we would have to manually walk the
>> entire page list until we have find a page that hasn't been reported.  In
>> my testing this adds as much as 18% additional overhead which would make
>> this unattractive as a solution.
>> 
>> One limitation to this approach is that it is essentially a linear search
>> and in the case of the free lists we can have pages added to either the
>> head or the tail of the list.  In order to place limits on this we only
>> allow pages to be added before the reported_boundary instead of adding to
>> the tail itself.  An added advantage to this approach is that we should be
>> reducing the overall memory footprint of the guest as it will be more
>> likely to recycle warm pages versus trying to allocate the reported pages
>> that were likely evicted from the guest memory.
>> 
>> Since we will only be reporting one zone at a time we keep the boundary
>> limited to being defined for just the zone we are currently reporting
>> pages from.  Doing this we can keep the number of additional pointers
>> needed quite small.  To flag that the boundaries are in place we use a
>> single bit in the zone to indicate that reporting and the boundaries are
>> active.
>> 
>> We store the index of the boundary pointer used to track the reported page
>> in the page->index value.  Doing this we can avoid unnecessary computation
>> to determine the index value again.  There should be no issues with this
>> as the value is unused when the page is in the buddy allocator, and is
>> reset as soon as the page is removed from the free list.
>> 
>> Link: http://lkml.kernel.org/r/20191105220219.15144.69031.stgit@localhost.localdomain
>> Signed-off-by: Alexander Duyck <alexander.h.duyck@linux.intel.com>
>> Cc: Andrea Arcangeli <aarcange@redhat.com>
>> Cc: Dan Williams <dan.j.williams@intel.com>
>> Cc: Dave Hansen <dave.hansen@intel.com>
>> Cc: David Hildenbrand <david@redhat.com>
>> Cc: <konrad.wilk@oracle.com>
>> Cc: Luiz Capitulino <lcapitulino@redhat.com>
>> Cc: Matthew Wilcox <willy@infradead.org>
>> Cc: Mel Gorman <mgorman@techsingularity.net>
>> Cc: Michael S. Tsirkin <mst@redhat.com>
>> Cc: Michal Hocko <mhocko@kernel.org>
>> Cc: Oscar Salvador <osalvador@suse.de>
>> Cc: Pankaj Gupta <pagupta@redhat.com>
>> Cc: Paolo Bonzini <pbonzini@redhat.com>
>> Cc: Rik van Riel <riel@surriel.com>
>> Cc: Vlastimil Babka <vbabka@suse.cz>
>> Cc: Wei Wang <wei.w.wang@intel.com>
>> Cc: Yang Zhang <yang.zhang.wz@gmail.com>
>> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> -- 
> Michal Hocko
> SUSE Labs


  reply	other threads:[~2019-11-06 14:09 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20191106000547.juQRi83gi%akpm@linux-foundation.org>
2019-11-06 12:16 ` Michal Hocko
2019-11-06 14:09   ` David Hildenbrand [this message]
2019-11-06 16:35     ` Alexander Duyck
2019-11-06 16:54       ` Michal Hocko
2019-11-06 17:48         ` Alexander Duyck
2019-11-06 22:11           ` Mel Gorman
2019-11-06 23:38             ` David Hildenbrand
2019-11-07  0:20             ` Alexander Duyck
2019-11-07 10:20               ` Mel Gorman
2019-11-07 16:07                 ` Alexander Duyck
2019-11-08  9:43                   ` Mel Gorman
2019-11-08 16:17                     ` Alexander Duyck
2019-11-08 18:41                       ` Mel Gorman
2019-11-08 20:29                         ` Alexander Duyck
2019-11-09 14:57                           ` Mel Gorman
2019-11-10 18:03                             ` Alexander Duyck
2019-11-06 23:33           ` David Hildenbrand
2019-11-07  0:20             ` Dave Hansen
2019-11-07  0:52               ` David Hildenbrand
2019-11-07 17:12                 ` Dave Hansen
2019-11-07 17:46                   ` Michal Hocko
2019-11-07 18:08                     ` Dave Hansen
2019-11-07 18:12                     ` Alexander Duyck
2019-11-08  9:57                       ` Michal Hocko
2019-11-08 16:43                         ` Alexander Duyck
2019-11-07 18:46                   ` Qian Cai
2019-11-07 18:02             ` Alexander Duyck
2019-11-07 19:37               ` Nitesh Narayan Lal
2019-11-07 22:46                 ` Alexander Duyck
2019-11-07 22:43               ` David Hildenbrand
2019-11-08  0:42                 ` Alexander Duyck
2019-11-08  7:06                   ` David Hildenbrand
2019-11-08 17:18                     ` Alexander Duyck
2019-11-12 13:04                       ` David Hildenbrand
2019-11-12 18:34                         ` Alexander Duyck
2019-11-12 21:05                           ` David Hildenbrand
2019-11-12 22:17                             ` David Hildenbrand
2019-11-12 22:19                             ` Alexander Duyck
2019-11-12 23:10                               ` David Hildenbrand
2019-11-13  0:31                                 ` Alexander Duyck
2019-11-13 18:51                           ` Nitesh Narayan Lal
2019-11-06 16:49   ` Nitesh Narayan Lal
2019-11-11 18:52   ` Nitesh Narayan Lal
2019-11-11 22:00     ` Alexander Duyck
2019-11-12 15:19       ` Nitesh Narayan Lal
2019-11-12 16:18         ` Alexander Duyck
2019-11-13 18:39           ` Nitesh Narayan Lal

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=CD4A882A-91A7-43F2-B31C-3FFD85289907@redhat.com \
    --to=david@redhat.com \
    --cc=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=alexander.h.duyck@linux.intel.com \
    --cc=dan.j.williams@intel.com \
    --cc=dave.hansen@intel.com \
    --cc=konrad.wilk@oracle.com \
    --cc=lcapitulino@redhat.com \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@techsingularity.net \
    --cc=mhocko@kernel.org \
    --cc=mm-commits@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=osalvador@suse.de \
    --cc=pagupta@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=riel@surriel.com \
    --cc=vbabka@suse.cz \
    --cc=wei.w.wang@intel.com \
    --cc=willy@infradead.org \
    --cc=yang.zhang.wz@gmail.com \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox