From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965537Ab3CZPif (ORCPT ); Tue, 26 Mar 2013 11:38:35 -0400 Received: from mail-pa0-f51.google.com ([209.85.220.51]:51043 "EHLO mail-pa0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965268Ab3CZPX3 (ORCPT ); Tue, 26 Mar 2013 11:23:29 -0400 Message-ID: <5151BD61.7020401@gmail.com> Date: Tue, 26 Mar 2013 23:23:13 +0800 From: Jiang Liu User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130308 Thunderbird/17.0.4 MIME-Version: 1.0 To: Mark Salter CC: Andrew Morton , David Rientjes , Jiang Liu , Wen Congyang , Mel Gorman , Minchan Kim , KAMEZAWA Hiroyuki , Michal Hocko , Jianguo Wu , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Aurelien Jacquiot , linux-c6x-dev@linux-c6x.org Subject: Re: [RFC PATCH v2, part4 03/39] c6x: normalize global variables exported by vmlinux.lds References: <1364109934-7851-1-git-send-email-jiang.liu@huawei.com> <1364109934-7851-4-git-send-email-jiang.liu@huawei.com> <1364234218.2334.2.camel@t520.redhat.com> In-Reply-To: <1364234218.2334.2.camel@t520.redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/26/2013 01:56 AM, Mark Salter wrote: > On Sun, 2013-03-24 at 15:24 +0800, Jiang Liu wrote: >> Normalize global variables exported by vmlinux.lds to conform usage >> guidelines from include/asm-generic/sections.h. >> >> Use _text to mark the start of the kernel image including the head text, >> and _stext to mark the start of the .text section. >> >> This patch also fixes possible bugs due to current address layout that >> [__init_begin, __init_end] is a sub-range of [_stext, _etext] and pages >> within range [__init_begin, __init_end] will be freed by free_initmem(). > > I won't have time to look at this in detail until later this week, but > the reason for that layout is because c6x commonly stores text in flash. > Not all of the xip support is in-tree yet, but when it is, we don't want > to free init text. Hi Mark, Thanks for reminder. It's possible to support the usage case you have described, please take a look at arch/tile/kernel/vmlinux.lds.S. By that way, we could only free init.data sections without freeing init.text sections. Regards! Gerry > > --Mark > >> >> Signed-off-by: Jiang Liu >> Cc: Mark Salter >> Cc: Aurelien Jacquiot >> Cc: linux-c6x-dev@linux-c6x.org >> Cc: linux-kernel@vger.kernel.org >> --- >> arch/c6x/kernel/vmlinux.lds.S | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/arch/c6x/kernel/vmlinux.lds.S b/arch/c6x/kernel/vmlinux.lds.S >> index 1d81c4c..279d807 100644 >> --- a/arch/c6x/kernel/vmlinux.lds.S >> +++ b/arch/c6x/kernel/vmlinux.lds.S >> @@ -54,16 +54,15 @@ SECTIONS >> } >> >> . = ALIGN(PAGE_SIZE); >> + __init_begin = .; >> .init : >> { >> - _stext = .; >> _sinittext = .; >> HEAD_TEXT >> INIT_TEXT >> _einittext = .; >> } >> >> - __init_begin = _stext; >> INIT_DATA_SECTION(16) >> >> PERCPU_SECTION(128) >> @@ -74,6 +73,7 @@ SECTIONS >> .text : >> { >> _text = .; >> + _stext = .; >> TEXT_TEXT >> SCHED_TEXT >> LOCK_TEXT > > From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx177.postini.com [74.125.245.177]) by kanga.kvack.org (Postfix) with SMTP id EBA726B00E4 for ; Tue, 26 Mar 2013 11:23:29 -0400 (EDT) Received: by mail-pa0-f52.google.com with SMTP id fb10so96065pad.11 for ; Tue, 26 Mar 2013 08:23:29 -0700 (PDT) Message-ID: <5151BD61.7020401@gmail.com> Date: Tue, 26 Mar 2013 23:23:13 +0800 From: Jiang Liu MIME-Version: 1.0 Subject: Re: [RFC PATCH v2, part4 03/39] c6x: normalize global variables exported by vmlinux.lds References: <1364109934-7851-1-git-send-email-jiang.liu@huawei.com> <1364109934-7851-4-git-send-email-jiang.liu@huawei.com> <1364234218.2334.2.camel@t520.redhat.com> In-Reply-To: <1364234218.2334.2.camel@t520.redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Mark Salter Cc: Andrew Morton , David Rientjes , Jiang Liu , Wen Congyang , Mel Gorman , Minchan Kim , KAMEZAWA Hiroyuki , Michal Hocko , Jianguo Wu , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Aurelien Jacquiot , linux-c6x-dev@linux-c6x.org On 03/26/2013 01:56 AM, Mark Salter wrote: > On Sun, 2013-03-24 at 15:24 +0800, Jiang Liu wrote: >> Normalize global variables exported by vmlinux.lds to conform usage >> guidelines from include/asm-generic/sections.h. >> >> Use _text to mark the start of the kernel image including the head text, >> and _stext to mark the start of the .text section. >> >> This patch also fixes possible bugs due to current address layout that >> [__init_begin, __init_end] is a sub-range of [_stext, _etext] and pages >> within range [__init_begin, __init_end] will be freed by free_initmem(). > > I won't have time to look at this in detail until later this week, but > the reason for that layout is because c6x commonly stores text in flash. > Not all of the xip support is in-tree yet, but when it is, we don't want > to free init text. Hi Mark, Thanks for reminder. It's possible to support the usage case you have described, please take a look at arch/tile/kernel/vmlinux.lds.S. By that way, we could only free init.data sections without freeing init.text sections. Regards! Gerry > > --Mark > >> >> Signed-off-by: Jiang Liu >> Cc: Mark Salter >> Cc: Aurelien Jacquiot >> Cc: linux-c6x-dev@linux-c6x.org >> Cc: linux-kernel@vger.kernel.org >> --- >> arch/c6x/kernel/vmlinux.lds.S | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/arch/c6x/kernel/vmlinux.lds.S b/arch/c6x/kernel/vmlinux.lds.S >> index 1d81c4c..279d807 100644 >> --- a/arch/c6x/kernel/vmlinux.lds.S >> +++ b/arch/c6x/kernel/vmlinux.lds.S >> @@ -54,16 +54,15 @@ SECTIONS >> } >> >> . = ALIGN(PAGE_SIZE); >> + __init_begin = .; >> .init : >> { >> - _stext = .; >> _sinittext = .; >> HEAD_TEXT >> INIT_TEXT >> _einittext = .; >> } >> >> - __init_begin = _stext; >> INIT_DATA_SECTION(16) >> >> PERCPU_SECTION(128) >> @@ -74,6 +73,7 @@ SECTIONS >> .text : >> { >> _text = .; >> + _stext = .; >> TEXT_TEXT >> SCHED_TEXT >> LOCK_TEXT > > -- 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: email@kvack.org