From: Minchan Kim <minchan@kernel.org>
To: "Wang, Yalin" <Yalin.Wang@sonymobile.com>
Cc: "'mhocko@suse.cz'" <mhocko@suse.cz>,
"'linux-mm@kvack.org'" <linux-mm@kvack.org>,
"'akpm@linux-foundation.org'" <akpm@linux-foundation.org>,
"mm-commits@vger.kernel.org" <mm-commits@vger.kernel.org>,
"hughd@google.com" <hughd@google.com>,
"b.zolnierkie@samsung.com" <b.zolnierkie@samsung.com>
Subject: Re: [RFC V2] Free the reserved memblock when free cma pages
Date: Mon, 15 Sep 2014 15:57:59 +0900 [thread overview]
Message-ID: <20140915065759.GM2160@bbox> (raw)
In-Reply-To: <35FD53F367049845BC99AC72306C23D103D6DB4915FF@CNBJMBX05.corpusers.net>
On Mon, Sep 15, 2014 at 02:10:19PM +0800, Wang, Yalin wrote:
> This patch add memblock_free to also free the reserved memblock,
> so that the cma pages are not marked as reserved memory in
> /sys/kernel/debug/memblock/reserved debug file
If you received some comments and judges the direction is right,
you could remove RFC tag from the patch title.
>
> Signed-off-by: Yalin Wang <yalin.wang@sonymobile.com>
Anyway,
Acked-by: Minchan Kim <minchan@kernel.org>
>
> ---
> mm/cma.c | 6 +++++-
> mm/page_alloc.c | 2 +-
> 2 files changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/mm/cma.c b/mm/cma.c
> index c17751c..ec69c69 100644
> --- a/mm/cma.c
> +++ b/mm/cma.c
> @@ -196,7 +196,11 @@ int __init cma_declare_contiguous(phys_addr_t base,
> if (!IS_ALIGNED(size >> PAGE_SHIFT, 1 << order_per_bit))
> return -EINVAL;
>
> - /* Reserve memory */
> + /*
> + * Reserve memory, and the reserved memory are marked as reserved by
> + * memblock driver, remember to clear the reserved status when free
> + * these cma pages, see init_cma_reserved_pageblock()
> + */
> if (base && fixed) {
> if (memblock_is_region_reserved(base, size) ||
> memblock_reserve(base, size) < 0) {
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index 18cee0d..fffbb84 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -836,8 +836,8 @@ void __init init_cma_reserved_pageblock(struct page *page)
> set_page_refcounted(page);
> __free_pages(page, pageblock_order);
> }
> -
> adjust_managed_page_count(page, pageblock_nr_pages);
> + memblock_free(page_to_phys(page), pageblock_nr_pages << PAGE_SHIFT);
> }
> #endif
>
> --
> 2.1.0
>
--
Kind regards,
Minchan Kim
--
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: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2014-09-15 6:57 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-09 6:13 [RFC] Free the reserved memblock when free cma pages Wang, Yalin
2014-09-10 8:18 ` Michal Hocko
2014-09-10 9:02 ` Wang, Yalin
2014-09-12 9:35 ` Marek Szyprowski
2014-09-15 3:06 ` Joonsoo Kim
2014-09-15 5:21 ` Minchan Kim
2014-09-15 5:36 ` Wang, Yalin
2014-09-15 5:42 ` Minchan Kim
2014-09-15 5:46 ` Wang, Yalin
2014-09-15 6:10 ` [RFC V2] " Wang, Yalin
2014-09-15 6:57 ` Minchan Kim [this message]
2014-09-15 7:54 ` [PATCH Resend] " Wang, Yalin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140915065759.GM2160@bbox \
--to=minchan@kernel.org \
--cc=Yalin.Wang@sonymobile.com \
--cc=akpm@linux-foundation.org \
--cc=b.zolnierkie@samsung.com \
--cc=hughd@google.com \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.cz \
--cc=mm-commits@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).