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

2012-08-15 Thread Mel Gorman
On Tue, Aug 14, 2012 at 05:00:49PM -0300, Rafael Aquini wrote: > On Tue, Aug 14, 2012 at 10:35:25PM +0300, Michael S. Tsirkin wrote: > > > > > +/* __isolate_lru_page() counterpart for a ballooned page */ > > > > > +bool isolate_balloon_page(struct page *page) > > > > > +{ > > > > > + if

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

2012-08-15 Thread Mel Gorman
On Tue, Aug 14, 2012 at 05:00:49PM -0300, Rafael Aquini wrote: On Tue, Aug 14, 2012 at 10:35:25PM +0300, Michael S. Tsirkin wrote: +/* __isolate_lru_page() counterpart for a ballooned page */ +bool isolate_balloon_page(struct page *page) +{ + if

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

2012-08-14 Thread Michael S. Tsirkin
On Tue, Aug 14, 2012 at 05:00:49PM -0300, Rafael Aquini wrote: > On Tue, Aug 14, 2012 at 10:35:25PM +0300, Michael S. Tsirkin wrote: > > > > > +/* __isolate_lru_page() counterpart for a ballooned page */ > > > > > +bool isolate_balloon_page(struct page *page) > > > > > +{ > > > > > + if

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

2012-08-14 Thread Rafael Aquini
On Tue, Aug 14, 2012 at 10:48:37PM +0300, Michael S. Tsirkin wrote: > > > > E.g. kvm can emulate hyperv so it could in theory have hyperv balloon. > > This is mm stuff it is best not to tie it to specific drivers. > > But of course I agree this is not top priority, no need > to block submission

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

2012-08-14 Thread Rafael Aquini
On Tue, Aug 14, 2012 at 10:35:25PM +0300, Michael S. Tsirkin wrote: > > > > +/* __isolate_lru_page() counterpart for a ballooned page */ > > > > +bool isolate_balloon_page(struct page *page) > > > > +{ > > > > + if (WARN_ON(!movable_balloon_page(page))) > > > > > > Looks like this actually

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

2012-08-14 Thread Michael S. Tsirkin
On Tue, Aug 14, 2012 at 02:44:05PM -0300, Rafael Aquini wrote: > On Mon, Aug 13, 2012 at 11:26:19AM +0300, Michael S. Tsirkin wrote: > > > +static inline bool movable_balloon_page(struct page *page) > > > +{ > > > + return (page->mapping && page->mapping == balloon_mapping); > > > > I am guessing

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

2012-08-14 Thread Michael S. Tsirkin
On Tue, Aug 14, 2012 at 10:35:25PM +0300, Michael S. Tsirkin wrote: > On Tue, Aug 14, 2012 at 02:44:05PM -0300, Rafael Aquini wrote: > > On Mon, Aug 13, 2012 at 11:26:19AM +0300, Michael S. Tsirkin wrote: > > > > +static inline bool movable_balloon_page(struct page *page) > > > > +{ > > > > +

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

2012-08-14 Thread Michael S. Tsirkin
On Tue, Aug 14, 2012 at 02:44:05PM -0300, Rafael Aquini wrote: > On Mon, Aug 13, 2012 at 11:26:19AM +0300, Michael S. Tsirkin wrote: > > > +static inline bool movable_balloon_page(struct page *page) > > > +{ > > > + return (page->mapping && page->mapping == balloon_mapping); > > > > I am guessing

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

2012-08-14 Thread Rafael Aquini
On Mon, Aug 13, 2012 at 11:26:19AM +0300, Michael S. Tsirkin wrote: > > +static inline bool movable_balloon_page(struct page *page) > > +{ > > + return (page->mapping && page->mapping == balloon_mapping); > > I am guessing this needs smp_read_barrier_depends, and maybe > ACCESS_ONCE ... > I'm

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

2012-08-14 Thread Rafael Aquini
On Mon, Aug 13, 2012 at 11:26:19AM +0300, Michael S. Tsirkin wrote: +static inline bool movable_balloon_page(struct page *page) +{ + return (page-mapping page-mapping == balloon_mapping); I am guessing this needs smp_read_barrier_depends, and maybe ACCESS_ONCE ... I'm curious about

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

2012-08-14 Thread Michael S. Tsirkin
On Tue, Aug 14, 2012 at 02:44:05PM -0300, Rafael Aquini wrote: On Mon, Aug 13, 2012 at 11:26:19AM +0300, Michael S. Tsirkin wrote: +static inline bool movable_balloon_page(struct page *page) +{ + return (page-mapping page-mapping == balloon_mapping); I am guessing this needs

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

2012-08-14 Thread Michael S. Tsirkin
On Tue, Aug 14, 2012 at 10:35:25PM +0300, Michael S. Tsirkin wrote: On Tue, Aug 14, 2012 at 02:44:05PM -0300, Rafael Aquini wrote: On Mon, Aug 13, 2012 at 11:26:19AM +0300, Michael S. Tsirkin wrote: +static inline bool movable_balloon_page(struct page *page) +{ + return

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

2012-08-14 Thread Michael S. Tsirkin
On Tue, Aug 14, 2012 at 02:44:05PM -0300, Rafael Aquini wrote: On Mon, Aug 13, 2012 at 11:26:19AM +0300, Michael S. Tsirkin wrote: +static inline bool movable_balloon_page(struct page *page) +{ + return (page-mapping page-mapping == balloon_mapping); I am guessing this needs

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

2012-08-14 Thread Rafael Aquini
On Tue, Aug 14, 2012 at 10:35:25PM +0300, Michael S. Tsirkin wrote: +/* __isolate_lru_page() counterpart for a ballooned page */ +bool isolate_balloon_page(struct page *page) +{ + if (WARN_ON(!movable_balloon_page(page))) Looks like this actually can happen if the page

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

2012-08-14 Thread Rafael Aquini
On Tue, Aug 14, 2012 at 10:48:37PM +0300, Michael S. Tsirkin wrote: E.g. kvm can emulate hyperv so it could in theory have hyperv balloon. This is mm stuff it is best not to tie it to specific drivers. But of course I agree this is not top priority, no need to block submission on this,

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

2012-08-14 Thread Michael S. Tsirkin
On Tue, Aug 14, 2012 at 05:00:49PM -0300, Rafael Aquini wrote: On Tue, Aug 14, 2012 at 10:35:25PM +0300, Michael S. Tsirkin wrote: +/* __isolate_lru_page() counterpart for a ballooned page */ +bool isolate_balloon_page(struct page *page) +{ + if

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

2012-08-13 Thread Michael S. Tsirkin
On Fri, Aug 10, 2012 at 02:55:14PM -0300, Rafael Aquini wrote: > Memory fragmentation introduced by ballooning might reduce significantly > the number of 2MB contiguous memory blocks that can be used within a guest, > thus imposing performance penalties associated with the reduced number of >

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

2012-08-13 Thread Michael S. Tsirkin
On Fri, Aug 10, 2012 at 02:55:14PM -0300, Rafael Aquini wrote: Memory fragmentation introduced by ballooning might reduce significantly the number of 2MB contiguous memory blocks that can be used within a guest, thus imposing performance penalties associated with the reduced number of

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

2012-08-12 Thread Minchan Kim
On Fri, Aug 10, 2012 at 02:55:14PM -0300, Rafael Aquini wrote: > Memory fragmentation introduced by ballooning might reduce significantly > the number of 2MB contiguous memory blocks that can be used within a guest, > thus imposing performance penalties associated with the reduced number of >

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

2012-08-12 Thread Minchan Kim
On Fri, Aug 10, 2012 at 02:55:14PM -0300, Rafael Aquini wrote: Memory fragmentation introduced by ballooning might reduce significantly the number of 2MB contiguous memory blocks that can be used within a guest, thus imposing performance penalties associated with the reduced number of

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

2012-08-10 Thread Rafael Aquini
Memory fragmentation introduced by ballooning might reduce significantly the number of 2MB contiguous memory blocks that can be used within a guest, thus imposing performance penalties associated with the reduced number of transparent huge pages that could be used by the guest workload. This

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

2012-08-10 Thread Rafael Aquini
Memory fragmentation introduced by ballooning might reduce significantly the number of 2MB contiguous memory blocks that can be used within a guest, thus imposing performance penalties associated with the reduced number of transparent huge pages that could be used by the guest workload. This