[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1403289003.25108.3.camel@misato.fc.hp.com>
Date: Fri, 20 Jun 2014 12:30:03 -0600
From: Toshi Kani <toshi.kani@...com>
To: Yasuaki Ishimatsu <isimatu.yasuaki@...fujitsu.com>
Cc: akpm@...ux-foundation.org, tglx@...utronix.de, mingo@...hat.com,
hpa@...or.com, tangchen@...fujitsu.com,
linux-kernel@...r.kernel.org, linux-mm@...ck.org, x86@...nel.org,
guz.fnst@...fujitsu.com, zhangyanfei@...fujitsu.com
Subject: Re: [PATCH 2/2] x86,mem-hotplug: modify PGD entry when removing
memory
On Wed, 2014-06-18 at 15:38 +0900, Yasuaki Ishimatsu wrote:
:
> @@ -186,7 +186,12 @@ void sync_global_pgds(unsigned long start, unsigned long end)
> const pgd_t *pgd_ref = pgd_offset_k(address);
> struct page *page;
>
> - if (pgd_none(*pgd_ref))
> + /*
> + * When it is called after memory hot remove, pgd_none()
> + * returns true. In this case (removed == 1), we must clear
> + * the PGD entries in the local PGD level page.
> + */
> + if (pgd_none(*pgd_ref) && !removed)
> continue;
>
> spin_lock(&pgd_lock);
> @@ -199,12 +204,18 @@ void sync_global_pgds(unsigned long start, unsigned long end)
> pgt_lock = &pgd_page_get_mm(page)->page_table_lock;
> spin_lock(pgt_lock);
>
> - if (pgd_none(*pgd))
> - set_pgd(pgd, *pgd_ref);
> - else
> + if (!pgd_none(*pgd_ref) && !pgd_none(*pgd))
> BUG_ON(pgd_page_vaddr(*pgd)
> != pgd_page_vaddr(*pgd_ref));
>
> + if (removed) {
Shouldn't this condition be "else if"?
Thanks,
-Toshi
> + if (pgd_none(*pgd_ref) && !pgd_none(*pgd))
> + pgd_clear(pgd);
> + } else {
> + if (pgd_none(*pgd))
> + set_pgd(pgd, *pgd_ref);
> + }
> +
> spin_unlock(pgt_lock);
> }
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists