Re: aio is unlikely

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 18 May 2007 16:49:49 -0400
"Alex Volkov" <[email protected]> wrote:

> 
> Andrew Morton wrote:
> >     aio is unlikely
> >     Stick an unlikely() around is_aio(): I assert that most IO is
> synchronous.
> >
> > -#define in_aio() !is_sync_wait(current->io_wait)
> > +#define in_aio() (unlikely(!is_sync_wait(current->io_wait)))
> 
> > Jeff Garzik <[email protected]> wrote:
> > 
> > > > -#define in_aio() !is_sync_wait(current->io_wait)
> > > > +#define in_aio() (unlikely(!is_sync_wait(current->io_wait)))
> > > 
> > > Please revert.  Workload-dependent "likelihood" should not cause 
> > > programmers to add such markers.
> > a) disagree with the above
> > 
> > b) if in_aio() ever returns true we do
> > 
> > 	printk(KERN_ERR "%s(%s:%d) called in async context!\n",
> > 		__FUNCTION__, __FILE__, __LINE__);
> > 
> >    so I sure hope it's unlikely for all workloads. 
> 
> Shouldn't unlikely() go where in_aio() is actually used, if we printk(error)
> there?
> Isn't putting likely/unlikely into a boolean function-like macro itself
> asking for later trouble?
> 

Yes, if you agree with Jeff's original point.

But I don't, actually.  Sure, on some machines+workloads, AIO is more
common than sync IO.  But I expect that when we sum across all the
machines+workloads in the world, sync IO is more common and is hence the
case we should optimise for.

That's assuming that the unlikely() actually does something.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux