From: Alex Elder <elder@ieee.org>
To: Ilya Dryomov <ilya.dryomov@inktank.com>, ceph-devel@vger.kernel.org
Subject: Re: [PATCH 09/14] libceph: introduce ceph_osdc_cancel_request()
Date: Mon, 30 Jun 2014 08:39:19 -0500 [thread overview]
Message-ID: <53B16887.2090309@ieee.org> (raw)
In-Reply-To: <1403716607-13535-10-git-send-email-ilya.dryomov@inktank.com>
On 06/25/2014 12:16 PM, Ilya Dryomov wrote:
> Introduce ceph_osdc_cancel_request() intended for canceling requests
> from the higher layers (rbd and cephfs). Because higher layers are in
> charge and are supposed to know what and when they are canceling, the
> request is not completed, only unref'ed and removed from the libceph
> data structures.
This seems reasonable.
But you make two changes here that I'd like to see a little
more explanation on. They seem significant enough to warrant
a little more attention in the commit description.
- __cancel_request() is no longer called when
ceph_osdc_wait_request() fails due to an
an interrupt. This is my main concern, and I
plan to work through it but I'm in a small hurry
right now.
- __unregister_linger_request() is now called when
a request is canceled, but it wasn't before. (Since
we're consistent about setting the r_linger flag
this should be fine, but it *is* a behavior change.)
I'm going to keep looking at this; I have about
20 minutes before I have to leave for a while.
-Alex
> Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
> ---
> include/linux/ceph/osd_client.h | 1 +
> net/ceph/osd_client.c | 31 +++++++++++++++++++++++++------
> 2 files changed, 26 insertions(+), 6 deletions(-)
>
> diff --git a/include/linux/ceph/osd_client.h b/include/linux/ceph/osd_client.h
> index a8d5652f589d..de09cad7b7c7 100644
> --- a/include/linux/ceph/osd_client.h
> +++ b/include/linux/ceph/osd_client.h
> @@ -334,6 +334,7 @@ extern void ceph_osdc_put_request(struct ceph_osd_request *req);
> extern int ceph_osdc_start_request(struct ceph_osd_client *osdc,
> struct ceph_osd_request *req,
> bool nofail);
> +extern void ceph_osdc_cancel_request(struct ceph_osd_request *req);
> extern int ceph_osdc_wait_request(struct ceph_osd_client *osdc,
> struct ceph_osd_request *req);
> extern void ceph_osdc_sync(struct ceph_osd_client *osdc);
> diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c
> index 8104db24bc09..ef44cc0bbc6a 100644
> --- a/net/ceph/osd_client.c
> +++ b/net/ceph/osd_client.c
> @@ -2470,6 +2470,25 @@ int ceph_osdc_start_request(struct ceph_osd_client *osdc,
> EXPORT_SYMBOL(ceph_osdc_start_request);
>
> /*
> + * Unregister a registered request. The request is not completed (i.e.
> + * no callbacks or wakeups) - higher layers are supposed to know what
> + * they are canceling.
> + */
> +void ceph_osdc_cancel_request(struct ceph_osd_request *req)
> +{
> + struct ceph_osd_client *osdc = req->r_osdc;
> +
> + mutex_lock(&osdc->request_mutex);
> + if (req->r_linger)
> + __unregister_linger_request(osdc, req);
> + __unregister_request(osdc, req);
> + mutex_unlock(&osdc->request_mutex);
> +
> + dout("%s %p tid %llu canceled\n", __func__, req, req->r_tid);
> +}
> +EXPORT_SYMBOL(ceph_osdc_cancel_request);
> +
> +/*
> * wait for a request to complete
> */
> int ceph_osdc_wait_request(struct ceph_osd_client *osdc,
> @@ -2477,18 +2496,18 @@ int ceph_osdc_wait_request(struct ceph_osd_client *osdc,
> {
> int rc;
>
> + dout("%s %p tid %llu\n", __func__, req, req->r_tid);
> +
> rc = wait_for_completion_interruptible(&req->r_completion);
> if (rc < 0) {
> - mutex_lock(&osdc->request_mutex);
> - __cancel_request(req);
> - __unregister_request(osdc, req);
> - mutex_unlock(&osdc->request_mutex);
> + dout("%s %p tid %llu interrupted\n", __func__, req, req->r_tid);
> + ceph_osdc_cancel_request(req);
> complete_request(req);
> - dout("wait_request tid %llu canceled/timed out\n", req->r_tid);
> return rc;
> }
>
> - dout("wait_request tid %llu result %d\n", req->r_tid, req->r_result);
> + dout("%s %p tid %llu result %d\n", __func__, req, req->r_tid,
> + req->r_result);
> return req->r_result;
> }
> EXPORT_SYMBOL(ceph_osdc_wait_request);
>
next prev parent reply other threads:[~2014-06-30 13:39 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-25 17:16 [PATCH 00/14] rbd: #6628 fixes (wip-remove-osd-6628) Ilya Dryomov
2014-06-25 17:16 ` [PATCH 01/14] libceph: rename ceph_osd_request::r_linger_osd to r_linger_osd_item Ilya Dryomov
2014-06-30 12:16 ` Alex Elder
2014-06-25 17:16 ` [PATCH 02/14] libceph: add maybe_move_osd_to_lru() and switch to it Ilya Dryomov
2014-06-30 12:17 ` Alex Elder
2014-06-25 17:16 ` [PATCH 03/14] libceph: move and add dout()s to ceph_msg_{get,put}() Ilya Dryomov
2014-06-30 12:29 ` Alex Elder
2014-07-08 11:12 ` Ilya Dryomov
2014-06-25 17:16 ` [PATCH 04/14] libceph: move and add dout()s to ceph_osdc_request_{get,put}() Ilya Dryomov
2014-06-30 12:32 ` Alex Elder
2014-06-25 17:16 ` [PATCH 05/14] libceph: harden ceph_osdc_request_release() a bit Ilya Dryomov
2014-06-30 12:36 ` Alex Elder
2014-06-25 17:16 ` [PATCH 06/14] libceph: assert both regular and lingering lists in __remove_osd() Ilya Dryomov
2014-06-30 12:37 ` Alex Elder
2014-06-25 17:16 ` [PATCH 07/14] libceph: unregister only registered linger requests Ilya Dryomov
2014-06-30 13:05 ` Alex Elder
2014-06-30 13:50 ` Alex Elder
2014-06-30 14:21 ` Ilya Dryomov
2014-06-25 17:16 ` [PATCH 08/14] libceph: fix linger request check in __unregister_request() Ilya Dryomov
2014-06-30 13:07 ` Alex Elder
2014-06-25 17:16 ` [PATCH 09/14] libceph: introduce ceph_osdc_cancel_request() Ilya Dryomov
2014-06-30 13:39 ` Alex Elder [this message]
2014-06-30 14:34 ` Ilya Dryomov
2014-07-07 13:47 ` Alex Elder
2014-07-08 11:15 ` Ilya Dryomov
2014-07-08 12:58 ` Alex Elder
2014-06-25 17:16 ` [PATCH 10/14] rbd: rbd_obj_request_wait() should cancel the request if interrupted Ilya Dryomov
2014-07-07 16:55 ` Alex Elder
2014-07-08 11:18 ` Ilya Dryomov
2014-07-08 12:17 ` Alex Elder
2014-06-25 17:16 ` [PATCH 11/14] rbd: add rbd_obj_watch_request_helper() helper Ilya Dryomov
2014-07-07 22:36 ` Alex Elder
2014-07-08 11:18 ` Ilya Dryomov
2014-06-25 17:16 ` [PATCH 12/14] rbd: use " Ilya Dryomov
2014-07-07 22:36 ` Alex Elder
2014-06-25 17:16 ` [PATCH 13/14] libceph: nuke ceph_osdc_unregister_linger_request() Ilya Dryomov
2014-07-07 22:36 ` Alex Elder
2014-06-25 17:16 ` [PATCH 14/14] libceph: drop osd ref when canceling con work Ilya Dryomov
2014-07-07 22:38 ` Alex Elder
2014-07-08 11:22 ` Ilya Dryomov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=53B16887.2090309@ieee.org \
--to=elder@ieee.org \
--cc=ceph-devel@vger.kernel.org \
--cc=ilya.dryomov@inktank.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.