Return-Path: Received: from mail-pf0-f175.google.com ([209.85.192.175]:38893 "EHLO mail-pf0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933533AbeCGWsq (ORCPT ); Wed, 7 Mar 2018 17:48:46 -0500 Received: by mail-pf0-f175.google.com with SMTP id d26so1552887pfn.5 for ; Wed, 07 Mar 2018 14:48:46 -0800 (PST) Date: Wed, 7 Mar 2018 14:48:39 -0800 From: Alexei Starovoitov To: Daniel Borkmann Cc: ast@kernel.org, netdev@vger.kernel.org Subject: Re: [PATCH bpf] bpf, x64: increase number of passes Message-ID: <20180307224837.w27anwe2csgbnlg2@ast-mbp> References: <20180307211001.25449-1-daniel@iogearbox.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180307211001.25449-1-daniel@iogearbox.net> Sender: netdev-owner@vger.kernel.org List-ID: On Wed, Mar 07, 2018 at 10:10:01PM +0100, Daniel Borkmann wrote: > In Cilium some of the main programs we run today are hitting 9 passes > on x64's JIT compiler, and we've had cases already where we surpassed > the limit where the JIT then punts the program to the interpreter > instead, leading to insertion failures due to CONFIG_BPF_JIT_ALWAYS_ON > or insertion failures due to the prog array owner being JITed but the > program to insert not (both must have the same JITed/non-JITed property). > > One concrete case the program image shrunk from 12,767 bytes down to > 10,288 bytes where the image converged after 16 steps. I've measured > that this took 340us in the JIT until it converges on my i7-6600U. Thus, > increase the original limit we had from day one where the JIT covered > cBPF only back then before we run into the case (as similar with the > complexity limit) where we trip over this and hit program rejections. > Also add a cond_resched() into the compilation loop, the JIT process > runs without any locks and may sleep anyway. > > Signed-off-by: Daniel Borkmann > Acked-by: Alexei Starovoitov Applied to bpf tree, Thanks Daniel!