lkml.org 
[lkml]   [2009]   [Aug]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 0/2] eventfd: new EFD_STATE flag
On Wed, Aug 26, 2009 at 01:04:09PM -0700, Davide Libenzi wrote:
> On Wed, 26 Aug 2009, Gleb Natapov wrote:
>
> > On Wed, Aug 26, 2009 at 10:42:05PM +0300, Avi Kivity wrote:
> > > On 08/26/2009 10:13 PM, Davide Libenzi wrote:
> > > >Ok, so why not using the eventfd counter as state?
> > > >On the device side:
> > > >
> > > >void write_state(int sfd, int state) {
> > > > u64 cnt;
> > > >
> > > > /* Clear the current state, sfd is in non-blocking mode */
> > > > read(sfd,&cnt, sizeof(cnt));
> > > > /* Writes new state */
> > > > cnt = 1 + !!state;
> > > > write(sfd,&cnt, sizeof(cnt));
> > > >}
> > > >
> > > >
> > > >On the hypervisor side:
> > > >
> > > >int read_state(int sfd) {
> > > > u64 cnt;
> > > >
> > > > read(sfd,&cnt, sizeof(cnt));
> > > > return state - 1;
> > > >}
> > > >
> > >
> > > Hadn't though of read+write as set. While the 1+ is a little ugly,
> > > it's workable.
> > >
> > It's two system calls instead of one to inject interrupt.
>
> I guess that's going to completely throw off-chart your RT performance,
> doesn't it?
>
Do you consider interrupt injection path not worth of optimizing?

--
Gleb.


\
 
 \ /
  Last update: 2009-08-27 07:27    [W:0.092 / U:4.100 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site