lkml.org 
[lkml]   [2000]   [Aug]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: ll_rw_blk.c fails to merge requests. Help!
>
> > reqfree-batching-3Name: reqfree-batching-3
> > Type: Plain Text (text/plain)
>
> This one works even better.
>
>
> + list_add(&req->table, &q->pending_freelist);
> + if (++q->pending_free > 64) {
> ^^^^^

I have two comments about this patch. (the reqfree-batching-3)

First. Couldn't it end up indefinitely starving a writer?

Assume the free_list is empty (all requests in use), and the
pending_freelist is empty. (So q->queue_requests ==
QUEUE_NR_REQUESTS). A write request
comes in and is blocked in __get_request_wait. Now 64 ( 64 == 1/4 of
QUEUE_NR_REQUESTS ) requests complete. The pending_freelist is spliced
into the free_list and the wait_queue is woken. Now the writer will
wake
up in __get_request_wait, but will not succeed in get_request so it
will
go back to sleep (queue_requests == 3/4 of QUEUE_NR_REQUESTS which is >
than 1/2 of QUEUE_NR_REQUESTS). Meanwhile the 64 requests can be used
up
by a) readers that were blocking, or b) new readers. This could
continue
ad infinitum...

Second. At queue destroy time (blk_cleanup_queue) the pending_list
should
be spliced into the free_list so they won't get leaked.
Alternatively,
add a 'count -= blk_cleanup_queue(&q->pending_list)'.

David Mansfield
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:38    [W:0.107 / U:0.804 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site