From: bill4carson@gmail.com (bill4carson)
To: kernelnewbies@lists.kernelnewbies.org
Subject: Who is 'Freeing init memory ...'
Date: Thu, 15 Aug 2013 17:29:05 +0800 [thread overview]
Message-ID: <520C9F61.4020201@gmail.com> (raw)
In-Reply-To: <20130815085121.GA20218@zuhnb712.ap.bm.net>
On 2013?08?15? 16:51, Woody Wu wrote:
> On Thu, Aug 15, 2013 at 10:41:39AM +0200, Belisko Marek wrote:
>> Hi,
>>
>> On Thu, Aug 15, 2013 at 10:08 AM, Woody Wu<narkewoody@gmail.com> wrote:
>>> Hi,
>>>
>>> Near the end of kernel startup, there is a message 'Freeing init memory
>>> ..'. This process on embedded system takes several seconds. After
>>> searched kernel source, however, I cannot find the same literal text in
>>> all the .c files.
>> rgrep 'Freeing' . on kernell source give me a lot of output. I believe
>> you're looking on arm for that one:
>> arch/arm/mm/init.c: printk(KERN_INFO "Freeing %s memory:
>> %dK\n", s, size);
>
> Yes, thank you very much! Now I want to disable the 'Freeing' behavior
> to reduce boot time, is there a kernel config or cmdline option? I am
> not sure if I can disable CONFIG_HIGHMEM to archive this purpose.
Why not bother to read the code?
712 void free_initmem(void)
713 {
714 #ifdef CONFIG_HAVE_TCM
715 extern char __tcm_start, __tcm_end;
716
717 totalram_pages += free_area(__phys_to_pfn(__pa(&__tcm_start)),
718 __phys_to_pfn(__pa(&__tcm_end)),
719 "TCM link");
720 #endif
721
722 if (!machine_is_integrator() && !machine_is_cintegrator())
723 totalram_pages += free_area(__phys_to_pfn(__pa(__init_begin)),
724 __phys_to_pfn(__pa(__init_end)),
725 "init");
726 }
727
478 static inline int free_area(unsigned long pfn, unsigned long end, char *s)
479 {
480 unsigned int pages = 0, size = (end - pfn) << (PAGE_SHIFT - 10);
481
482 for (; pfn < end; pfn++) {
483 struct page *page = pfn_to_page(pfn);
484 ClearPageReserved(page);
485 init_page_count(page);
486 __free_page(page);
487 pages++;
488 }
489
490 if (size && s)
491 printk(KERN_INFO "Freeing %s memory: %dK\n", s, size);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Does this really mean operations before the "Freeing init memory" cause the delay????
You want to bypass "Now I want to disable the 'Freeing' behavior", are you kidding?
Please select printk timing the kernel hacking to find out where the delay actually lies.
>> So, I want to know, who was printing this message and
>>> how can I disable the behavior to save some boot time since I don't care
>>> losting of several hundreds kilo bytes of memory.
>>>
>>> Thanks in advance.
>>> woody
>>>
>>> --
>>> I can't go back to yesterday - because I was a different person then
>>>
>>> _______________________________________________
>>> Kernelnewbies mailing list
>>> Kernelnewbies at kernelnewbies.org
>>> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>>
>> Cheers,
>>
>> marek
>>
>> --
>> as simple and primitive as possible
>> -------------------------------------------------
>> Marek Belisko - OPEN-NANDRA
>> Freelance Developer
>>
>> Ruska Nova Ves 219 | Presov, 08005 Slovak Republic
>> Tel: +421 915 052 184
>> skype: marekwhite
>> twitter: #opennandra
>> web: http://open-nandra.com
>
--
?????????,??????????
--bill
next prev parent reply other threads:[~2013-08-15 9:29 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-15 8:08 Who is 'Freeing init memory ...' Woody Wu
2013-08-15 8:41 ` Belisko Marek
2013-08-15 8:51 ` Woody Wu
2013-08-15 9:29 ` bill4carson [this message]
2013-08-15 9:40 ` Woody Wu
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=520C9F61.4020201@gmail.com \
--to=bill4carson@gmail.com \
--cc=kernelnewbies@lists.kernelnewbies.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 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.