All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: Dave Hansen <dave.hansen@intel.com>,
	Nitesh Narayan Lal <nitesh@redhat.com>,
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org, pbonzini@redhat.com, lcapitulino@redhat.com,
	pagupta@redhat.com, wei.w.wang@intel.com,
	yang.zhang.wz@gmail.com, riel@surriel.com, mst@redhat.com,
	dodgen@google.com, konrad.wilk@oracle.com, dhildenb@redhat.com,
	aarcange@redhat.com, alexander.duyck@gmail.com,
	john.starks@microsoft.com, mhocko@suse.com
Subject: Re: [RFC][Patch v11 1/2] mm: page_hinting: core infrastructure
Date: Mon, 15 Jul 2019 11:26:13 +0200	[thread overview]
Message-ID: <0a89271f-c80b-9314-f6bb-8fdf0d714431@redhat.com> (raw)
In-Reply-To: <3f9a7e7b-c026-3530-e985-804fc7f1ec31@intel.com>

On 10.07.19 22:45, Dave Hansen wrote:
> On 7/10/19 12:51 PM, Nitesh Narayan Lal wrote:
>> +struct zone_free_area {
>> +	unsigned long *bitmap;
>> +	unsigned long base_pfn;
>> +	unsigned long end_pfn;
>> +	atomic_t free_pages;
>> +	unsigned long nbits;
>> +} free_area[MAX_NR_ZONES];
> 
> Why do we need an extra data structure.  What's wrong with putting
> per-zone data in ... 'struct zone'?  The cover letter claims that it
> doesn't touch core-mm infrastructure, but if it depends on mechanisms
> like this, I think that's a very bad thing.
> 
> To be honest, I'm not sure this series is worth reviewing at this point.
>  It's horribly lightly commented and full of kernel antipatterns lik
> 
> void func()
> {
> 	if () {
> 		... indent entire logic
> 		... of function
> 	}
> }

"full of". Hmm.

> 
> It has big "TODO"s.  It's virtually comment-free.  I'm shocked it's at
> the 11th version and still looking like this.
> 
>> +
>> +		for (zone_idx = 0; zone_idx < MAX_NR_ZONES; zone_idx++) {
>> +			unsigned long pages = free_area[zone_idx].end_pfn -
>> +					free_area[zone_idx].base_pfn;
>> +			bitmap_size = (pages >> PAGE_HINTING_MIN_ORDER) + 1;
>> +			if (!bitmap_size)
>> +				continue;
>> +			free_area[zone_idx].bitmap = bitmap_zalloc(bitmap_size,
>> +								   GFP_KERNEL);
> 
> This doesn't support sparse zones.  We can have zones with massive
> spanned page sizes, but very few present pages.  On those zones, this
> will exhaust memory for no good reason.

Yes, AFAIKS, sparse zones are problematic when we have NORMAL/MOVABLE mixed.

1 bit for 2MB, 1 byte for 16MB, 64 bytes for 1GB

IOW, this isn't optimal but only really problematic for big systems /
very huge sparse zones.

> 
> Comparing this to Alex's patch set, it's of much lower quality and at a
> much earlier stage of development.  The two sets are not really even
> comparable right now.  This certainly doesn't sell me on (or even really

To be honest, I find this statement quite harsh. Nitesh's hard work in
the previous RFC's and many discussions with Alex essentially resulted
in the two approaches we have right now. Alex's approach would not look
the way it looks today without Nitesh's RFCs.

So much to that.

> enumerate the deltas in) this approach vs. Alex's.

I am aware that memory hotplug is not properly supported yet (future
work). Sparse zones work but eventually waste a handful of pages (!) -
future work. Anything else you are aware of that is missing?

My opinion:

1. Alex' solution is clearly beneficial, as we don't need to manage/scan
a bitmap. *however* we were concerned right from the beginning if
core-buddy modifications will be accepted upstream for a purely
virtualization-specific (as of now!) feature. If we can get it upstream,
perfect. Back when we discussed the idea with Alex I was skeptical - I
was expecting way more core modifications.

2. We were looking for an alternative solution that doesn't require to
modify the buddy. We have that now - yes, some things have to be worked
out and cleaned up, not arguing against that. A cleaned-up version of
this RFC with some fixes and enhancements should be ready to be used in
*many* (not all) setups. Which is perfectly fine.

So in summary, I think we should try our best to get Alex's series into
shape and accepted upstream. However, if we get upstream resistance or
it will take ages to get it in, I think we can start with this series
here (which requires no major buddy modifications as of now) and the
slowly see if we can convert it into Alex approach.

