Re: aio is unlikely

2007-05-18 Thread Jeff Garzik
Nick Piggin wrote: Aside from using branch constructs or hints that help the predictor guess the right way... I think gcc will move unlikely paths right past the end of the "likely" fastpath, so it can increase code size and be somewhat suboptimal in terms of icache usage. Thanks for the

Re: aio is unlikely

2007-05-18 Thread Nick Piggin
Jeff Garzik wrote: Andrew Morton wrote: On Fri, 18 May 2007 17:54:32 -0400 Phillip Susi <[EMAIL PROTECTED]> wrote: But as Jeff said, that's not what unlikely is for. It should only be used when it is unlikely for everybody, all the time, because when it is right, it helps rather little,

Re: aio is unlikely

2007-05-18 Thread Jeff Garzik
Andrew Morton wrote: On Fri, 18 May 2007 17:54:32 -0400 Phillip Susi <[EMAIL PROTECTED]> wrote: Andrew Morton wrote: 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

Re: aio is unlikely

2007-05-18 Thread Andrew Morton
On Fri, 18 May 2007 17:54:32 -0400 Phillip Susi <[EMAIL PROTECTED]> wrote: > Andrew Morton wrote: > > 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

Re: aio is unlikely

2007-05-18 Thread Phillip Susi
Andrew Morton wrote: 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

Re: aio is unlikely

2007-05-18 Thread Jeff Garzik
Andrew Morton wrote: 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

Re: aio is unlikely

2007-05-18 Thread Andrew Morton
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() !i

RE: aio is unlikely

2007-05-18 Thread Alex Volkov
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 &

RE: aio is unlikely

2007-05-18 Thread Alex Volkov
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

Re: aio is unlikely

2007-05-18 Thread Andrew Morton
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

Re: aio is unlikely

2007-05-18 Thread Jeff Garzik
Andrew Morton wrote: 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

Re: aio is unlikely

2007-05-18 Thread Phillip Susi
Andrew Morton wrote: 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

Re: aio is unlikely

2007-05-18 Thread Andrew Morton
On Fri, 18 May 2007 17:54:32 -0400 Phillip Susi [EMAIL PROTECTED] wrote: Andrew Morton wrote: 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

Re: aio is unlikely

2007-05-18 Thread Jeff Garzik
Andrew Morton wrote: On Fri, 18 May 2007 17:54:32 -0400 Phillip Susi [EMAIL PROTECTED] wrote: Andrew Morton wrote: 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

Re: aio is unlikely

2007-05-18 Thread Nick Piggin
Jeff Garzik wrote: Andrew Morton wrote: On Fri, 18 May 2007 17:54:32 -0400 Phillip Susi [EMAIL PROTECTED] wrote: But as Jeff said, that's not what unlikely is for. It should only be used when it is unlikely for everybody, all the time, because when it is right, it helps rather little, but

Re: aio is unlikely

2007-05-18 Thread Jeff Garzik
Nick Piggin wrote: Aside from using branch constructs or hints that help the predictor guess the right way... I think gcc will move unlikely paths right past the end of the likely fastpath, so it can increase code size and be somewhat suboptimal in terms of icache usage. Thanks for the

Re: aio is unlikely

2007-05-09 Thread Jeff Garzik
Andrew Morton wrote: 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. hrm, indeed. Ignore me.

Re: aio is unlikely

2007-05-09 Thread Andrew Morton
On Wed, 09 May 2007 18:06:58 -0400 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

Re: aio is unlikely

2007-05-09 Thread Jeff Garzik
Morton <[EMAIL PROTECTED]> AuthorDate: Wed May 9 02:34:58 2007 -0700 Committer: Linus Torvalds <[EMAIL PROTECTED]> CommitDate: Wed May 9 12:30:54 2007 -0700 aio is unlikely Stick an unlikely() around is_aio(): I assert that most IO is synchronous. Cc: Suparna Bhattach

Re: aio is unlikely

2007-05-09 Thread Jeff Garzik
Morton [EMAIL PROTECTED] AuthorDate: Wed May 9 02:34:58 2007 -0700 Committer: Linus Torvalds [EMAIL PROTECTED] CommitDate: Wed May 9 12:30:54 2007 -0700 aio is unlikely Stick an unlikely() around is_aio(): I assert that most IO is synchronous. Cc: Suparna Bhattacharya [EMAIL

Re: aio is unlikely

2007-05-09 Thread Andrew Morton
On Wed, 09 May 2007 18:06:58 -0400 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. This is

Re: aio is unlikely

2007-05-09 Thread Jeff Garzik
Andrew Morton wrote: 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. hrm, indeed. Ignore me. Jeff