Received: by 10.223.176.46 with SMTP id f43csp188711wra; Fri, 19 Jan 2018 15:59:07 -0800 (PST) X-Google-Smtp-Source: AH8x2278mc6m4LUmqxXpO65/nYDTnwqCjbkAMigdDnj8NBc+H315YOuNkjdxRdCziL6P86w1b0xI X-Received: by 10.101.101.149 with SMTP id u21mr173556pgv.251.1516406347531; Fri, 19 Jan 2018 15:59:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516406347; cv=none; d=google.com; s=arc-20160816; b=pOaM6g9ywMIAQpZik/xn0YQfXDkKQ+Z7f8jsEgEI5Lvenw+bVzA+r79Pfd2JgH3c+R jyYFzpmnAsm2D14npYAY5plgB2zemZF983h1nEvn6EtEu71i7moLjgWxIx3hLu2iMtz7 Du5l8QTIHaxsIR5Z2kY26jeT8LlwYbx5/WTYzYZPCnpmpPbzUbxpmVAReKjEbjDk92I+ qbyC05n7g1bFGKR+K6aare09t4MRrXga5QjtWMPusqSRSU2fauzNSPI8UhJ/Oi2b3QqQ v6FBop8fZzfwiCqh5BkqRdKq+uh7AIvnzShLqpdLh5U2ClasBBaQOLw58+4igt6iiix+ jnYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=MeOBgU4TomDHLYIBfKyaHBeVrVchkOx2r59K+HfXr3Y=; b=V3+nhdL3lIhqlabOijsXKf5zmEEfjcHKtL/t0K+u1rSmngwbDH5z00Ta4AyHh4AAhq cu/ONKpN9o5g15vQRXnkvuGkCe1I47TGVxkrjndqOgRAcvCoZ6rLI2b5k/duwlSuhnsK GrV0dhnZmX279rGfUsOuklKYaPEmsPruN6GpkkNuWxklnlIY/4hjpEJQbBp+w+u7fXLg SViS1ogtfC6L6SLXdRfhN1JIyFZHe+W2CELoY5cegPTOt826Luf6356bvht/yz+PomTv bDGmequEZ+UfOyr7m8akO+rGuGmeg2lvb76UkpGGaJCvtf9XIAWdlIQGd4O/jujLZrLi cdNA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y8-v6si1210106pli.708.2018.01.19.15.58.53; Fri, 19 Jan 2018 15:59:07 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756103AbeASX52 (ORCPT + 99 others); Fri, 19 Jan 2018 18:57:28 -0500 Received: from mx1.redhat.com ([209.132.183.28]:56080 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752190AbeASX5V (ORCPT ); Fri, 19 Jan 2018 18:57:21 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3F38D85A05; Fri, 19 Jan 2018 23:57:21 +0000 (UTC) Received: from ming.t460p (ovpn-12-27.pek2.redhat.com [10.72.12.27]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B79F860C4A; Fri, 19 Jan 2018 23:57:09 +0000 (UTC) Date: Sat, 20 Jan 2018 07:57:06 +0800 From: Ming Lei To: Jens Axboe Cc: Mike Snitzer , Bart Van Assche , "dm-devel@redhat.com" , "hch@infradead.org" , "linux-kernel@vger.kernel.org" , "linux-block@vger.kernel.org" , "osandov@fb.com" Subject: Re: [RFC PATCH] blk-mq: fixup RESTART when queue becomes idle Message-ID: <20180119235705.GB17195@ming.t460p> References: <1516301278.2676.35.camel@wdc.com> <20180119023212.GA25413@ming.t460p> <20180119072623.GB25369@ming.t460p> <047f68ec-f51b-190f-2f89-f413325c2540@kernel.dk> <20180119154047.GB14827@ming.t460p> <540e1239-c415-766b-d4ff-bb0b7f3517a7@kernel.dk> <20180119161336.GA22600@redhat.com> <65a40164-275c-824b-64fc-b9e4cf781861@kernel.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <65a40164-275c-824b-64fc-b9e4cf781861@kernel.dk> User-Agent: Mutt/1.9.1 (2017-09-22) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Fri, 19 Jan 2018 23:57:21 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 19, 2018 at 09:23:35AM -0700, Jens Axboe wrote: > On 1/19/18 9:13 AM, Mike Snitzer wrote: > > On Fri, Jan 19 2018 at 10:48am -0500, > > Jens Axboe wrote: > > > >> On 1/19/18 8:40 AM, Ming Lei wrote: > >>>>>> Where does the dm STS_RESOURCE error usually come from - what's exact > >>>>>> resource are we running out of? > >>>>> > >>>>> It is from blk_get_request(underlying queue), see > >>>>> multipath_clone_and_map(). > >>>> > >>>> That's what I thought. So for a low queue depth underlying queue, it's > >>>> quite possible that this situation can happen. Two potential solutions > >>>> I see: > >>>> > >>>> 1) As described earlier in this thread, having a mechanism for being > >>>> notified when the scarce resource becomes available. It would not > >>>> be hard to tap into the existing sbitmap wait queue for that. > >>>> > >>>> 2) Have dm set BLK_MQ_F_BLOCKING and just sleep on the resource > >>>> allocation. I haven't read the dm code to know if this is a > >>>> possibility or not. > > > > Right, #2 is _not_ the way forward. Historically request-based DM used > > its own mempool for requests, this was to be able to have some measure > > of control and resiliency in the face of low memory conditions that > > might be affecting the broader system. > > > > Then Christoph switched over to adding per-request-data; which ushered > > in the use of blk_get_request using ATOMIC allocations. I like the > > result of that line of development. But taking the next step of setting > > BLK_MQ_F_BLOCKING is highly unfortunate (especially in that this > > dm-mpath.c code is common to old .request_fn and blk-mq, at least the > > call to blk_get_request is). Ultimately dm-mpath like to avoid blocking > > for a request because for this dm-mpath device we have multiple queues > > to allocate from if need be (provided we have an active-active storage > > network topology). > > If you can go to multiple devices, obviously it should not block on a > single device. That's only true for the case where you can only go to > one device, blocking at that point would probably be fine. Or if all > your paths are busy, then blocking would also be OK. Introducing one extra block point will hurt AIO performance, in which there is usually much less jobs/processes to submit IO. -- Ming