From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.9 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 78686C04AAC for ; Mon, 6 May 2019 07:56:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4CFC0205C9 for ; Mon, 6 May 2019 07:56:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726255AbfEFH4f (ORCPT ); Mon, 6 May 2019 03:56:35 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44380 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725828AbfEFH4e (ORCPT ); Mon, 6 May 2019 03:56:34 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 04CB43086227; Mon, 6 May 2019 07:56:34 +0000 (UTC) Received: from maximlenovopc.usersys.redhat.com (unknown [10.35.206.20]) by smtp.corp.redhat.com (Postfix) with ESMTP id 921CE5DA35; Mon, 6 May 2019 07:56:22 +0000 (UTC) Message-ID: <599086a07da9943e1748d5608357ebc85b2330db.camel@redhat.com> Subject: Re: [PATCH v2 08/10] nvme/pci: implement the mdev external queue allocation interface From: Maxim Levitsky To: Keith Busch Cc: Fam Zheng , kvm@vger.kernel.org, Wolfram Sang , linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, Keith Busch , Kirti Wankhede , Mauro Carvalho Chehab , "Paul E . McKenney" , Christoph Hellwig , Sagi Grimberg , Liang Cunming , Jens Axboe , Alex Williamson , John Ferlan , Liu Changpeng , Greg Kroah-Hartman , "Heitke, Kenneth" , Nicolas Ferre , Paolo Bonzini , Amnon Ilan , "David S . Miller" Date: Mon, 06 May 2019 10:55:19 +0300 In-Reply-To: <20190503120915.GA30013@localhost.localdomain> References: <20190502114801.23116-1-mlevitsk@redhat.com> <20190502114801.23116-9-mlevitsk@redhat.com> <63a499c3-25be-5c5b-5822-124854945279@intel.com> <20190503120915.GA30013@localhost.localdomain> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Mon, 06 May 2019 07:56:34 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2019-05-03 at 06:09 -0600, Keith Busch wrote: > On Fri, May 03, 2019 at 12:20:17AM +0300, Maxim Levitsky wrote: > > On Thu, 2019-05-02 at 15:12 -0600, Heitke, Kenneth wrote: > > > On 5/2/2019 5:47 AM, Maxim Levitsky wrote: > > > > +static void nvme_ext_queue_free(struct nvme_ctrl *ctrl, u16 qid) > > > > +{ > > > > + struct nvme_dev *dev = to_nvme_dev(ctrl); > > > > + struct nvme_queue *nvmeq; > > > > + > > > > + mutex_lock(&dev->ext_dev_lock); > > > > + nvmeq = &dev->queues[qid]; > > > > + > > > > + if (WARN_ON(!test_bit(NVMEQ_EXTERNAL, &nvmeq->flags))) > > > > + return; > > > > > > This condition is probably not expected to happen (since its a warning) > > > but do you need to unlock the ext_dev_lock before returning? > > > > This is true, I will fix this. This used to be BUG_ON, but due to > > checkpatch.pl > > complains I turned them all to WARN_ON, and missed this. > > Gentle reminder to trim your replies to the relevant context. It's > much easier to read when we don't need to scroll through hundreds of > unnecessary lines. I fully agree, sorry! Next time I will do this. Best regards, Maxim Levitsky