Re: [PATCH v2] loop: Limit the number of requests in the bio list

Lukáš Czerner
2012-11-13T08:44:52Z

On Thu, 8 Nov 2012, Jeff Moyer wrote:

> Date: Thu, 08 Nov 2012 16:53:01 -0500
> From: Jeff Moyer <jmoyer@redhat.com>
> To: Lukas Czerner <lczerner@redhat.com>
> Cc: axboe@kernel.dk, dchinner@redhat.com, linux-kernel@vger.kernel.org
> Subject: Re: [PATCH v2] loop: Limit the number of requests in the bio list
>
> Lukas Czerner <lczerner@redhat.com> writes:
>
> > + if (lo->lo_bio_count >= lo->lo_queue->nr_requests) {
> > + unsigned int nr;
> > + spin_unlock_irq(&lo->lo_lock);
> > + nr = lo->lo_queue->nr_requests - (lo->lo_queue->nr_requests/8);
> > + wait_event_interruptible(lo->lo_req_wait,
> > + lo->lo_bio_count < nr);
> > + spin_lock_irq(&lo->lo_lock);
> > + }
>
> So, blk_queue_make_request already initialized q->nr_congestion_on and
> q->nr_congestion_off. Is there a reason you didn't simply use
> queue_congestion_on_threshold and queue_congestion_off_threshold?

The reason is that I did not knew about those :) Thanks for pointing
it out I'll take a look at it.

Thanks!
-Lukas

>
> Cheers,
> Jeff
>