Re: [PATCH 1/4] mm: introduce compaction and migration for virtio ballooned pages

2012-06-27 Thread Mel Gorman
On Tue, Jun 26, 2012 at 10:34:00PM +0200, Andi Kleen wrote: How is the compiler meant to optimise away cond if it's a function call? Inlines can be optimized away. These tests are usually inlines. What did I miss? If nothing, then I will revert this particular change and Rafael will

Re: [PATCH 1/4] mm: introduce compaction and migration for virtio ballooned pages

2012-06-27 Thread Konrad Rzeszutek Wilk
On Wed, Jun 27, 2012 at 12:17:17PM -0300, Rafael Aquini wrote: On Tue, Jun 26, 2012 at 07:57:55PM -0400, Konrad Rzeszutek Wilk wrote: +#if defined(CONFIG_VIRTIO_BALLOON) || defined(CONFIG_VIRTIO_BALLOON_MODULE) .. snip.. +struct address_space *balloon_mapping;

Re: [PATCH 1/4] mm: introduce compaction and migration for virtio ballooned pages

2012-06-26 Thread Mel Gorman
(apologies if there are excessive typos. I damaged my left hand and typing is painful). Adding Andi to cc for question on VM_BUG_ON. On Mon, Jun 25, 2012 at 08:25:56PM -0300, Rafael Aquini wrote: This patch introduces helper functions that teach compaction and migration bits how to cope

Re: [PATCH 1/4] mm: introduce compaction and migration for virtio ballooned pages

2012-06-26 Thread Rik van Riel
On 06/25/2012 07:25 PM, Rafael Aquini wrote: This patch introduces helper functions that teach compaction and migration bits how to cope with pages which are part of a guest memory balloon, in order to make them movable by memory compaction procedures. Signed-off-by: Rafael

Re: [PATCH 1/4] mm: introduce compaction and migration for virtio ballooned pages

2012-06-26 Thread Mel Gorman
On Tue, Jun 26, 2012 at 09:17:43AM -0400, Rik van Riel wrote: On 06/25/2012 07:25 PM, Rafael Aquini wrote: This patch introduces helper functions that teach compaction and migration bits how to cope with pages which are part of a guest memory balloon, in order to make them movable by memory

Re: [PATCH 1/4] mm: introduce compaction and migration for virtio ballooned pages

2012-06-26 Thread Andi Kleen
What shocked me actually is that VM_BUG_ON code is executed on !CONFIG_DEBUG_VM builds and has been since 2.6.36 due to commit [4e60c86bd: gcc-4.6: mm: fix unused but set warnings]. I thought the whole point of VM_BUG_ON was to avoid expensive and usually unnecessary checks. Andi, was this

Re: [PATCH 1/4] mm: introduce compaction and migration for virtio ballooned pages

2012-06-26 Thread Andi Kleen
I'm not fully sure what putback_balloon_page does, but if it just tests a bit (without non variable test_bit) it should be ok. ^ should be without variable ... -Andi -- a...@linux.intel.com -- Speaking for myself only. ___

Re: [PATCH 1/4] mm: introduce compaction and migration for virtio ballooned pages

2012-06-26 Thread Mel Gorman
On Tue, Jun 26, 2012 at 06:52:58PM +0200, Andi Kleen wrote: What shocked me actually is that VM_BUG_ON code is executed on !CONFIG_DEBUG_VM builds and has been since 2.6.36 due to commit [4e60c86bd: gcc-4.6: mm: fix unused but set warnings]. I thought the whole point of VM_BUG_ON was to

Re: [PATCH 1/4] mm: introduce compaction and migration for virtio ballooned pages

2012-06-26 Thread Andi Kleen
How is the compiler meant to optimise away cond if it's a function call? Inlines can be optimized away. These tests are usually inlines. What did I miss? If nothing, then I will revert this particular change and Rafael will need to be sure his patch is not using VM_BUG_ON to call a

Re: [PATCH 1/4] mm: introduce compaction and migration for virtio ballooned pages

2012-06-26 Thread Rafael Aquini
Mel, First and foremost, thank you for taking the time to review these bits and provide such valuable feedback. On Tue, Jun 26, 2012 at 11:17:29AM +0100, Mel Gorman wrote: +/* return 1 if page is part of a guest's memory balloon, 0 otherwise */ +static inline int PageBalloon(struct page

Re: [PATCH 1/4] mm: introduce compaction and migration for virtio ballooned pages

2012-06-26 Thread Konrad Rzeszutek Wilk
+#if defined(CONFIG_VIRTIO_BALLOON) || defined(CONFIG_VIRTIO_BALLOON_MODULE) +/* + * Balloon pages special page-mapping. + * users must properly allocate and initiliaze an instance of balloon_mapping, initialize + * and set it as the page-mapping for balloon enlisted page instances. + *

[PATCH 1/4] mm: introduce compaction and migration for virtio ballooned pages

2012-06-25 Thread Rafael Aquini
This patch introduces helper functions that teach compaction and migration bits how to cope with pages which are part of a guest memory balloon, in order to make them movable by memory compaction procedures. Signed-off-by: Rafael Aquini aqu...@redhat.com --- include/linux/mm.h | 17

Re: [PATCH 1/4] mm: introduce compaction and migration for virtio ballooned pages

2012-06-25 Thread Konrad Rzeszutek Wilk
On Mon, Jun 25, 2012 at 7:25 PM, Rafael Aquini aqu...@redhat.com wrote: This patch introduces helper functions that teach compaction and migration bits how to cope with pages which are part of a guest memory balloon, in order to make them movable by memory compaction procedures. Should the

Re: [PATCH 1/4] mm: introduce compaction and migration for virtio ballooned pages

2012-06-25 Thread Rafael Aquini
On Mon, Jun 25, 2012 at 07:31:38PM -0400, Konrad Rzeszutek Wilk wrote: On Mon, Jun 25, 2012 at 7:25 PM, Rafael Aquini aqu...@redhat.com wrote: This patch introduces helper functions that teach compaction and migration bits how to cope with pages which are part of a guest memory balloon, in