All of lore.kernel.org
 help / color / mirror / Atom feed
* Inexplicable I/O latency using worker threads
@ 2008-12-12  9:39 Thanos Makatos
  2008-12-12 17:46 ` Chris Snook
  0 siblings, 1 reply; 3+ messages in thread
From: Thanos Makatos @ 2008-12-12  9:39 UTC (permalink / raw)
  To: linux-kernel

Hello all.

I am facing a weird problem with a virtual block driver I made concerning excessive I/O latency.

My block driver intercepts requests and redirects them to a real block device,
but not just be setting the bio->bi_bdev field, I create new bios.

Anyway, my problem is that for load balancing reasons I need per-CPU worker threads
where I enqueue requests and let them do all the work. If I use 2 threads in a round
robin manner (request 1 served by CPU 0, 2 by CPU1, 3 by CPU0 and so on), performance
is inexplicably low.

If I choose only one CPU to act as a worker the problem is gone. The difference of measured
I/O latency is more than 30 times.

What could be happening?

I'm using a vanilla 2.6.18.8.

Thanx in advance.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Inexplicable I/O latency using worker threads
  2008-12-12  9:39 Inexplicable I/O latency using worker threads Thanos Makatos
@ 2008-12-12 17:46 ` Chris Snook
  2008-12-13 12:44   ` Thanos McAtos
  0 siblings, 1 reply; 3+ messages in thread
From: Chris Snook @ 2008-12-12 17:46 UTC (permalink / raw)
  To: Thanos Makatos; +Cc: linux-kernel

Thanos Makatos wrote:
> Hello all.
> 
> I am facing a weird problem with a virtual block driver I made concerning excessive I/O latency.
> 
> My block driver intercepts requests and redirects them to a real block device,
> but not just be setting the bio->bi_bdev field, I create new bios.
> 
> Anyway, my problem is that for load balancing reasons I need per-CPU worker threads
> where I enqueue requests and let them do all the work. If I use 2 threads in a round
> robin manner (request 1 served by CPU 0, 2 by CPU1, 3 by CPU0 and so on), performance
> is inexplicably low.
> 
> If I choose only one CPU to act as a worker the problem is gone. The difference of measured
> I/O latency is more than 30 times.
> 
> What could be happening?
> 
> I'm using a vanilla 2.6.18.8.
> 
> Thanx in advance.

a) I/O scheduling
b) lock contention

Do you really need to load balance I/O to a single bdev across multiple CPUs? 
Disk I/O generally isn't very CPU-intensive.

-- Chris

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Inexplicable I/O latency using worker threads
  2008-12-12 17:46 ` Chris Snook
@ 2008-12-13 12:44   ` Thanos McAtos
  0 siblings, 0 replies; 3+ messages in thread
From: Thanos McAtos @ 2008-12-13 12:44 UTC (permalink / raw)
  To: Chris Snook; +Cc: Thanos Makatos, linux-kernel

> Thanos Makatos wrote:
>> Hello all.
>>
>> I am facing a weird problem with a virtual block driver I made
>> concerning excessive I/O latency.
>>
>> My block driver intercepts requests and redirects them to a real block
>> device,
>> but not just be setting the bio->bi_bdev field, I create new bios.
>>
>> Anyway, my problem is that for load balancing reasons I need per-CPU
>> worker threads
>> where I enqueue requests and let them do all the work. If I use 2
>> threads in a round
>> robin manner (request 1 served by CPU 0, 2 by CPU1, 3 by CPU0 and so
>> on), performance
>> is inexplicably low.
>>
>> If I choose only one CPU to act as a worker the problem is gone. The
>> difference of measured
>> I/O latency is more than 30 times.
>>
>> What could be happening?
>>
>> I'm using a vanilla 2.6.18.8.
>>
>> Thanx in advance.
>
> a) I/O scheduling
What does I/O scheduling has to do with from where the I/O request
originates?
> b) lock contention
I doubt there is lock contention, my simple test uses 1 outstanding I/O.
>
> Do you really need to load balance I/O to a single bdev across multiple
> CPUs?
Yes, because I have to do very CPU-intensive operations (compression etc.).
> Disk I/O generally isn't very CPU-intensive.
>
> -- Chris
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
>



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-12-13 13:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-12-12  9:39 Inexplicable I/O latency using worker threads Thanos Makatos
2008-12-12 17:46 ` Chris Snook
2008-12-13 12:44   ` Thanos McAtos

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.