The important part for me is that the core<->driver interface and the
virtio interface is in a clean shape, so we can essentially swap out the
implementation specific parts in the core.

Cheers.

-- 

Thanks,

David / dhildenb

  parent reply	other threads:[~2019-07-15  9:26 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-10 19:51 [RFC][PATCH v11 0/2] mm: Support for page hinting Nitesh Narayan Lal
2019-07-10 19:51 ` [RFC][Patch v11 1/2] mm: page_hinting: core infrastructure Nitesh Narayan Lal
2019-07-10 20:45   ` Dave Hansen
2019-07-11 11:48     ` Nitesh Narayan Lal
2019-07-11 15:25     ` Nitesh Narayan Lal
2019-07-11 15:50       ` Nitesh Narayan Lal
2019-07-11 16:22       ` Dave Hansen
2019-07-11 16:36         ` Nitesh Narayan Lal
2019-07-11 16:45           ` Dave Hansen
2019-07-11 16:52             ` Nitesh Narayan Lal
2019-07-15  9:26     ` David Hildenbrand [this message]
2019-07-10 21:56   ` Alexander Duyck
2019-07-10 21:56     ` Alexander Duyck
2019-07-11 17:58     ` Nitesh Narayan Lal
2019-07-11 23:20       ` Alexander Duyck
2019-07-11 23:20         ` Alexander Duyck
2019-07-12  1:12         ` Nitesh Narayan Lal
2019-07-12 16:22           ` Alexander Duyck
2019-07-12 16:22             ` Alexander Duyck
2019-07-12 16:25             ` Nitesh Narayan Lal
2019-08-08 11:41             ` Nitesh Narayan Lal
2019-07-11 18:21   ` Dave Hansen
2019-07-15  9:33     ` David Hildenbrand
2019-07-15 14:40       ` David Hildenbrand
2019-07-10 19:51 ` [RFC][Patch v11 2/2] virtio-balloon: page_hinting: reporting to the host Nitesh Narayan Lal
2019-07-24 19:47   ` Michael S. Tsirkin
2019-07-24 19:56     ` David Hildenbrand
2019-07-24 20:10       ` Nitesh Narayan Lal
2019-07-24 20:06     ` Nitesh Narayan Lal
2019-07-10 19:53 ` [QEMU Patch] virtio-baloon: Support for page hinting Nitesh Narayan Lal
2019-07-10 20:17   ` Alexander Duyck
2019-07-10 20:17     ` Alexander Duyck
2019-07-11 12:03     ` Nitesh Narayan Lal
2019-07-11  8:49   ` Cornelia Huck
2019-07-11 11:13     ` Nitesh Narayan Lal
2019-07-11 18:55   ` Michael S. Tsirkin
2019-07-11 19:06     ` Nitesh Narayan Lal
2019-07-11 22:36       ` Alexander Duyck
2019-07-11 22:36         ` Alexander Duyck
2019-07-10 20:19 ` [RFC][PATCH v11 0/2] mm: " Dave Hansen
2019-07-11 11:37   ` Nitesh Narayan Lal
2019-07-10 23:40 ` Alexander Duyck
2019-07-10 23:40   ` Alexander Duyck
2019-07-11 11:30   ` Nitesh Narayan Lal
2019-07-11 14:58     ` Alexander Duyck
2019-07-11 14:58       ` Alexander Duyck
2019-07-11 15:03       ` Nitesh Narayan Lal
2019-07-11 15:08         ` Alexander Duyck
2019-07-11 15:08           ` Alexander Duyck
2019-07-11 15:19           ` Nitesh Narayan Lal
2019-07-11 17:01             ` Alexander Duyck
2019-07-11 17:01               ` Alexander Duyck

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=0a89271f-c80b-9314-f6bb-8fdf0d714431@redhat.com \
    --to=david@redhat.com \
    --cc=aarcange@redhat.com \
    --cc=alexander.duyck@gmail.com \
    --cc=dave.hansen@intel.com \
    --cc=dhildenb@redhat.com \
    --cc=dodgen@google.com \
    --cc=john.starks@microsoft.com \
    --cc=konrad.wilk@oracle.com \
    --cc=kvm@vger.kernel.org \
    --cc=lcapitulino@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.com \
    --cc=mst@redhat.com \
    --cc=nitesh@redhat.com \
    --cc=pagupta@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=riel@surriel.com \
    --cc=wei.w.wang@intel.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.