Re: [PATCH v11 4/7] mm: introduce compaction and migration for ballooned pages

2012-11-27 Thread Rafael Aquini
On Tue, Nov 20, 2012 at 03:33:24PM -0800, Andrew Morton wrote: > On Fri, 9 Nov 2012 12:16:02 + > Mel Gorman wrote: > > > On Wed, Nov 07, 2012 at 01:05:51AM -0200, Rafael Aquini wrote: > > > Memory fragmentation introduced by ballooning might reduce significantly

[PATCH] mm: fix balloon_page_movable() page->flags check

2012-11-27 Thread Rafael Aquini
as taking place because balloon_page_movable() page->flags tests were incomplete and we ended up inadvertently poking at private pages. Reported-by: Sasha Levin Signed-off-by: Rafael Aquini --- include/linux/balloon_compaction.h | 21 +++-- 1 file changed, 19 insertions(+),

Re: [PATCH] mm: fix balloon_page_movable() page->flags check

2012-11-27 Thread Rafael Aquini
On Tue, Nov 27, 2012 at 09:31:10PM -0200, Rafael Aquini wrote: > This patch fixes the following crash by fixing and enhancing the way > page->flags are tested to identify a ballooned page. > > ---8<--- > BUG: unable to handle kernel NULL pointer dereference at

Re: [PATCH] mm: fix balloon_page_movable() page->flags check

2012-11-27 Thread Rafael Aquini
On Tue, Nov 27, 2012 at 03:52:01PM -0800, Andrew Morton wrote: > On Tue, 27 Nov 2012 21:31:10 -0200 > Rafael Aquini wrote: > > > This patch fixes the following crash by fixing and enhancing the way > > page->flags are tested to identify a ballooned page. > > &

Re: [PATCH] mm: fix balloon_page_movable() page->flags check

2012-11-27 Thread Rafael Aquini
On Tue, Nov 27, 2012 at 05:15:44PM -0800, Andrew Morton wrote: > On Tue, 27 Nov 2012 22:34:10 -0200 Rafael Aquini wrote: > > > Do you want me to resubmit this patch with the changes you suggested? > > oh, I think I can reach that far. How's this look? > It looks

Re: [PATCH v9 3/5] virtio_balloon: introduce migration primitives to balloon pages

2012-08-28 Thread Rafael Aquini
On Tue, Aug 28, 2012 at 06:54:10PM +0300, Michael S. Tsirkin wrote: > On Mon, Aug 27, 2012 at 04:47:13PM -0300, Rafael Aquini wrote: > > On Sun, Aug 26, 2012 at 10:42:44AM +0300, Michael S. Tsirkin wrote: > > > > > > Reading two atomics and doing math? Result can even b

Re: [PATCH v9 3/5] virtio_balloon: introduce migration primitives to balloon pages

