Re: [ovs-dev] [PATCH] ofproto-dpif-upcall: Batch upcalls.

2013-08-28 Thread Ben Pfaff
On Aug 28, 2013 11:54 AM, "Jarno Rajahalme" wrote: > > > On Aug 28, 2013, at 9:39 AM, Jarno Rajahalme wrote: > >> One specific race that I was concerned about is: > >> > >> 1. This code in udpif_miss_handler() checks n_upcalls and sees that it > >> is zero. > >> > >> if (!handler->n_upcall

Re: [ovs-dev] [PATCH] ofproto-dpif-upcall: Batch upcalls.

2013-08-28 Thread Jarno Rajahalme
On Aug 28, 2013, at 9:39 AM, Jarno Rajahalme wrote: >> One specific race that I was concerned about is: >> >> 1. This code in udpif_miss_handler() checks n_upcalls and sees that it >> is zero. >> >> if (!handler->n_upcalls) { >> >> 2. This code in recv_upcalls() signals wake_cond: >> >

Re: [ovs-dev] [PATCH] ofproto-dpif-upcall: Batch upcalls.

2013-08-28 Thread Jarno Rajahalme
On Aug 27, 2013, at 11:02 PM, Ben Pfaff wrote: > On Tue, Aug 27, 2013 at 03:50:06PM -0700, Jarno Rajahalme wrote: >> >> On Aug 27, 2013, at 3:13 PM, Ben Pfaff wrote: >> >>> On Tue, Aug 27, 2013 at 03:04:54PM -0700, Jarno Rajahalme wrote: Batching reduces overheads and enables upto 4 time

Re: [ovs-dev] [PATCH] ofproto-dpif-upcall: Batch upcalls.

2013-08-28 Thread Ben Pfaff
Which race? The one that I described as maybe not possible (do you see how?) Or some other race? On Aug 27, 2013 11:48 PM, "Ethan Jackson" wrote: > I'm happy with it as long as we fix the race. > > Ethan > > On Tue, Aug 27, 2013 at 11:02 PM, Ben Pfaff wrote: > > On Tue, Aug 27, 2013 at 03:50:06P

Re: [ovs-dev] [PATCH] ofproto-dpif-upcall: Batch upcalls.

2013-08-27 Thread Ethan Jackson
I'm happy with it as long as we fix the race. Ethan On Tue, Aug 27, 2013 at 11:02 PM, Ben Pfaff wrote: > On Tue, Aug 27, 2013 at 03:50:06PM -0700, Jarno Rajahalme wrote: >> >> On Aug 27, 2013, at 3:13 PM, Ben Pfaff wrote: >> >> > On Tue, Aug 27, 2013 at 03:04:54PM -0700, Jarno Rajahalme wrote:

Re: [ovs-dev] [PATCH] ofproto-dpif-upcall: Batch upcalls.

2013-08-27 Thread Ben Pfaff
On Tue, Aug 27, 2013 at 03:50:06PM -0700, Jarno Rajahalme wrote: > > On Aug 27, 2013, at 3:13 PM, Ben Pfaff wrote: > > > On Tue, Aug 27, 2013 at 03:04:54PM -0700, Jarno Rajahalme wrote: > >> Batching reduces overheads and enables upto 4 times the upcall processing > >> performance in a specializ

Re: [ovs-dev] [PATCH] ofproto-dpif-upcall: Batch upcalls.

2013-08-27 Thread Ethan Jackson
My thinking was that we need to take the lock when we do the xpthread_cond_signal() because if we don't it's possible the thread could go to sleep immediately after we make the signal call and essentially never wake up (or at least not until it's called again). On Tue, Aug 27, 2013 at 3:50 PM, Ja

Re: [ovs-dev] [PATCH] ofproto-dpif-upcall: Batch upcalls.

2013-08-27 Thread Jarno Rajahalme
On Aug 27, 2013, at 3:13 PM, Ben Pfaff wrote: > On Tue, Aug 27, 2013 at 03:04:54PM -0700, Jarno Rajahalme wrote: >> Batching reduces overheads and enables upto 4 times the upcall processing >> performance in a specialized test case. >> >> Signed-off-by: Jarno Rajahalme > > Nice! > >> +fo

Re: [ovs-dev] [PATCH] ofproto-dpif-upcall: Batch upcalls.

2013-08-27 Thread Ben Pfaff
On Tue, Aug 27, 2013 at 03:04:54PM -0700, Jarno Rajahalme wrote: > Batching reduces overheads and enables upto 4 times the upcall processing > performance in a specialized test case. > > Signed-off-by: Jarno Rajahalme Nice! > +for (n = 0; n < udpif->n_handlers; ++n) { > +handler = &

[ovs-dev] [PATCH] ofproto-dpif-upcall: Batch upcalls.

2013-08-27 Thread Jarno Rajahalme
Batching reduces overheads and enables upto 4 times the upcall processing performance in a specialized test case. Signed-off-by: Jarno Rajahalme --- ofproto/ofproto-dpif-upcall.c | 30 +++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/ofproto/ofproto