public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Avi Kivity <avi@redhat.com>
Cc: Hagen Paul Pfeifer <hagen@jauu.net>,
	David Miller <davem@davemloft.net>,
	netdev <netdev@vger.kernel.org>,
	Arnaldo Carvalho de Melo <acme@infradead.org>,
	Ben Hutchings <bhutchings@solarflare.com>
Subject: Re: [PATCH v2] net: filter: Just In Time compiler
Date: Wed, 20 Apr 2011 10:07:58 +0200	[thread overview]
Message-ID: <1303286878.3186.17.camel@edumazet-laptop> (raw)
In-Reply-To: <4DAE8E47.7040409@redhat.com>

Le mercredi 20 avril 2011 à 10:41 +0300, Avi Kivity a écrit :
> On 04/14/2011 07:05 PM, Eric Dumazet wrote:
> > Le jeudi 14 avril 2011 à 18:53 +0300, Avi Kivity a écrit :
> >
> > >  IMO, it will.  I'll try to have gcc optimize your example filter later.
> >
> > Sure you can JIT a C program from bpf. It should take maybe 30 minutes.
> > It certainly is more easy than JIT an binary/assembly code :)
> >
> > Now take a look how I call slowpath, I am not sure gcc will actually
> > generate better code because of C conventions.
> 
> Some things will be the same (like calling a function outside the jit).  
> Some things will be faster.
> 
> > Loading a filter should be fast.
> > Invoking a compiler is just too much work for BPF.
> > Remember loading a filter is available to any user.
> 
> Like I mentioned before, use the interpreter until the result of the 
> jitter is available.
> 
> > This idea would be good for netfilter stuff, because we dont load
> > iptables rules that often.
> >
> > But still, the netfilter mainloop can be converted as a kernel JIT, most
> > probably. All the complex stuff (matches, targets) must call external
> > procedures anyway.
> 
> We could convert some matches to bytecode, probably.
> 
> To avoid getting into an infinite loop (btw, does you jit avoid infinite 
> loops in the generated code?) I'll restate what I think are an external 
> jit's advantages and then stop harping on the subject:
> 
> - less effort
> - less kernel code
> - better arch support
> - better optimization
> - better profiler/debugger integration
> - multiple optimization levels (can use your jitter in userspace, or 
> gcc, or llvm)
> 

No problem, I'll wait your work on this then.

I disagree having a gcc on production machines, I'm not sure it will
please admins...

Thanks



  reply	other threads:[~2011-04-20  8:08 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-02 22:28 [PATCH v1] net: filter: Just In Time compiler Eric Dumazet
2011-04-02 22:50 ` Hagen Paul Pfeifer
2011-04-03  5:41   ` Eric Dumazet
2011-04-02 22:53 ` Ben Hutchings
2011-04-03 13:56   ` [PATCH v2] " Eric Dumazet
2011-04-04  5:07     ` David Miller
2011-04-04  5:21       ` Eric Dumazet
2011-04-14 14:40     ` Avi Kivity
2011-04-14 14:55       ` Hagen Paul Pfeifer
2011-04-14 15:41         ` Avi Kivity
2011-04-14 15:45           ` Eric Dumazet
2011-04-14 15:53             ` Avi Kivity
2011-04-14 16:05               ` Eric Dumazet
2011-04-20  7:41                 ` Avi Kivity
2011-04-20  8:07                   ` Eric Dumazet [this message]
2011-04-20  8:14                     ` David Miller
2011-04-20  8:27                       ` Hagen Paul Pfeifer
2011-04-20 19:27                       ` Eric Dumazet
2011-04-28  6:05                         ` David Miller
2011-04-20  8:12                   ` David Miller
2011-04-14 15:40       ` Eric Dumazet
2011-04-14 15:45         ` Avi Kivity
2011-04-03  5:43 ` [PATCH v1] " David Miller
2011-04-03  9:04   ` Eric Dumazet

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1303286878.3186.17.camel@edumazet-laptop \
    --to=eric.dumazet@gmail.com \
    --cc=acme@infradead.org \
    --cc=avi@redhat.com \
    --cc=bhutchings@solarflare.com \
    --cc=davem@davemloft.net \
    --cc=hagen@jauu.net \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox