From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tony Lindgren Subject: Re: [PATCH 2/2] arm: fix kernel image size Date: Wed, 22 Jun 2016 01:51:07 -0700 Message-ID: <20160622085105.GE22406@atomide.com> References: <20160621074319.GH22406@atomide.com> <20160621094737.GA5783@n2100.arm.linux.org.uk> <20160621103810.GI22406@atomide.com> <20160621105720.GK22406@atomide.com> <20160621154407.GB5783@n2100.arm.linux.org.uk> <20160621165523.GY22406@atomide.com> <20160621215141.GC5783@n2100.arm.linux.org.uk> <20160622073614.GZ22406@atomide.com> <20160622082958.GD5783@n2100.arm.linux.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <20160622082958.GD5783-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "kexec" Errors-To: kexec-bounces+glkk-kexec=m.gmane.org-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org To: Russell King - ARM Linux Cc: Pratyush Anand , Baoquan He , kexec-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, Simon Horman , Kees Cook , linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org List-Id: linux-omap@vger.kernel.org * Russell King - ARM Linux [160622 01:32]: > When CONFIG_DEBUG_RODATA is enabled, we align the text, read-only data, > data, and so on to 1MB boundaries so that we can change the permissions > of the sections to enforce the properties of the various ELF segments. > This padding massively inflates the size of the run-time kernel image, > and can result in megabytes of wastage (if we're as little as one byte > into 1MB, we have to round up to the next megabyte.) Yes understood, and looks like we cannot make any assumptions about what the alignment might be. > The padding, being a string of zeros, is very compressable, and this > increases the compression ratio. > > The BSS is not included in the compressed image, but needs to be taken > account of when avoiding overwriting the DTB. > > > How about we check the size of RAM available, and if there is plenty > > of RAM we use a safe compression ratio of 8. If RAM is a problem, > > we could make the compression ratio smaller and warn about it. And > > we could also allow passing the compression ratio to kexec as an > > option. > > You do know that you can already pass the "size" of the kernel to be > reserved to kexec. --image-size. It's not documented in --help, but > it is there (which is another annoying thing about ARM kexec...) Oh ok that's nice. Regards, Tony From mboxrd@z Thu Jan 1 00:00:00 1970 From: tony@atomide.com (Tony Lindgren) Date: Wed, 22 Jun 2016 01:51:07 -0700 Subject: [PATCH 2/2] arm: fix kernel image size In-Reply-To: <20160622082958.GD5783@n2100.arm.linux.org.uk> References: <20160621074319.GH22406@atomide.com> <20160621094737.GA5783@n2100.arm.linux.org.uk> <20160621103810.GI22406@atomide.com> <20160621105720.GK22406@atomide.com> <20160621154407.GB5783@n2100.arm.linux.org.uk> <20160621165523.GY22406@atomide.com> <20160621215141.GC5783@n2100.arm.linux.org.uk> <20160622073614.GZ22406@atomide.com> <20160622082958.GD5783@n2100.arm.linux.org.uk> Message-ID: <20160622085105.GE22406@atomide.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org * Russell King - ARM Linux [160622 01:32]: > When CONFIG_DEBUG_RODATA is enabled, we align the text, read-only data, > data, and so on to 1MB boundaries so that we can change the permissions > of the sections to enforce the properties of the various ELF segments. > This padding massively inflates the size of the run-time kernel image, > and can result in megabytes of wastage (if we're as little as one byte > into 1MB, we have to round up to the next megabyte.) Yes understood, and looks like we cannot make any assumptions about what the alignment might be. > The padding, being a string of zeros, is very compressable, and this > increases the compression ratio. > > The BSS is not included in the compressed image, but needs to be taken > account of when avoiding overwriting the DTB. > > > How about we check the size of RAM available, and if there is plenty > > of RAM we use a safe compression ratio of 8. If RAM is a problem, > > we could make the compression ratio smaller and warn about it. And > > we could also allow passing the compression ratio to kexec as an > > option. > > You do know that you can already pass the "size" of the kernel to be > reserved to kexec. --image-size. It's not documented in --help, but > it is there (which is another annoying thing about ARM kexec...) Oh ok that's nice. Regards, Tony From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Date: Wed, 22 Jun 2016 01:51:07 -0700 From: Tony Lindgren Subject: Re: [PATCH 2/2] arm: fix kernel image size Message-ID: <20160622085105.GE22406@atomide.com> References: <20160621074319.GH22406@atomide.com> <20160621094737.GA5783@n2100.arm.linux.org.uk> <20160621103810.GI22406@atomide.com> <20160621105720.GK22406@atomide.com> <20160621154407.GB5783@n2100.arm.linux.org.uk> <20160621165523.GY22406@atomide.com> <20160621215141.GC5783@n2100.arm.linux.org.uk> <20160622073614.GZ22406@atomide.com> <20160622082958.GD5783@n2100.arm.linux.org.uk> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20160622082958.GD5783@n2100.arm.linux.org.uk> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "kexec" Errors-To: kexec-bounces+dwmw2=infradead.org@lists.infradead.org To: Russell King - ARM Linux Cc: Pratyush Anand , Baoquan He , kexec@lists.infradead.org, Simon Horman , Kees Cook , linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org * Russell King - ARM Linux [160622 01:32]: > When CONFIG_DEBUG_RODATA is enabled, we align the text, read-only data, > data, and so on to 1MB boundaries so that we can change the permissions > of the sections to enforce the properties of the various ELF segments. > This padding massively inflates the size of the run-time kernel image, > and can result in megabytes of wastage (if we're as little as one byte > into 1MB, we have to round up to the next megabyte.) Yes understood, and looks like we cannot make any assumptions about what the alignment might be. > The padding, being a string of zeros, is very compressable, and this > increases the compression ratio. > > The BSS is not included in the compressed image, but needs to be taken > account of when avoiding overwriting the DTB. > > > How about we check the size of RAM available, and if there is plenty > > of RAM we use a safe compression ratio of 8. If RAM is a problem, > > we could make the compression ratio smaller and warn about it. And > > we could also allow passing the compression ratio to kexec as an > > option. > > You do know that you can already pass the "size" of the kernel to be > reserved to kexec. --image-size. It's not documented in --help, but > it is there (which is another annoying thing about ARM kexec...) Oh ok that's nice. Regards, Tony _______________________________________________ kexec mailing list kexec@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kexec