[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87blth2wyk.fsf@mpe.ellerman.id.au>
Date: Tue, 12 Nov 2019 21:46:59 +1100
From: Michael Ellerman <mpe@...erman.id.au>
To: David Hildenbrand <david@...hat.com>, linux-kernel@...r.kernel.org
Cc: linux-mm@...ck.org, linuxppc-dev@...ts.ozlabs.org,
Andrew Morton <akpm@...ux-foundation.org>,
Benjamin Herrenschmidt <benh@...nel.crashing.org>,
Paul Mackerras <paulus@...ba.org>,
Thiago Jung Bauermann <bauerman@...ux.ibm.com>,
Geert Uytterhoeven <geert@...ux-m68k.org>,
Anshuman Khandual <khandual@...ux.vnet.ibm.com>,
Oliver O'Halloran <oohall@...il.com>,
Alexey Kardashevskiy <aik@...abs.ru>,
"Enrico Weigelt\, metux IT consult" <info@...ux.net>,
Thomas Gleixner <tglx@...utronix.de>,
Allison Randal <allison@...utok.net>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Pavel Tatashin <pasha.tatashin@...een.com>,
Arun KS <arunks@...eaurora.org>, Todd Kjos <tkjos@...gle.com>,
Christian Brauner <christian@...uner.io>,
Gao Xiang <xiang@...nel.org>,
Greg Hackmann <ghackmann@...gle.com>,
David Howells <dhowells@...hat.com>
Subject: Re: [PATCH v1 08/12] powerpc/pseries: CMM: Implement balloon compaction
David Hildenbrand <david@...hat.com> writes:
> On 31.10.19 15:29, David Hildenbrand wrote:
>> We can now get rid of the cmm_lock and completely rely on the balloon
>> compaction internals, which now also manage the page list and the lock.
...
>> +
>> +static int cmm_migratepage(struct balloon_dev_info *b_dev_info,
>> + struct page *newpage, struct page *page,
>> + enum migrate_mode mode)
>> +{
>> + unsigned long flags;
>> +
>> + /*
>> + * loan/"inflate" the newpage first.
>> + *
>> + * We might race against the cmm_thread who might discover after our
>> + * loan request that another page is to be unloaned. However, once
>> + * the cmm_thread runs again later, this error will automatically
>> + * be corrected.
>> + */
>> + if (plpar_page_set_loaned(newpage)) {
>> + /* Unlikely, but possible. Tell the caller not to retry now. */
>> + pr_err_ratelimited("%s: Cannot set page to loaned.", __func__);
>> + return -EBUSY;
>> + }
>> +
>> + /* balloon page list reference */
>> + get_page(newpage);
>> +
>> + spin_lock_irqsave(&b_dev_info->pages_lock, flags);
>> + balloon_page_insert(b_dev_info, newpage);
>> + balloon_page_delete(page);
>
> I think I am missing a b_dev_info->isolated_pages-- here.
I don't know this code at all, but looking at other balloon drivers they
do seem to do that in roughly the same spot.
I'll add it, how can we test that it's correct?
cheers
Powered by blists - more mailing lists