Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754225AbcLLKYI (ORCPT ); Mon, 12 Dec 2016 05:24:08 -0500 Received: from pandora.armlinux.org.uk ([78.32.30.218]:47520 "EHLO pandora.armlinux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752203AbcLLKYH (ORCPT ); Mon, 12 Dec 2016 05:24:07 -0500 Date: Mon, 12 Dec 2016 10:23:43 +0000 From: Russell King - ARM Linux To: Maninder Singh Cc: nicolas.pitre@linaro.org, ssantosh@kernel.org, panand@redhat.com, arnd@arndb.de, chris.brandt@renesas.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, pankaj.m@samsung.com, ajeet.y@samsung.com, Vaneet Narang Subject: Re: [PATCH 1/1] arm/module: maximum utilization of module area. Message-ID: <20161212102342.GT14217@n2100.armlinux.org.uk> References: <1481012975-44478-1-git-send-email-maninder1.s@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1481012975-44478-1-git-send-email-maninder1.s@samsung.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1709 Lines: 47 On Tue, Dec 06, 2016 at 01:59:35PM +0530, Maninder Singh wrote: > This patch defines new macro MODULE_START to ensure kernel text > and module remains within 32 MB of address range. > > Tried this patch by inserting 20 MB size module on 4.1 kernel:- > > Earlier:- > ========== > sh# insmod size.ko > .... > insmod: ERROR: could not insert module size.ko: Cannot allocate memory > sh# > > With this patch > =============== > sh# insmod size.ko > ... > sh# lsmod > Module Size Used by > size 20972425 0 > > Signed-off-by: Vaneet Narang > Signed-off-by: Maninder Singh > Reviewed-by: Ajeet Yadav A PC24 relocation has a range of +/-32MB. This means that where-ever the module is placed, it must be capable of reaching any function within the kernel text, which may itself be quite large (eg, 8MB, or possibly larger). The module area exists to allow modules to be located in an area where PC24 relocations are able to reach all of the kernel text on sensibly configured kernels, thereby allowing for optimal performance. If you wish to load large modules, then enable ARM_MODULE_PLTS, which will use the less efficient PLT method (which is basically an indirect function call) for relocations that PC24 can't handle, and will allow the module to be loaded into the vmalloc area. Growing the module area so that smaller modules also get penalised by the PLT indirection is not sane. So, I'm afraid this change is not acceptable. -- RMK's Patch system: http://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up according to speedtest.net.