All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
To: David Rientjes <rientjes@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	toshi.kani@hp.com, linuxram@us.ibm.com,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [Bug fix PATCH v3] Reusing a resource structure allocated by bootmem
Date: Wed, 17 Apr 2013 15:46:02 +0900	[thread overview]
Message-ID: <516E452A.7060703@jp.fujitsu.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1304162144320.3493@chino.kir.corp.google.com>

Hi David,

2013/04/17 13:47, David Rientjes wrote:
> On Wed, 17 Apr 2013, Yasuaki Ishimatsu wrote:
>
>>> Why not simply do what generic sparsemem support does by testing
>>> PageSlab(virt_to_head_page(res)) and calling kfree() if true and freeing
>>> back to bootmem if false?  This should be like a five line patch.
>>
>> Is your explanation about free_section_usemap()?
>> If so, I don't think we can release resource structure like
>> free_section_usemap().
>

> Right, you can't release it like free_section_usemap(), but you're free to
> test for PageSlab(virt_to_head_page(res)) in kernel/resource.c.

O.K. I'll update it.

>
>> In your explanation case, memmap can be released by put_page_bootmem() in
>> free_map_bootmem() since all pages of memmap is used only for memmap.
>> But if my understanding is correct, a page of released resource structure
>> contain other purpose objects allocated by bootmem. So we cannot
>> release resource structure like free_section_usemap().
>>
>
> I'm thinking it would be much easier to just suppress the kfree() if
> !PageSlab.  If you can free an entire page with free_bootmem_late(),
> that would be great,

> but I'm thinking that will take more work than it's
> worth.  It seems fine to just do free_bootmem() and leave those pages as
> reserved.

I think so, too.

> How much memory are we talking about?

Hmm. I don't know correctly.

Here is kernel message of my system. The message is shown by mem_init().

-- 
Memory: 30491076k/33554432k available (5570k kernel code, 2274228k absent, 789128k reserved, 5667k data, 1784k init)
---

Reserved memroy size is 789128k. So part of them is freed after system boot
by  memory hotplug  et al.

Thanks,
Yasuaki Ishimatsu


--
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>

WARNING: multiple messages have this Message-ID (diff)
From: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
To: David Rientjes <rientjes@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>, <toshi.kani@hp.com>,
	<linuxram@us.ibm.com>, <linux-kernel@vger.kernel.org>,
	<linux-mm@kvack.org>
Subject: Re: [Bug fix PATCH v3] Reusing a resource structure allocated by bootmem
Date: Wed, 17 Apr 2013 15:46:02 +0900	[thread overview]
Message-ID: <516E452A.7060703@jp.fujitsu.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1304162144320.3493@chino.kir.corp.google.com>

Hi David,

2013/04/17 13:47, David Rientjes wrote:
> On Wed, 17 Apr 2013, Yasuaki Ishimatsu wrote:
>
>>> Why not simply do what generic sparsemem support does by testing
>>> PageSlab(virt_to_head_page(res)) and calling kfree() if true and freeing
>>> back to bootmem if false?  This should be like a five line patch.
>>
>> Is your explanation about free_section_usemap()?
>> If so, I don't think we can release resource structure like
>> free_section_usemap().
>

> Right, you can't release it like free_section_usemap(), but you're free to
> test for PageSlab(virt_to_head_page(res)) in kernel/resource.c.

O.K. I'll update it.

>
>> In your explanation case, memmap can be released by put_page_bootmem() in
>> free_map_bootmem() since all pages of memmap is used only for memmap.
>> But if my understanding is correct, a page of released resource structure
>> contain other purpose objects allocated by bootmem. So we cannot
>> release resource structure like free_section_usemap().
>>
>
> I'm thinking it would be much easier to just suppress the kfree() if
> !PageSlab.  If you can free an entire page with free_bootmem_late(),
> that would be great,

> but I'm thinking that will take more work than it's
> worth.  It seems fine to just do free_bootmem() and leave those pages as
> reserved.

I think so, too.

> How much memory are we talking about?

Hmm. I don't know correctly.

Here is kernel message of my system. The message is shown by mem_init().

-- 
Memory: 30491076k/33554432k available (5570k kernel code, 2274228k absent, 789128k reserved, 5667k data, 1784k init)
---

Reserved memroy size is 789128k. So part of them is freed after system boot
by  memory hotplug  et al.

Thanks,
Yasuaki Ishimatsu



  reply	other threads:[~2013-04-17  6:46 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-17  0:26 [Bug fix PATCH v3] Reusing a resource structure allocated by bootmem Yasuaki Ishimatsu
2013-04-17  0:26 ` Yasuaki Ishimatsu
2013-04-17  0:36 ` David Rientjes
2013-04-17  0:36   ` David Rientjes
2013-04-17  4:20   ` Yasuaki Ishimatsu
2013-04-17  4:20     ` Yasuaki Ishimatsu
2013-04-17  4:47     ` David Rientjes
2013-04-17  4:47       ` David Rientjes
2013-04-17  6:46       ` Yasuaki Ishimatsu [this message]
2013-04-17  6:46         ` Yasuaki Ishimatsu
2013-04-17  6:52         ` David Rientjes
2013-04-17  6:52           ` David Rientjes
2013-04-17  7:16           ` Yasuaki Ishimatsu
2013-04-17  7:16             ` Yasuaki Ishimatsu

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=516E452A.7060703@jp.fujitsu.com \
    --to=isimatu.yasuaki@jp.fujitsu.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linuxram@us.ibm.com \
    --cc=rientjes@google.com \
    --cc=toshi.kani@hp.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.