From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [PATCH 1/2] drm/i915: Make the device_info structure __initconst Date: Fri, 11 Jul 2014 08:33:42 +0200 Message-ID: <20140711063342.GQ17271@phenom.ffwll.local> References: <1405000363-15950-1-git-send-email-damien.lespiau@intel.com> <20140710202527.GK17271@phenom.ffwll.local> <20140710214721.GN3191@strange.ger.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-wg0-f45.google.com (mail-wg0-f45.google.com [74.125.82.45]) by gabe.freedesktop.org (Postfix) with ESMTP id 03AE46E7EE for ; Thu, 10 Jul 2014 23:33:34 -0700 (PDT) Received: by mail-wg0-f45.google.com with SMTP id x12so562860wgg.16 for ; Thu, 10 Jul 2014 23:33:32 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20140710214721.GN3191@strange.ger.corp.intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: Damien Lespiau Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Thu, Jul 10, 2014 at 10:47:21PM +0100, Damien Lespiau wrote: > 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? Not opposed if we're going to sign up the compiler for the resulting dce. If it'll result in #ifdef hell then no. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch