Re: [PATCH V4 2/5] nvme: add helper interface to flush in-flight requests

2018-03-08 Thread jianchao.wang
Hi Sagi Thanks for your precious time for review and comment. On 03/09/2018 02:21 AM, Sagi Grimberg wrote: >> +EXPORT_SYMBOL_GPL(nvme_abort_requests_sync); >> + >> +static void nvme_comp_req(struct request *req, void *data, bool reserved) > > Not a very good name... Yes, indeed. > >> +{ >>

Re: [PATCH V4 2/5] nvme: add helper interface to flush in-flight requests

2018-03-08 Thread jianchao.wang
Hi Sagi Thanks for your precious time for review and comment. On 03/09/2018 02:21 AM, Sagi Grimberg wrote: >> +EXPORT_SYMBOL_GPL(nvme_abort_requests_sync); >> + >> +static void nvme_comp_req(struct request *req, void *data, bool reserved) > > Not a very good name... Yes, indeed. > >> +{ >>

Re: [PATCH V4 2/5] nvme: add helper interface to flush in-flight requests

2018-03-08 Thread Sagi Grimberg
On 03/08/2018 08:19 AM, Jianchao Wang wrote: Currently, we use nvme_cancel_request to complete the request forcedly. This has following defects: - It is not safe to race with the normal completion path. blk_mq_complete_request is ok to race with timeout path, but not with itself. -

Re: [PATCH V4 2/5] nvme: add helper interface to flush in-flight requests

2018-03-08 Thread Sagi Grimberg
On 03/08/2018 08:19 AM, Jianchao Wang wrote: Currently, we use nvme_cancel_request to complete the request forcedly. This has following defects: - It is not safe to race with the normal completion path. blk_mq_complete_request is ok to race with timeout path, but not with itself. -

Re: [PATCH V4 2/5] nvme: add helper interface to flush in-flight requests

2018-03-08 Thread jianchao.wang
Hi Ming Thanks for your precious time for reviewing and comment. On 03/08/2018 09:11 PM, Ming Lei wrote: > On Thu, Mar 8, 2018 at 2:19 PM, Jianchao Wang > wrote: >> Currently, we use nvme_cancel_request to complete the request >> forcedly. This has following defects:

Re: [PATCH V4 2/5] nvme: add helper interface to flush in-flight requests

2018-03-08 Thread jianchao.wang
Hi Ming Thanks for your precious time for reviewing and comment. On 03/08/2018 09:11 PM, Ming Lei wrote: > On Thu, Mar 8, 2018 at 2:19 PM, Jianchao Wang > wrote: >> Currently, we use nvme_cancel_request to complete the request >> forcedly. This has following defects: >> - It is not safe to

Re: [PATCH V4 2/5] nvme: add helper interface to flush in-flight requests

2018-03-08 Thread Ming Lei
On Thu, Mar 8, 2018 at 2:19 PM, Jianchao Wang wrote: > Currently, we use nvme_cancel_request to complete the request > forcedly. This has following defects: > - It is not safe to race with the normal completion path. >blk_mq_complete_request is ok to race with

Re: [PATCH V4 2/5] nvme: add helper interface to flush in-flight requests

2018-03-08 Thread Ming Lei
On Thu, Mar 8, 2018 at 2:19 PM, Jianchao Wang wrote: > Currently, we use nvme_cancel_request to complete the request > forcedly. This has following defects: > - It is not safe to race with the normal completion path. >blk_mq_complete_request is ok to race with timeout path, >but not with

[PATCH V4 2/5] nvme: add helper interface to flush in-flight requests

2018-03-07 Thread Jianchao Wang
Currently, we use nvme_cancel_request to complete the request forcedly. This has following defects: - It is not safe to race with the normal completion path. blk_mq_complete_request is ok to race with timeout path, but not with itself. - Cannot ensure all the requests have been handled.

[PATCH V4 2/5] nvme: add helper interface to flush in-flight requests

2018-03-07 Thread Jianchao Wang
Currently, we use nvme_cancel_request to complete the request forcedly. This has following defects: - It is not safe to race with the normal completion path. blk_mq_complete_request is ok to race with timeout path, but not with itself. - Cannot ensure all the requests have been handled.