[Drbd-dev] About cleanup unprocessed requests

박경민 kmpak at mantech.co.kr
Wed Sep 21 10:12:43 CEST 2016


Hello

I have a question in DRBD9.

In sender thread, if there are some unprocessed requests, then process
through SEND_CANCELED mod. In a code

int drbd_sender(struct drbd_thread *thi)
{
...
/* cleanup all currently unprocessed requests */
if (!connection->todo.req) {
spin_lock_irq(&connection->resource->req_lock);
tl_next_request_for_connection(connection);
spin_unlock_irq(&connection->resource->req_lock);
}
while (connection->todo.req) {
struct bio_and_error m;
struct drbd_request *req = connection->todo.req;
struct drbd_device *device = req->device;
peer_device = conn_peer_device(connection, device->vnr);

spin_lock_irq(&connection->resource->req_lock);
tl_next_request_for_connection(connection);
__req_mod(req, SEND_CANCELED, peer_device, &m);
spin_unlock_irq(&connection->resource->req_lock);
if (m.bio)
complete_master_bio(device, &m);
}
...
}

I think two functions might be exchanged like below
__req_mod(req, SEND_CANCELED, peer_device, &m);
tl_next_request_for_connection(connection);

Because some case(peer's rq_state with RQ_NET_QUEUE)
 __req_mod(SEND_CANCELED) would call the advance_conn_req_next() function
and then connection->todo.req_next could be changed to next request.

__req_mod() ---> changed next request
tl_next_request_for_connection --> adjust the current request


But in original case,
tl_next_request_for_connection  -> current req is same next request
__req_mod() ->  changed next request but can't adjust current request



Thanks
--
ᐧ
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linbit.com/pipermail/drbd-dev/attachments/20160921/e7c354cc/attachment.htm>


More information about the drbd-dev mailing list