Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754367AbcJMLL1 (ORCPT ); Thu, 13 Oct 2016 07:11:27 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:51367 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753955AbcJMLLT (ORCPT ); Thu, 13 Oct 2016 07:11:19 -0400 From: Arnd Bergmann To: "Mintz, Yuval" Cc: Ariel Elior , "everest-linux-l2@qlogic.com" , Alexander Duyck , "Amrani, Ram" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "David S. Miller" Subject: Re: [PATCH] qede: fix CONFIG_INFINIBAND_QEDR=m build error Date: Thu, 13 Oct 2016 12:50:01 +0200 Message-ID: <42891984.bIYIOYDk0K@wuerfel> User-Agent: KMail/5.1.3 (Linux/4.4.0-34-generic; KDE/5.18.0; x86_64; ; ) In-Reply-To: References: <20161012103340.978726-1-arnd@arndb.de> <5662883.yo8OytxU65@wuerfel> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:lRqC0fHFRqd0YUhhw9pqlr+/lcyA5Tr1wc3pROebfrMAfTrKP9f wBewipk8z2a0OnCg0Y1xWy++1K4/v84A9zgKboNZpMnvTlDXhMuwyzxfUZYKv5pB+KLuHSg SRi2tJ96FcsYrxf1MmW/5pq0B0wDXyB1PNF7+09eEmtnfU2rU9tR1fJQIWlKQdu6c1akUI4 JpEHlRZ6iRvNXdzfPsB7g== X-UI-Out-Filterresults: notjunk:1;V01:K0:Ji1vhz0qTPA=:uvyD9X0JjOPeBDtycsrEYf twsVhYpicrcgNeHtk6GBBPugdC38OYm0UIsurvI4aDJF6QgF0xOpxZ3YDtt0PawLchZrbPOA1 ozlxB+mM0hwtuzgXpc/Z0d884eRHI21UEFNgYs4S5xk3YnYJ5ZNtXhcUdcM5zKK5sU4FlhQ44 Cxos4eydDuQni8k2KcGDvJuE8vFqqr+LX6Lcst0s2M5wlV7gOo97AcxDp01WotpO3rBtQ8CRb bLNsDkikOWAczdDN7Bi9cazJGfNSnRmaT4GuiFLprXH9rfYytv9QCl6yN4ZhfrXIxT40Uucg4 jBs/WXbKbEw/XbRdq9d+QovsGpDrht96qNLX38a7SvTZkDr1W2BpJE2YuN1gdQl9/U5l/haZ+ +nxe//bWuL2FtHRoFaGrsxgJu2bzLuqz7kmWaHxxUe67carlzKVJNs9iaXQm1+cpSNSDNHmxs JGp0rFOcjfub29QTJjkELa20pygZJzDCT1gTfz/t4nkdkCSOyoLJuMhEmS7TyYIDkOyu5pxxi nzVLDTF6GIMAWeBZDoypr4u+rirJDrKN09x5PNhPYdRG/p5VPSvv+uGUljoPcPH/g0bdWpUKD sCn4eHcTQDKo+ups/fT/VOR6Y55FiEq+ltiNBKwISoZt/rg+Rv5XR/Xfz/s0wGsQtmSHkKgER 9lbYzBnP8aoPGANhL5fsIb5F49ht8J+Qceu8Va4YLBakUEfjHQEzMA5R+26VesEc+3iFw2ErO 0eslxmMKTecHW+Q6OFiSphkuE3UbKHJdR+xCJJTIWerTWYIL2uqhVCk1GDG1O6bNbWAWuvtDx C3kkeBOAQ7MUJ0XxIogQ7q5EvhDQyq1iaAXJXrrBitRDsxfPdqyYMKDle42NeYUsWAezdKVRy NJfQanJXxEk8ORWUiVZSTyg9mssM5pOjT/gGIxHg4= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2042 Lines: 40 On Thursday, October 13, 2016 10:44:36 AM CEST Mintz, Yuval wrote: > > > > > While I don't mind, you could have argued is that we're not > > > > > removing enough, not too much. > > > > > I.e., perhaps the rdma_msix_* fields should also have been > > > > > ifdef-ed instead. [in which case this solution would not have > > > > > worked] > > > > > > > > That would add even more #ifdefs though. > > > > > > I agree. Although I'm never clear on the guidelines for the tradeoff - > > > How much memory/code is considered too much so that you'd have To > > > ifdef code out instead of 'wasting'? > > > [I obviously don't claim 64 bytes of memory hit that threshold] > > > > I don't think code size should ever be a reason for an #ifdef in a .c > > file: if the code is well-structured, you can always get the same object code > > using if(IS_ENABLED()) checks within the code at better readability or better > > compile-time coverage. > > > > Between if(IS_ENABLED()) checks and inline helpers, it usually doesn't matter > > much either way as long as the separation between the modules is clear enough. > > In the example above, removing the structure fields however would require to > > move the debugging output into another inline function though. > > Still, the question remains - If we were to allocate X bytes of memory > per-something [in this case, per qed owned PCI function], and that memory > wouldn't be functional without a some CONFIG option enabled, > how big should X become before we'd decide the fields should also be > dependent on the option? > It bears no real relevance to this case, as the fields involved are > insignificantly small. But still - is there a rule of thumb here? I don't think there is a good general rule for that, given the vastly different memory sizes in machines. For a tiny embedded machine with 2MB of RAM, saving one kilobyte is very significant, while an any machine that uses a 500KB qed driver module probably has many gigabytes of RAM and doesn't care much about a a wasted megabyte. Arnd