From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932828AbeAIF7k (ORCPT + 1 other); Tue, 9 Jan 2018 00:59:40 -0500 Received: from userp2120.oracle.com ([156.151.31.85]:59128 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932532AbeAIF7i (ORCPT ); Tue, 9 Jan 2018 00:59:38 -0500 Subject: Re: [PATCH 5/7] blk-mq: remove REQ_ATOM_COMPLETE usages from blk-mq To: Tejun Heo Cc: jbacik@fb.com, jack@suse.cz, axboe@kernel.dk, clm@fb.com, kernel-team@fb.com, linux-kernel@vger.kernel.org, linux-btrfs@vger.kernel.org, peterz@infradead.org, Bart.VanAssche@wdc.com References: <20171216120726.517153-1-tj@kernel.org> <20171216120726.517153-6-tj@kernel.org> <64dfa760-d433-1537-9bc6-b12cda3c9dc6@oracle.com> <20171221135051.GE1084507@devbig577.frc2.facebook.com> <4e5aa629-f341-d077-961b-c778ceb31154@oracle.com> <20180108172723.GY3668920@devbig577.frc2.facebook.com> <9b367cee-ecd8-cd45-9bdb-e79c29d956dd@oracle.com> <20180109033748.GA3668920@devbig577.frc2.facebook.com> From: "jianchao.wang" Message-ID: <1fe6efde-a843-68f0-8533-761d611f0a9b@oracle.com> Date: Tue, 9 Jan 2018 13:59:10 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <20180109033748.GA3668920@devbig577.frc2.facebook.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8768 signatures=668652 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=648 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1801090085 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: Hi tejun Many thanks for your kindly response. On 01/09/2018 11:37 AM, Tejun Heo wrote: > Hello, > > On Tue, Jan 09, 2018 at 11:08:04AM +0800, jianchao.wang wrote: >>> But what'd prevent the completion reinitializing the request and then >>> the actual completion path coming in and completing the request again? >> >> blk_mark_rq_complete() will gate and ensure there will be only one >> __blk_mq_complete_request() to be invoked. > > Yeah, but then the complete flag will be cleared once completion is > done and the request is reinitialized. Yes, it is. What I mean is not to reserve blk_mark_rq_complete and REQ_ATOM_COMPLETE usages in blk-mq but the side-effect after blk_mq_complete_request cannot exclude with itself. As you said, the scene is racy and should be modified. :) Thanks Jianchao