Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933428AbaLDXbD (ORCPT ); Thu, 4 Dec 2014 18:31:03 -0500 Received: from mail-qa0-f45.google.com ([209.85.216.45]:49067 "EHLO mail-qa0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933215AbaLDXbA (ORCPT ); Thu, 4 Dec 2014 18:31:00 -0500 MIME-Version: 1.0 In-Reply-To: <1417734891.22424.2.camel@edumazet-glaptop2.roam.corp.google.com> References: <1417734048.2721.22.camel@perches.com> <1417734891.22424.2.camel@edumazet-glaptop2.roam.corp.google.com> Date: Thu, 4 Dec 2014 15:31:00 -0800 Message-ID: Subject: Re: [PATCH] x86: bpf_jit_comp: Reduce is_ereg() code size From: Alexei Starovoitov To: Eric Dumazet Cc: Joe Perches , Quentin Lambert , "David S. Miller" , Alexey Kuznetsov , James Morris , Hideaki YOSHIFUJI , Patrick McHardy , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , "x86@kernel.org" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 4, 2014 at 3:14 PM, Eric Dumazet wrote: > On Thu, 2014-12-04 at 15:00 -0800, Joe Perches wrote: >> Use the (1 << reg) & mask trick to reduce code size. >> >> x86-64 size difference -O2 without profiling for various >> gcc versions: > >> >> Signed-off-by: Joe Perches >> --- >> >> compiled, untested by me, but per Alexei Starovoitov this passes >> the test_bpf suite > > Really, the root cause of this is the 'inline' abuse in non fast paths > for non trivial functions. well, it is a trivial function even from compiler point of view. Dropping inline keyword doesn't help. gcc still inlines them. Changing all 3 functions to _noinline_ doesn't help either. So I think this patch is actually quite helpful to reduce code size. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/