From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754538Ab2GRXMn (ORCPT ); Wed, 18 Jul 2012 19:12:43 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:44972 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752114Ab2GRXMl (ORCPT ); Wed, 18 Jul 2012 19:12:41 -0400 Date: Wed, 18 Jul 2012 16:12:39 -0700 From: Andrew Morton To: Rafael Aquini Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, Rusty Russell , "Michael S. Tsirkin" , Rik van Riel , Mel Gorman , Andi Kleen , Konrad Rzeszutek Wilk , Minchan Kim , Rafael Aquini Subject: Re: [PATCH v4 1/3] mm: introduce compaction and migration for virtio ballooned pages Message-Id: <20120718161239.9449e6b5.akpm@linux-foundation.org> In-Reply-To: <20120718230706.GB2313@t510.redhat.com> References: <49f828a9331c9b729fcf77226006921ec5bc52fa.1342485774.git.aquini@redhat.com> <20120718154605.cb0591bc.akpm@linux-foundation.org> <20120718230706.GB2313@t510.redhat.com> X-Mailer: Sylpheed 3.0.2 (GTK+ 2.20.1; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 18 Jul 2012 20:07:07 -0300 Rafael Aquini wrote: > > > > > +} > > > +#else > > > +static inline bool is_balloon_page(struct page *page) { return false; } > > > +static inline bool isolate_balloon_page(struct page *page) { return false; } > > > +static inline bool putback_balloon_page(struct page *page) { return false; } > > > +#endif /* (VIRTIO_BALLOON || VIRTIO_BALLOON_MODULE) && COMPACTION */ > > > > This means that if CONFIG_VIRTIO_BALLOON=y and CONFIG_COMPACTION=n, > > is_balloon_page() will always return NULL. IOW, no pages are balloon > > pages! This is wrong. > > > I believe it's right, actually, as we can see CONFIG_COMPACTION=n associated with > CONFIG_MIGRATION=y (and CONFIG_VIRTIO_BALLOON=y). > For such config case we cannot perform the is_balloon_page() test branches > placed on mm/migration.c No, it isn't right. Look at the name: "is_balloon_page". If a caller runs is_balloon_page() against a balloon page with CONFIG_COMPACTION=n then they will get "false", which is incorrect. So the function needs a better name - one which communicates that it is a balloon page *for the purposes of processing by the compaction code*. Making the function private to compaction.c would help with that, if feasible. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx108.postini.com [74.125.245.108]) by kanga.kvack.org (Postfix) with SMTP id 4BE866B005C for ; Wed, 18 Jul 2012 19:12:41 -0400 (EDT) Date: Wed, 18 Jul 2012 16:12:39 -0700 From: Andrew Morton Subject: Re: [PATCH v4 1/3] mm: introduce compaction and migration for virtio ballooned pages Message-Id: <20120718161239.9449e6b5.akpm@linux-foundation.org> In-Reply-To: <20120718230706.GB2313@t510.redhat.com> References: <49f828a9331c9b729fcf77226006921ec5bc52fa.1342485774.git.aquini@redhat.com> <20120718154605.cb0591bc.akpm@linux-foundation.org> <20120718230706.GB2313@t510.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Rafael Aquini Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, Rusty Russell , "Michael S. Tsirkin" , Rik van Riel , Mel Gorman , Andi Kleen , Konrad Rzeszutek Wilk , Minchan Kim , Rafael Aquini On Wed, 18 Jul 2012 20:07:07 -0300 Rafael Aquini wrote: > > > > > +} > > > +#else > > > +static inline bool is_balloon_page(struct page *page) { return false; } > > > +static inline bool isolate_balloon_page(struct page *page) { return false; } > > > +static inline bool putback_balloon_page(struct page *page) { return false; } > > > +#endif /* (VIRTIO_BALLOON || VIRTIO_BALLOON_MODULE) && COMPACTION */ > > > > This means that if CONFIG_VIRTIO_BALLOON=y and CONFIG_COMPACTION=n, > > is_balloon_page() will always return NULL. IOW, no pages are balloon > > pages! This is wrong. > > > I believe it's right, actually, as we can see CONFIG_COMPACTION=n associated with > CONFIG_MIGRATION=y (and CONFIG_VIRTIO_BALLOON=y). > For such config case we cannot perform the is_balloon_page() test branches > placed on mm/migration.c No, it isn't right. Look at the name: "is_balloon_page". If a caller runs is_balloon_page() against a balloon page with CONFIG_COMPACTION=n then they will get "false", which is incorrect. So the function needs a better name - one which communicates that it is a balloon page *for the purposes of processing by the compaction code*. Making the function private to compaction.c would help with that, if feasible. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Morton Subject: Re: [PATCH v4 1/3] mm: introduce compaction and migration for virtio ballooned pages Date: Wed, 18 Jul 2012 16:12:39 -0700 Message-ID: <20120718161239.9449e6b5.akpm@linux-foundation.org> References: <49f828a9331c9b729fcf77226006921ec5bc52fa.1342485774.git.aquini@redhat.com> <20120718154605.cb0591bc.akpm@linux-foundation.org> <20120718230706.GB2313@t510.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20120718230706.GB2313@t510.redhat.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: virtualization-bounces@lists.linux-foundation.org Errors-To: virtualization-bounces@lists.linux-foundation.org To: Rafael Aquini Cc: Rik van Riel , Konrad Rzeszutek Wilk , "Michael S. Tsirkin" , linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, linux-mm@kvack.org, Andi Kleen , Minchan Kim , Rafael Aquini List-Id: virtualization@lists.linuxfoundation.org On Wed, 18 Jul 2012 20:07:07 -0300 Rafael Aquini wrote: > > > > > +} > > > +#else > > > +static inline bool is_balloon_page(struct page *page) { return false; } > > > +static inline bool isolate_balloon_page(struct page *page) { return false; } > > > +static inline bool putback_balloon_page(struct page *page) { return false; } > > > +#endif /* (VIRTIO_BALLOON || VIRTIO_BALLOON_MODULE) && COMPACTION */ > > > > This means that if CONFIG_VIRTIO_BALLOON=y and CONFIG_COMPACTION=n, > > is_balloon_page() will always return NULL. IOW, no pages are balloon > > pages! This is wrong. > > > I believe it's right, actually, as we can see CONFIG_COMPACTION=n associated with > CONFIG_MIGRATION=y (and CONFIG_VIRTIO_BALLOON=y). > For such config case we cannot perform the is_balloon_page() test branches > placed on mm/migration.c No, it isn't right. Look at the name: "is_balloon_page". If a caller runs is_balloon_page() against a balloon page with CONFIG_COMPACTION=n then they will get "false", which is incorrect. So the function needs a better name - one which communicates that it is a balloon page *for the purposes of processing by the compaction code*. Making the function private to compaction.c would help with that, if feasible.