2012-08-28 Thread Rafael Aquini
On Tue, Aug 28, 2012 at 08:57:16PM +0300, Michael S. Tsirkin wrote: > Sorry I do not understand what you are saying here. So find > a different locking strategy. > > For example something like: > > wait_event(vb->config_change, > ({ > lock >

Re: [PATCH -mm] enable CONFIG_COMPACTION by default

2012-09-13 Thread Rafael Aquini
_bool y > select MIGRATION > depends on MMU > help > Acked-by: Rafael Aquini -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

Re: [ 0/4] 3.0.51-stable review

2012-11-02 Thread Rafael Aquini
On Fri, Nov 02, 2012 at 10:06:04AM -0700, Greg Kroah-Hartman wrote: > This is the start of the stable review cycle for the 3.0.51 release. > There are 4 patches in this series, all will be posted as a response > to this one. If anyone has any issues with these being applied, please > let me know.

Re: [ 0/4] 3.0.51-stable review

2012-11-03 Thread Rafael Aquini
On Fri, Nov 02, 2012 at 09:07:11PM -0700, Greg Kroah-Hartman wrote: > > > > Howdy Greg, > > > > Somehow the following patch is missing for this series submission: > > > Len Brown > > > x86: Remove the ancient and deprecated disable_hlt() and enable_hlt() > > > facility > > > > I glanced at

Re: [PATCH 1/9] Revert "mm: compaction: check lock contention first before taking lock"

2012-09-21 Thread Rafael Aquini
On Fri, Sep 21, 2012 at 11:46:15AM +0100, Mel Gorman wrote: > This reverts > mm-compaction-check-lock-contention-first-before-taking-lock.patch as it > is replaced by a later patch in the series. > > Signed-off-by: Mel Gorman Acked-by: Rafael Aquini -- To unsubscribe from this

Re: [PATCH 2/9] Revert "mm-compaction-abort-compaction-loop-if-lock-is-contended-or-run-too-long-fix"

2012-09-21 Thread Rafael Aquini
On Fri, Sep 21, 2012 at 11:46:16AM +0100, Mel Gorman wrote: > This reverts > mm-compaction-abort-compaction-loop-if-lock-is-contended-or-run-too-long-fix > as it is replaced by a later patch in the series. > > Signed-off-by: Mel Gorman Acked-by: Rafael Aquini -- To unsubscribe

Re: [PATCH 3/9] Revert "mm: compaction: abort compaction loop if lock is contended or run too long"

2012-09-21 Thread Rafael Aquini
On Fri, Sep 21, 2012 at 11:46:17AM +0100, Mel Gorman wrote: > This reverts > mm-compaction-abort-compaction-loop-if-lock-is-contended-or-run-too-long.patch > as it is replaced by a later patch in the series. > > Signed-off-by: Mel Gorman Acked-by: Rafael Aquini -- To unsubs

Re: [PATCH 4/9] mm: compaction: Abort compaction loop if lock is contended or run too long

2012-09-21 Thread Rafael Aquini
Arcangeli > Signed-off-by: Shaohua Li > Signed-off-by: Mel Gorman > Acked-by: Rik van Riel > --- Acked-by: Rafael Aquini -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info

Re: [PATCH 5/9] mm: compaction: Acquire the zone->lru_lock as late as possible

2012-09-21 Thread Rafael Aquini
r as long as possible. If there are no LRU pages or the only > LRU pages are transhuge then the LRU lock will not be acquired at all > which reduces contention on zone->lru_lock. > > Signed-off-by: Mel Gorman > Acked-by: Rik van Riel > --- Acked-by: Rafael Aquini -- To unsu

Re: [PATCH 6/9] mm: compaction: Acquire the zone->lock as late as possible

2012-09-21 Thread Rafael Aquini
ock for as long as possible. In the > event there are no free pages in the pageblock then the lock will not be > acquired at all which reduces contention on zone->lock. > > Signed-off-by: Mel Gorman > Acked-by: Rik van Riel > --- Acked-by: Rafael Aquini -- To unsubscribe fro

Re: [PATCH 7/9] Revert "mm: have order > 0 compaction start off where it left"

2012-09-21 Thread Rafael Aquini
nners. > > Signed-off-by: Mel Gorman > Acked-by: Rik van Riel > --- Acked-by: Rafael Aquini -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.

Re: [PATCH 8/9] mm: compaction: Cache if a pageblock was scanned and no pages were isolated

2012-09-21 Thread Rafael Aquini
Waiting until memory pressure is relieved would > cause compaction to continually fail instead of using reclaim/compaction > to try allocate the page. The time-based mechanism is clumsy but a better > option is not obvious. > > Signed-off-by: Mel Gorman > Acked-by: Rik van Riel

Re: [PATCH 9/9] mm: compaction: Restart compaction from near where it left off

2012-09-21 Thread Rafael Aquini
t points and will > update the cached restart points until a page is isolated or a pageblock > is skipped that would have been scanned by synchronous compaction. > > Signed-off-by: Mel Gorman > Acked-by: Rik van Riel > --- Acked-by: Rafael Aquini -- To unsubscribe from

Re: [PATCH v10 1/5] mm: introduce a common interface for balloon pages mobility

2012-09-25 Thread Rafael Aquini
On Tue, Sep 25, 2012 at 03:05:49AM +0200, Michael S. Tsirkin wrote: > If these are all under page lock these barriers just confuse things, > because they are almost never enough by themselves. > So in that case it would be better to drop them and document > usage as you are going to. > Would the f

Re: [PATCH v10 3/5] virtio_balloon: introduce migration primitives to balloon pages

2012-09-25 Thread Rafael Aquini
On Tue, Sep 25, 2012 at 02:40:24AM +0200, Michael S. Tsirkin wrote: > > @@ -139,9 +158,15 @@ static void fill_balloon(struct virtio_balloon *vb, > > size_t num) > > break; > > } > > set_page_pfns(vb->pfns + vb->num_pfns, page); > > - vb->num_pa

Re: [PATCH v8 5/9] MCS Lock: Restructure the MCS lock defines and locking code into its own file

2013-10-08 Thread Rafael Aquini
On Wed, Oct 02, 2013 at 03:38:32PM -0700, Tim Chen wrote: > We will need the MCS lock code for doing optimistic spinning for rwsem. > Extracting the MCS code from mutex.c and put into its own file allow us > to reuse this code easily for rwsem. > > Reviewed-by: Ingo Molnar > Reviewed-by: Peter Zi

Re: [PATCH v8 5/9] MCS Lock: Restructure the MCS lock defines and locking code into its own file

2013-10-08 Thread Rafael Aquini
On Tue, Oct 08, 2013 at 01:34:55PM -0700, Tim Chen wrote: > On Tue, 2013-10-08 at 16:51 -0300, Rafael Aquini wrote: > > On Wed, Oct 02, 2013 at 03:38:32PM -0700, Tim Chen wrote: > > > We will need the MCS lock code for doing optimistic spinning for rwsem. > > > Extractin

Re: [PATCH] mm: hugetlb: initialize PG_reserved for tail pages of gigantig compound pages

2013-10-10 Thread Rafael Aquini
corrects the gigantic compound page initialization so that > we can retain the optimization in > 11feeb498086a3a5907b8148bdf1786a9b18fc55. The cacheline was already > modified in order to set PG_tail so this won't affect the boot time of > large memory systems. > > Report

[PATCH] mm: avoid reinserting isolated balloon pages into LRU lists

2013-09-25 Thread Rafael Aquini
ned-off-by: Rafael Aquini --- include/linux/balloon_compaction.h | 25 + mm/migrate.c | 2 +- mm/vmscan.c| 4 +++- 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/include/linux/balloon_compaction.h b/inc

Re: [PATCH -next] virtio: balloon: fix missing unlock on error in fill_balloon()

2012-11-12 Thread Rafael Aquini
On Mon, Nov 12, 2012 at 09:50:40PM +0800, Wei Yongjun wrote: > From: Wei Yongjun > > Add the missing unlock before return from function fill_balloon() > in the error handling case. > > Introduced by 9864a8(virtio_balloon: introduce migration primitives > to balloon pages) > > dpatch engine is u

Re: [PATCH -next] virtio: balloon: fix missing unlock on error in fill_balloon()

2012-11-13 Thread Rafael Aquini
On Mon, Nov 12, 2012 at 03:34:53PM -0800, Andrew Morton wrote: > On Mon, 12 Nov 2012 21:50:40 +0800 > Wei Yongjun wrote: > > > From: Wei Yongjun > > > > Add the missing unlock before return from function fill_balloon() > > in the error handling case. > > > > Introduced by 9864a8(virtio_balloon

[PATCH v11 1/7] mm: adjust address_space_operations.migratepage() return code

2012-11-06 Thread Rafael Aquini
This patch introduces MIGRATEPAGE_SUCCESS as the default return code for address_space_operations.migratepage() method and documents the expected return code for the same method in failure cases. Signed-off-by: Rafael Aquini --- fs/hugetlbfs/inode.c| 4 ++-- include/linux/migrate.h | 7

[PATCH v11 4/7] mm: introduce compaction and migration for ballooned pages

2012-11-06 Thread Rafael Aquini
patch introduces the helper functions as well as the necessary changes to 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 --- mm/compaction.c | 21

[PATCH v11 5/7] virtio_balloon: introduce migration primitives to balloon pages

2012-11-06 Thread Rafael Aquini
providing protection against concurrent access introduced by parallel memory migration threads. - balloon_lock (mutex) : synchronizes the access demand to elements of struct virtio_balloon and its queue operations; Signed-off-by: Rafael Aquini --- drivers/virtio

[PATCH v11 7/7] mm: add vm event counters for balloon pages compaction

2012-11-06 Thread Rafael Aquini
This patch introduces a new set of vm event counters to keep track of ballooned pages compaction activity. Signed-off-by: Rafael Aquini --- drivers/virtio/virtio_balloon.c | 1 + include/linux/vm_event_item.h | 8 +++- mm/balloon_compaction.c | 2 ++ mm/migrate.c

[PATCH v11 3/7] mm: introduce a common interface for balloon pages mobility

2012-11-06 Thread Rafael Aquini
patch introduces a common interface to help a balloon driver on making its page set movable to compaction, and thus allowing the system to better leverage the compation efforts on memory defragmentation. Signed-off-by: Rafael Aquini --- include/linux/balloon_compaction.h | 220

[PATCH v11 6/7] mm: introduce putback_movable_pages()

2012-11-06 Thread Rafael Aquini
this patch introduces putback_movable_pages() to properly cope with cases where the isolated pageset contains ballooned pages and LRU pages, thus fixing the mentioned inelegant hack around putback_lru_pages(). Signed-off-by: Rafael Aquini --- include/linux/migrate.h | 2 ++ mm/compaction.c | 6

[PATCH v11 2/7] mm: redefine address_space.assoc_mapping

2012-11-06 Thread Rafael Aquini
data structures through ->private_data. Also, all users of old ->assoc_mapping element are converted to reflect its new name and type change. Signed-off-by: Rafael Aquini --- fs/buffer.c| 12 ++-- fs/gfs2/glock.c| 2 +- fs/inode.c | 2 +- fs/nilfs2/page.c

[PATCH v11 0/7] make balloon pages movable by compaction

2012-11-06 Thread Rafael Aquini
17 Compaction stalls 747 499 Compaction success 244 145 Compaction failures 503 354 Compaction pages moved 370888 474837 Compaction move failure 77378 65259 ===END stress-highalloc Rafael Aquin

Re: [PATCH v11 3/7] mm: introduce a common interface for balloon pages mobility

2012-11-07 Thread Rafael Aquini
On Wed, Nov 07, 2012 at 01:02:07PM -0800, Andrew Morton wrote: > On Wed, 7 Nov 2012 01:05:50 -0200 > Rafael Aquini wrote: > > > Memory fragmentation introduced by ballooning might reduce significantly > > the number of 2MB contiguous memory blocks that can be used wit

Re: [PATCH v11 1/7] mm: adjust address_space_operations.migratepage() return code

2012-11-07 Thread Rafael Aquini
On Wed, Nov 07, 2012 at 11:56:10AM -0800, Andrew Morton wrote: > On Wed, 7 Nov 2012 01:05:48 -0200 > Rafael Aquini wrote: > > > This patch introduces MIGRATEPAGE_SUCCESS as the default return code > > for address_space_operations.migratepage() method and documents the >

Re: [PATCH v11 5/7] virtio_balloon: introduce migration primitives to balloon pages

2012-11-07 Thread Rafael Aquini
On Wed, Nov 07, 2012 at 11:58:10AM -0800, Andrew Morton wrote: > On Wed, 7 Nov 2012 01:05:52 -0200 > Rafael Aquini wrote: > > > Memory fragmentation introduced by ballooning might reduce significantly > > the number of 2MB contiguous memory blocks that can be used wit

Re: [PATCH v11 5/7] virtio_balloon: introduce migration primitives to balloon pages

2012-11-07 Thread Rafael Aquini
On Wed, Nov 07, 2012 at 04:11:46PM -0800, Andrew Morton wrote: > On Thu, 08 Nov 2012 09:32:18 +1030 > Rusty Russell wrote: > > > Rafael Aquini writes: > > > + * virtballoon_migratepage - perform the balloon page migration on > > > behalf of > > >

Re: [PATCH v11 5/7] virtio_balloon: introduce migration primitives to balloon pages

2012-11-07 Thread Rafael Aquini
On Thu, Nov 08, 2012 at 09:32:18AM +1030, Rusty Russell wrote: > The first one can be delayed, the second one can be delayed if the host > didn't ask for VIRTIO_BALLOON_F_MUST_TELL_HOST (qemu doesn't). > > We could implement a proper request queue for these, and return -EAGAIN > if the queue fills

Re: [PATCH v11 3/7] mm: introduce a common interface for balloon pages mobility

2012-11-09 Thread Rafael Aquini
On Fri, Nov 09, 2012 at 12:11:33PM +, Mel Gorman wrote: > > +/* > > + * balloon_page_insert - insert a page into the balloon's page list and > > make > > + * the page->mapping assignment accordingly. > > + * @page: page to be assigned as a 'balloon page' > > + * @mapping :

Re: [PATCH v11 7/7] mm: add vm event counters for balloon pages compaction

2012-11-09 Thread Rafael Aquini
On Fri, Nov 09, 2012 at 12:20:33PM +, Mel Gorman wrote: > On Wed, Nov 07, 2012 at 01:05:54AM -0200, Rafael Aquini wrote: > > This patch introduces a new set of vm event counters to keep track of > > ballooned pages compaction activity. > > > > Signed-off-by: Raf

Re: [PATCH v11 3/7] mm: introduce a common interface for balloon pages mobility

2012-11-09 Thread Rafael Aquini
On Fri, Nov 09, 2012 at 04:23:27PM +, Mel Gorman wrote: > On Fri, Nov 09, 2012 at 12:53:22PM -0200, Rafael Aquini wrote: > > > > > > If you get the barrier issue sorted out then feel free to add > > > > > > Acked-by: Mel Gorman > > > >

[PATCH v12 1/7] mm: adjust address_space_operations.migratepage() return code

2012-11-11 Thread Rafael Aquini
This patch introduces MIGRATEPAGE_SUCCESS as the default return code for address_space_operations.migratepage() method and documents the expected return code for the same method in failure cases. Signed-off-by: Rafael Aquini --- fs/hugetlbfs/inode.c| 4 ++-- include/linux/migrate.h | 7

[PATCH v12 3/7] mm: introduce a common interface for balloon pages mobility

2012-11-11 Thread Rafael Aquini
patch introduces a common interface to help a balloon driver on making its page set movable to compaction, and thus allowing the system to better leverage the compation efforts on memory defragmentation. Signed-off-by: Rafael Aquini Acked-by: Mel Gorman --- include/linux/balloon_compaction.h | 256

[PATCH v12 5/7] virtio_balloon: introduce migration primitives to balloon pages

2012-11-11 Thread Rafael Aquini
providing protection against concurrent access introduced by parallel memory migration threads. - balloon_lock (mutex) : synchronizes the access demand to elements of struct virtio_balloon and its queue operations; Signed-off-by: Rafael Aquini Acked-by: Michael S. Tsirkin

[PATCH v12 0/7] make balloon pages movable by compaction

2012-11-11 Thread Rafael Aquini
17 Compaction stalls 747 499 Compaction success 244 145 Compaction failures 503 354 Compaction pages moved 370888 474837 Compaction move failure 77378 65259 ===END stress-highalloc Rafael Aquin

[PATCH v12 4/7] mm: introduce compaction and migration for ballooned pages

2012-11-11 Thread Rafael Aquini
patch introduces the helper functions as well as the necessary changes to 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 Acked-by: Mel Gorman --- mm

[PATCH v12 6/7] mm: introduce putback_movable_pages()

2012-11-11 Thread Rafael Aquini
this patch introduces putback_movable_pages() to properly cope with cases where the isolated pageset contains ballooned pages and LRU pages, thus fixing the mentioned inelegant hack around putback_lru_pages(). Signed-off-by: Rafael Aquini --- include/linux/migrate.h | 2 ++ mm/compaction.c | 6

[PATCH v12 2/7] mm: redefine address_space.assoc_mapping

2012-11-11 Thread Rafael Aquini
data structures through ->private_data. Also, all users of old ->assoc_mapping element are converted to reflect its new name and type change (->private_data). Signed-off-by: Rafael Aquini --- fs/buffer.c| 12 ++-- fs/gfs2/glock.c| 2 +- fs/inode.c | 2 +-

[PATCH v12 7/7] mm: add vm event counters for balloon pages compaction

2012-11-11 Thread Rafael Aquini
This patch introduces a new set of vm event counters to keep track of ballooned pages compaction activity. Signed-off-by: Rafael Aquini --- include/linux/balloon_compaction.h | 7 +++ include/linux/vm_event_item.h | 7 ++- mm/balloon_compaction.c| 2 ++ mm/migrate.c

Re: [PATCH v12 0/7] make balloon pages movable by compaction

2012-11-11 Thread Rafael Aquini
On Sun, Nov 11, 2012 at 05:01:13PM -0200, Rafael Aquini wrote: > Change log: > v12: > * Address last suggestions on sorting the barriers usage out (Mel > Gorman); > * Fix reported build breakages for CONFIG_BALLOON_COMPACTION=n (Andrew > Morton); > * Enhance comm

Re: [PATCH v11 7/7] mm: add vm event counters for balloon pages compaction

2012-11-11 Thread Rafael Aquini
On Sat, Nov 10, 2012 at 05:55:38PM +0200, Michael S. Tsirkin wrote: > > mutex_unlock(&vb->balloon_lock); > > + balloon_event_count(COMPACTBALLOONMIGRATED); > > > > return MIGRATEPAGE_BALLOON_SUCCESS; > > } > > Looks like any ballon would need to do this. > Can this chunk go into call

Re: [RFC 1/2] virtio_balloon: move locking to the balloon thread

2012-12-19 Thread Rafael Aquini
On Tue, Dec 18, 2012 at 06:17:29PM -0200, Luiz Capitulino wrote: > Today, the balloon_lock mutex is taken and released by fill_balloon() > and leak_balloon() when both functions are entered and when they > return. > > This commit moves the locking to the caller instead, which is > the balloon() th

Re: [RFC PATCH 1/3] x86,smp: move waiting on contended lock out of line

2012-12-23 Thread Rafael Aquini
gt; kernel text appreciably. > > Signed-off-by: Rik van Riel > --- Reviewed-by: Rafael Aquini > arch/x86/include/asm/spinlock.h | 13 +++-- > arch/x86/kernel/smp.c | 14 ++ > 2 files changed, 21 insertions(+), 6 deletions(-) > > diff --git a

Re: [RFC PATCH 2/3] x86,smp: proportional backoff for ticket spinlocks

2012-12-23 Thread Rafael Aquini
cases of a data structure with > embedded spinlock, the lock holder has a better chance of > making progress. > > Signed-off-by: Rik van Riel > --- Reviewed-by: Rafael Aquini > arch/x86/kernel/smp.c |6 -- > 1 files changed, 4 insertions(+), 2 deletions(-) >

Re: [RFC PATCH 3/3] x86,smp: auto tune spinlock backoff delay factor

2012-12-23 Thread Rafael Aquini
On Fri, Dec 21, 2012 at 10:58:48PM -0500, Rik van Riel wrote: > On 12/21/2012 10:49 PM, Steven Rostedt wrote: > >On Fri, Dec 21, 2012 at 09:51:35PM -0500, Rik van Riel wrote: > > >>However, since spinlock contention should not be the > >>usual state, and all a scalable lock does is make sure > >>t

Re: [PATCH v12 4/7] mm: introduce compaction and migration for ballooned pages

2012-11-17 Thread Rafael Aquini
On Sat, Nov 17, 2012 at 01:01:30PM -0500, Sasha Levin wrote: > > I'm getting the following while fuzzing using trinity inside a KVM tools > guest, > on latest -next: > > [ 1642.783728] BUG: unable to handle kernel NULL pointer dereference at > 0194 > [ 1642.785083] IP: [] isolate_mi

Re: [PATCH v12 4/7] mm: introduce compaction and migration for ballooned pages

2012-11-20 Thread Rafael Aquini
On Sun, Nov 18, 2012 at 09:59:47AM -0500, Sasha Levin wrote: > On Sat, Nov 17, 2012 at 4:54 PM, Rafael Aquini wrote: > > On Sat, Nov 17, 2012 at 01:01:30PM -0500, Sasha Levin wrote: > >> > >> I'm getting the following while fuzzing using trinity inside a KVM t

Re: [PATCH] virtio_balloon: leak_balloon(): only tell host if we got pages deflated

2013-06-05 Thread Rafael Aquini
oks sane and replicates the check done at fill_balloon(). I think we also could use this P.S. as a commentary to let others aware of this scenario. Thanks Luiz! Acked-by: Rafael Aquini > PPS: Very lightly tested > > drivers/virtio/virtio_balloon.c | 3 ++- > 1 file changed, 2 i

Re: [PATCH] virtio_balloon: leak_balloon(): only tell host if we got pages deflated

2013-06-05 Thread Rafael Aquini
On Wed, Jun 05, 2013 at 07:08:44PM -0400, Luiz Capitulino wrote: > On Wed, 5 Jun 2013 18:24:49 -0300 > Rafael Aquini wrote: > > > On Wed, Jun 05, 2013 at 05:10:31PM -0400, Luiz Capitulino wrote: > > > The balloon_page_dequeue() function can return NULL. If it does for &g

Re: [PATCH v2] virtio_balloon: leak_balloon(): only tell host if we got pages deflated

2013-06-06 Thread Rafael Aquini
uest. > > I didn't get this in practice, I found it by code review. On the other > hand, such an invalid virtio request will cause errors in QEMU and > fill_balloon() also performs the same check implemented by this commit. > > Signed-off-by: Luiz Capitulino > Ac

[PATCH] swap: avoid read_swap_cache_async() race to deadlock while waiting on discard I/O compeletion

2013-05-30 Thread Rafael Aquini
where read_swap_cache_async() is busy looping and !CONFIG_PREEMPT. This patch introduces a cond_resched() call to make the aforementioned read_swap_cache_async() busy loop condition to bail out when necessary, thus avoiding the subtle race window. Signed-off-by: Rafael Aquini --- mm/swap_state.c

Re: [PATCH] swap: avoid read_swap_cache_async() race to deadlock while waiting on discard I/O compeletion

2013-05-30 Thread Rafael Aquini
On Thu, May 30, 2013 at 03:55:39PM -0400, Johannes Weiner wrote: > On Thu, May 30, 2013 at 03:05:00PM -0300, Rafael Aquini wrote: > > read_swap_cache_async() can race against get_swap_page(), and stumble across > > a SWAP_HAS_CACHE entry in the swap map whose page wasn

[PATCH v2] swap: avoid read_swap_cache_async() race to deadlock while waiting on discard I/O completion

2013-05-30 Thread Rafael Aquini
where read_swap_cache_async() is busy looping and !CONFIG_PREEMPT. This patch introduces a cond_resched() call to make the aforementioned read_swap_cache_async() busy loop condition to bail out when necessary, thus avoiding the subtle race window. Signed-off-by: Rafael Aquini Acked-by: Johannes Weiner Ack

Re: [RFC 2/2] virtio_balloon: auto-ballooning support

2013-05-13 Thread Rafael Aquini
On Fri, May 10, 2013 at 09:20:46AM -0400, Luiz Capitulino wrote: > On Thu, 9 May 2013 18:15:19 -0300 > Rafael Aquini wrote: > > > Since your shrinker > > doesn't change the balloon target size, > > Which target size are you referring to? The one in the host (mem

Re: [RFC 1/2] virtio_balloon: move balloon_lock mutex to callers

2013-05-09 Thread Rafael Aquini
On Thu, May 09, 2013 at 10:53:48AM -0400, Luiz Capitulino wrote: > This commit moves the balloon_lock mutex out of the fill_balloon() > and leak_balloon() functions to their callers. > > The reason for this change is that the next commit will introduce > a shrinker callback for the balloon driver,

Re: [RFC 2/2] virtio_balloon: auto-ballooning support

2013-05-09 Thread Rafael Aquini
On Thu, May 09, 2013 at 10:53:49AM -0400, Luiz Capitulino wrote: > Automatic ballooning consists of dynamically adjusting the guest's > balloon according to memory pressure in the host and in the guest. > > This commit implements the guest side of automatic balloning, which > basically consists of

Re: [Patch v2] mm: slab: Verify the nodeid passed to ____cache_alloc_node

2013-04-23 Thread Rafael Aquini
e purpose of this patch is to assert > if this condition is true to aid debugging efforts rather > than some random NULL pointer dereference or page fault. > > Signed-off-by: Aaron Tomlin > Reviewed-by: Rik van Riel > Acked-by: Rafael Aquini > > slab.c |1 +

[RFC PATCH 01/02] swap: discard while swapping only if SWAP_FLAG_DISCARD_CLUSTER

2013-05-20 Thread Rafael Aquini
Intruduce a new flag to make page-cluster fine-grained discards while swapping conditional, as they can be considered detrimental to some setups. However, keep allowing batched discards at sys_swapon() time, when enabled by the system administrator. Signed-off-by: Rafael Aquini --- include

[RFC PATCH 00/02] swap: allowing a more flexible DISCARD policy

2013-05-20 Thread Rafael Aquini
Howdy folks, While working on a backport for the following changes: 3399446 swap: discard while swapping only if SWAP_FLAG_DISCARD 052b198 swap: don't do discard if no discard option added We found ourselves around an interesting discussion on how limiting the behavior with regard to user-visib

[RFC PATCH 02/02] swapon: add "cluster-discard" support

2013-05-20 Thread Rafael Aquini
will only be used to flag sys_swapon() batched discards will be issued at swapon(8) time. Signed-off-by: Rafael Aquini --- sys-utils/swapon.8 | 19 --- sys-utils/swapon.c | 34 ++ 2 files changed, 42 insertions(+), 11 deletions(-) diff --git a/sys

Re: [RFC PATCH 01/02] swap: discard while swapping only if SWAP_FLAG_DISCARD_CLUSTER

2013-05-21 Thread Rafael Aquini
Howdy Kosaki-san, Thanks for your time over this one :) On Mon, May 20, 2013 at 08:55:33PM -0400, KOSAKI Motohiro wrote: > (5/20/13 8:04 PM), Rafael Aquini wrote: > > Intruduce a new flag to make page-cluster fine-grained discards while > > swapping > > conditional, as t

Re: [RFC PATCH 02/02] swapon: add "cluster-discard" support

2013-05-21 Thread Rafael Aquini
Karel, Motohiro, Thanks a lot for your time reviewing this patch and providing me with valuable feedback. On Tue, May 21, 2013 at 04:17:04PM -0400, KOSAKI Motohiro wrote: > (5/21/13 6:26 AM), Karel Zak wrote: > > On Mon, May 20, 2013 at 09:02:43PM -0400, KOSAKI Motohiro wrote: > >>> - if (fl_disc

[PATCH 00/02] swap: allowing a more flexible DISCARD policy V2

2013-05-25 Thread Rafael Aquini
Considering the use cases where the swap device supports discard: a) and can do it quickly; b) but it's slow to do in small granularities (or concurrent with other I/O); c) but the implementation is so horrendous that you don't even want to send one down; And assuming that the sysadmin consi

[PATCH 01/02] swap: discard while swapping only if SWAP_FLAG_DISCARD_PAGES

2013-05-25 Thread Rafael Aquini
. Signed-off-by: Rafael Aquini --- include/linux/swap.h | 13 + mm/swapfile.c| 55 +++- 2 files changed, 59 insertions(+), 9 deletions(-) diff --git a/include/linux/swap.h b/include/linux/swap.h index 1701ce4..33fa21f 100644 --- a

[PATCH 02/02] swapon: allow a more flexible swap discard policy

2013-05-25 Thread Rafael Aquini
ey are reused. If no policy is selected both discard types are enabled. (default) Signed-off-by: Rafael Aquini --- sys-utils/swapon.8 | 24 +-- sys-utils/swapon.c | 70 ++ 2 files changed, 77 insertions(+), 17 deletions(-) diff --gi

Re: [PATCH 01/02] swap: discard while swapping only if SWAP_FLAG_DISCARD_PAGES

2013-05-26 Thread Rafael Aquini
On Sun, May 26, 2013 at 07:44:56AM -0400, KOSAKI Motohiro wrote: > > + /* > > +* By flagging sys_swapon, a sysadmin can tell us to > > +* either do sinle-time area discards only, or to > > just > > +* per

Re: [PATCH 01/02] swap: discard while swapping only if SWAP_FLAG_DISCARD_PAGES

2013-05-26 Thread Rafael Aquini
On Sun, May 26, 2013 at 10:55:32AM -0400, KOSAKI Motohiro wrote: > On Sun, May 26, 2013 at 9:52 AM, Rafael Aquini wrote: > > On Sun, May 26, 2013 at 07:44:56AM -0400, KOSAKI Motohiro wrote: > >> > + /* > >> > +* By fl

Re: [Patch v2] skbuff: Hide GFP_ATOMIC page allocation failures for dropped packets

2013-05-27 Thread Rafael Aquini
ktraces, and let retransmits handle > dropped packets quietly. > > Signed-off-by: Aaron Tomlin > --- Acked-by: Rafael Aquini > net/core/skbuff.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/net/core/skbuff.c b/net/core/skbuff.c >

Re: [Patch v2] skbuff: Hide GFP_ATOMIC page allocation failures for dropped packets

2013-05-28 Thread Rafael Aquini
On Tue, May 28, 2013 at 09:00:45AM -0700, Ben Greear wrote: > On 05/27/2013 03:41 PM, Francois Romieu wrote: > >atom...@redhat.com : > >[...] > >>Failed GFP_ATOMIC allocations by the network stack result in dropped > >>packets, which will be received on a subsequent retransmit, and an > >>unnecess

Re: [Patch v2] skbuff: Hide GFP_ATOMIC page allocation failures for dropped packets

2013-05-28 Thread Rafael Aquini
On Tue, May 28, 2013 at 09:29:37AM -0700, Eric Dumazet wrote: > On Tue, 2013-05-28 at 13:15 -0300, Rafael Aquini wrote: > > > The real problem seems to be that more and more the network stack (drivers, > > perhaps) > > is relying on chunks of contiguous page-blocks with

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

2012-08-03 Thread Rafael Aquini
On Wed, Aug 01, 2012 at 04:53:47PM -0400, Rik van Riel wrote: > On 07/23/2012 02:19 PM, Rafael Aquini wrote: > > >In a glance, I believe this whole dance you're suggesting might just be too > >much > >of an overcomplication, and the best approach would be simply

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

2012-08-03 Thread Rafael Aquini
On Mon, Jul 23, 2012 at 11:33:32AM +0900, Minchan Kim wrote: > Look at memory-hotplug, offline_page calls has_unmovable_pages, scan_lru_pages > and do_migrate_range which calls isolate_lru_page. They consider only LRU > pages > to migratable ones. > As promised, I looked into those bits. Yes, they

[PATCH v5 0/3] make balloon pages movable by compaction

2012-08-06 Thread Rafael Aquini
ose subsystems aware of ballooned pages and allow memory balloon pages become movable within a guest, thus avoiding the aforementioned fragmentation issue Rafael Aquini (3): mm: introduce compaction and migration for virtio ballooned pages virtio_balloon: introduce migration primitives to ball

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

2012-08-06 Thread Rafael Aquini
patch introduces the helper functions as well as the necessary changes to 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 --- include/linux/mm.h | 26

[PATCH v5 2/3] virtio_balloon: introduce migration primitives to balloon pages

2012-08-06 Thread Rafael Aquini
against concurrent list handling operations; Signed-off-by: Rafael Aquini --- drivers/virtio/virtio_balloon.c | 138 +--- include/linux/virtio_balloon.h | 4 ++ 2 files changed, 134 insertions(+), 8 deletions(-) diff --git a/drivers

[PATCH v5 3/3] mm: add vm event counters for balloon pages compaction

2012-08-06 Thread Rafael Aquini
This patch is only for testing report purposes and shall be dropped in case of the rest of this patchset getting accepted for merging. Signed-off-by: Rafael Aquini --- drivers/virtio/virtio_balloon.c | 1 + include/linux/vm_event_item.h | 2 ++ mm/compaction.c | 1 + mm

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

2012-08-06 Thread Rafael Aquini
On Mon, Aug 06, 2012 at 02:38:23PM -0400, Rik van Riel wrote: > On 08/06/2012 09:56 AM, Rafael Aquini wrote: > > >@@ -846,6 +861,21 @@ static int unmap_and_move(new_page_t get_new_page, > >unsigned long private, > > goto out; > > > >

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

2012-08-06 Thread Rafael Aquini
On Mon, Aug 06, 2012 at 03:06:49PM -0400, Rik van Riel wrote: > > Just a plain rename would work. > Ok, I will rename it. > >+static inline bool is_balloon_page(struct page *page) > >+{ > >+return (page->mapping && page->mapping == balloon_mapping); > >+} > > As an aside, since you are only

Re: [PATCH v8 1/5] mm: introduce a common interface for balloon pages mobility

2012-08-21 Thread Rafael Aquini
On Tue, Aug 21, 2012 at 10:13:30PM +0300, Michael S. Tsirkin wrote: > > > > I believe rcu_dereference_protected() is what I want/need here, since this > > code > > is always called for pages which we hold locked (PG_locked bit). > > It would only help if we locked the page while updating the map

Re: [PATCH v8 1/5] mm: introduce a common interface for balloon pages mobility

2012-08-21 Thread Rafael Aquini
On Tue, Aug 21, 2012 at 10:16:12PM +0300, Michael S. Tsirkin wrote: > On Tue, Aug 21, 2012 at 02:55:03PM -0300, Rafael Aquini wrote: > > On Tue, Aug 21, 2012 at 04:52:23PM +0300, Michael S. Tsirkin wrote: > > > > + * address_space_operations utilized method

Re: [PATCH v8 1/5] mm: introduce a common interface for balloon pages mobility

2012-08-21 Thread Rafael Aquini
On Tue, Aug 21, 2012 at 10:30:31PM +0300, Michael S. Tsirkin wrote: > On Tue, Aug 21, 2012 at 04:23:58PM -0300, Rafael Aquini wrote: > > On Tue, Aug 21, 2012 at 10:13:30PM +0300, Michael S. Tsirkin wrote: > > > > > > > > I believe rcu_dereference_protected(

Re: [PATCH v8 1/5] mm: introduce a common interface for balloon pages mobility

2012-08-21 Thread Rafael Aquini
On Wed, Aug 22, 2012 at 03:07:41AM +0300, Michael S. Tsirkin wrote: > On Tue, Aug 21, 2012 at 05:45:56PM -0300, Rafael Aquini wrote: > > On Tue, Aug 21, 2012 at 10:30:31PM +0300, Michael S. Tsirkin wrote: > > > On Tue, Aug 21, 2012 at 04:23:58PM -0300, Rafael Aquini wrote: >

Re: [PATCH v8 1/5] mm: introduce a common interface for balloon pages mobility

2012-08-22 Thread Rafael Aquini
On Wed, Aug 22, 2012 at 12:33:17PM +0300, Michael S. Tsirkin wrote: > Hmm, so this will busy wait which is unelegant. > We need some event IMO. No, it does not busy wait. leak_balloon() is mutual exclusive with migration steps, so for the case we have one racing against the other, we really want l

Re: [PATCH v8 1/5] mm: introduce a common interface for balloon pages mobility

2012-08-23 Thread Rafael Aquini
On Thu, Aug 23, 2012 at 01:01:07PM +0300, Michael S. Tsirkin wrote: > > So, when remove_common() calls leak_balloon() looping on > > vb->num_pages, that won't become a tight loop. > > The scheme was apparently working before this series, and it will remain > > working > > after it. > > It seems

Re: [PATCH v8 1/5] mm: introduce a common interface for balloon pages mobility

2012-08-23 Thread Rafael Aquini
On Thu, Aug 23, 2012 at 03:34:32PM +0300, Michael S. Tsirkin wrote: > > So, nothing has changed here. > > Yes, your patch does change things: > leak_balloon now might return without freeing any pages. > In that case we will not be making any progress, and just > spin, pinning CPU. That's a transi

Re: [PATCH v8 1/5] mm: introduce a common interface for balloon pages mobility

2012-08-23 Thread Rafael Aquini
On Thu, Aug 23, 2012 at 04:53:29PM +0300, Michael S. Tsirkin wrote: > On Thu, Aug 23, 2012 at 10:06:07AM -0300, Rafael Aquini wrote: > > On Thu, Aug 23, 2012 at 03:34:32PM +0300, Michael S. Tsirkin wrote: > > > > So, nothing has changed here. > > > > >

Re: [PATCH v8 1/5] mm: introduce a common interface for balloon pages mobility

2012-08-23 Thread Rafael Aquini
On Thu, Aug 23, 2012 at 12:03:15PM -0400, Rik van Riel wrote: > > > >Not "longer" - apparently forever unless user resend the leak command. > >It's wrong - it should > >1. not tell host if nothing was done > >2. after migration finished leak and tell host > > Agreed. If the balloon is told to lea

Re: [PATCH v8 1/5] mm: introduce a common interface for balloon pages mobility

2012-08-23 Thread Rafael Aquini
On Thu, Aug 23, 2012 at 07:25:05PM +0300, Michael S. Tsirkin wrote: > On Thu, Aug 23, 2012 at 04:53:28PM +0300, Michael S. Tsirkin wrote: > > Basically it was very simple: we assumed page->lru was never > > touched for an allocated page, so it's safe to use it for > > internal book-keeping by the d

  1   2   3   4   >