From mboxrd@z Thu Jan 1 00:00:00 1970 From: Damien Lespiau Subject: Re: [PATCH 1/2] drm/i915: Make the device_info structure __initconst Date: Thu, 10 Jul 2014 22:47:21 +0100 Message-ID: <20140710214721.GN3191@strange.ger.corp.intel.com> References: <1405000363-15950-1-git-send-email-damien.lespiau@intel.com> <20140710202527.GK17271@phenom.ffwll.local> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTP id 213246E01B for ; Thu, 10 Jul 2014 14:47:31 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20140710202527.GK17271@phenom.ffwll.local> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: Daniel Vetter Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Thu, Jul 10, 2014 at 10:25:27PM +0200, Daniel Vetter wrote: > On Thu, Jul 10, 2014 at 02:52:42PM +0100, Damien Lespiau wrote: > > We don't need them past the module initialization as the correct > > structure is copied into dev_priv in ->load(), called from > > drm_pci_init(), called from the module init funtion. > > > > I'm always hesitant about adding new members to struct intel_device_info > > because it will add 30+ * sizeof(member) bytes to the driver. However, > > if we can discard those table after init(), it changes everything. > > > > After this change, the driver has a new .init.rodata section contains > > the structures in question and .rodata has now 2848 fewer bytes. > > > > lsmod shows -5425 bytes in its size field between before and after this > > change. Not too sure why this (Vs the 2848 bytes lost in .rodata), but > > that's enough for me. > > > > Signed-off-by: Damien Lespiau > > You want devinintconst which is being phased out afaik ... Currently the > driver gets probed synchronously but you kinda never know what the device > core people are up to: > - init = removed after the module is loaded. > - devinit = removed after the driver is initilialized, and never for > CONFIG_HOTPLUG=y. > > If we want to trim down the size of our driver, especially on specific > platforms we imo should have a) link time optimization b) some > heavy-handed macro to return a static device info c) a much more clever > gcc since last time I've tried this it failed to kick out large swats of > code like all the dvo crap. Despite that it was clearly unreachable :( Sigh, I followed the !DRIVER_MODESET code path, I am very sad now. I was thinking about having a Kconfig option to select a specific platform to compile the driver for and, by trying to make that work, we could end up with a nice per-platform split of the code. Would people be totally opposed to such a thing? -- Damien