lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sun, 26 May 2013 21:55:34 +0800
From:	Liu Jiang <liuj97@...il.com>
To:	Sonic Zhang <sonic.adi@...il.com>
CC:	Andrew Morton <akpm@...ux-foundation.org>,
	Jiang Liu <jiang.liu@...wei.com>,
	David Rientjes <rientjes@...gle.com>,
	Wen Congyang <wency@...fujitsu.com>,
	Mel Gorman <mgorman@...e.de>, Minchan Kim <minchan@...nel.org>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>,
	Michal Hocko <mhocko@...e.cz>,
	James Bottomley <james.bottomley@...senpartnership.com>,
	Sergei Shtylyov <sergei.shtylyov@...entembedded.com>,
	David Howells <dhowells@...hat.com>,
	Mark Salter <msalter@...hat.com>,
	Jianguo Wu <wujianguo@...wei.com>, linux-mm@...ck.org,
	linux-arch@...r.kernel.org,
	Linux Kernel <linux-kernel@...r.kernel.org>,
	Mike Frysinger <vapier@...too.org>,
	Bob Liu <lliubbo@...il.com>,
	uclinux-dist-devel <uclinux-dist-devel@...ckfin.uclinux.org>
Subject: Re: [PATCH v5, part4 16/41] mm/blackfin: prepare for removing num_physpages
 and simplify mem_init()

On Sat 25 May 2013 09:25:47 PM CST, Sonic Zhang wrote:
> Hi Jiang
>
> On Wed, May 8, 2013 at 11:51 PM, Jiang Liu <liuj97@...il.com> wrote:
>> Prepare for removing num_physpages and simplify mem_init().
>>
>> Signed-off-by: Jiang Liu <jiang.liu@...wei.com>
>> Cc: Mike Frysinger <vapier@...too.org>
>> Cc: Bob Liu <lliubbo@...il.com>
>> Cc: uclinux-dist-devel@...ckfin.uclinux.org
>> Cc: linux-kernel@...r.kernel.org
>> ---
>>  arch/blackfin/mm/init.c |   38 ++++++--------------------------------
>>  1 file changed, 6 insertions(+), 32 deletions(-)
>>
>> diff --git a/arch/blackfin/mm/init.c b/arch/blackfin/mm/init.c
>> index 1cc8607..e4b6e11 100644
>> --- a/arch/blackfin/mm/init.c
>> +++ b/arch/blackfin/mm/init.c
>> @@ -90,43 +90,17 @@ asmlinkage void __init init_pda(void)
>>
>>  void __init mem_init(void)
>>  {
>> -       unsigned int codek = 0, datak = 0, initk = 0;
>> -       unsigned int reservedpages = 0, freepages = 0;
>> -       unsigned long tmp;
>> -       unsigned long start_mem = memory_start;
>> -       unsigned long end_mem = memory_end;
>> +       char buf[64];
>>
>> -       end_mem &= PAGE_MASK;
>> -       high_memory = (void *)end_mem;
>> -
>> -       start_mem = PAGE_ALIGN(start_mem);
>> -       max_mapnr = num_physpages = MAP_NR(high_memory);
>> -       printk(KERN_DEBUG "Kernel managed physical pages: %lu\n", num_physpages);
>> +       high_memory = (void *)(memory_end & PAGE_MASK);
>> +       max_mapnr = MAP_NR(high_memory);
>> +       printk(KERN_DEBUG "Kernel managed physical pages: %lu\n", max_mapnr);
>>
>>         /* This will put all low memory onto the freelists. */
>>         free_all_bootmem();
>>
>> -       reservedpages = 0;
>> -       for (tmp = ARCH_PFN_OFFSET; tmp < max_mapnr; tmp++)
>> -               if (PageReserved(pfn_to_page(tmp)))
>> -                       reservedpages++;
>> -       freepages =  max_mapnr - ARCH_PFN_OFFSET - reservedpages;
>> -
>> -       /* do not count in kernel image between _rambase and _ramstart */
>> -       reservedpages -= (_ramstart - _rambase) >> PAGE_SHIFT;
>> -#if (defined(CONFIG_BFIN_EXTMEM_ICACHEABLE) && ANOMALY_05000263)
>> -       reservedpages += (_ramend - memory_end - DMA_UNCACHED_REGION) >> PAGE_SHIFT;
>> -#endif
>> -
>> -       codek = (_etext - _stext) >> 10;
>> -       initk = (__init_end - __init_begin) >> 10;
>> -       datak = ((_ramstart - _rambase) >> 10) - codek - initk;
>> -
>> -       printk(KERN_INFO
>> -            "Memory available: %luk/%luk RAM, "
>> -               "(%uk init code, %uk kernel code, %uk data, %uk dma, %uk reserved)\n",
>> -               (unsigned long) freepages << (PAGE_SHIFT-10), (_ramend - CONFIG_PHY_RAM_BASE_ADDRESS) >> 10,
>> -               initk, codek, datak, DMA_UNCACHED_REGION >> 10, (reservedpages << (PAGE_SHIFT-10)));
>
> You can't remove all these memory information for blackfin. They are
> useful on blackfin platform.
>
> Regards,
>
> Sonic

Hi Sonic,
           Thanks for review!
           We are not trying to remove these code, but replacing it 
with a generic
helper function mem_init_print_info(), which will print similar (actual 
more info)
boot message. I have no blackfin platforms to generate a real boot 
message,
so could only share an example boot messages on x86:
Memory: 7744624K/8074824K available (6969K kernel code, 1011K data, 
2828K rodata, 1016K init, 9640K bss, 330200K reserved)

Regards!
Gerry
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