Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp4018985pxb; Tue, 25 Jan 2022 01:31:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJw81nS6gXKl161GBzFWTAkOQt2qggBpM5ric/lNiVZVhzrCxx8Q+WhFizpuGAM9ynHYKLg+ X-Received: by 2002:a05:6a00:b55:b0:4c9:25c7:b522 with SMTP id p21-20020a056a000b5500b004c925c7b522mr8028999pfo.55.1643103112335; Tue, 25 Jan 2022 01:31:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643103112; cv=none; d=google.com; s=arc-20160816; b=iiMOFLXB5/vVwUSj/YR2hKlM6TWhO8JZ1SOXs8hQHJg/vHnud6oJQa6tcKX+5FNTJu pwBsAf8nAf0bf3cx4jNBJ0qEvdP8dJ4gF1CYTs3Eh0PAa+IwXbM0FGRXbGqoys0PG349 fDEQrr7YyeHcTnJtJtcnqzh16OU0OcC609BYz9TrII4boeCHi5v/P70u7AyHJqLdksk7 2g9Dlk/qch36WucKzQL2FKUKcyK+fR+sDRipyCSm0+s0DsEaCZxMeDCh69RzCO2Hvd4p UDjLioH9e0Qzb/03TFO2/gkhqhxX2AolA6gMvzW6ctp/9aD5zjnTssbYNwk4SQwc3MIr 8FDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=fbelpYZdR4W7Wbdultjn8vAchoq34DEjoPfZBct7YDE=; b=ySpaiXjzh40j/DQOeWY8zT8lDDPZ3QZaGS5pf+WLsaw8lQWT5yuofiE+nBiWp8uK6w ZNQWxw81ZW8FOHf9r7hgaGugvZ3jCOrbeXi8jE7alKBPWJCSnIdMavegO7Ha/q5N5BXC iwlufn/I8vqoH7Xk4M9f6Wv9+iAjtX8wyiIi4SGjnTe5SOV1nvqoKGigRM4k1qeXKyIl SkvEjUABk1rJDnE8aNt+ViBPAWPgbGaXo1GmW3Kfl+dWFMGNWmvQs9FaHvZJYaqq8ox8 lsalysD4/if4TIqPUXCnOTvd+d157YXCT3SwSwDQH6v+E1EHa5LeZDlST2CMLU04ki8I EuaQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w3si15889092pgr.159.2022.01.25.01.31.40; Tue, 25 Jan 2022 01:31:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1447551AbiAYIlI (ORCPT + 99 others); Tue, 25 Jan 2022 03:41:08 -0500 Received: from frasgout.his.huawei.com ([185.176.79.56]:4490 "EHLO frasgout.his.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1451456AbiAYIis (ORCPT ); Tue, 25 Jan 2022 03:38:48 -0500 Received: from fraeml744-chm.china.huawei.com (unknown [172.18.147.206]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4JjgGr2qtRz6H7cN; Tue, 25 Jan 2022 16:38:12 +0800 (CST) Received: from lhreml724-chm.china.huawei.com (10.201.108.75) by fraeml744-chm.china.huawei.com (10.206.15.225) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Tue, 25 Jan 2022 09:38:34 +0100 Received: from [10.47.84.133] (10.47.84.133) by lhreml724-chm.china.huawei.com (10.201.108.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Tue, 25 Jan 2022 08:38:33 +0000 Subject: Re: [PATCH 5.16 1026/1039] blk-mq: fix tag_get wait task cant be awakened To: Greg Kroah-Hartman , CC: , Ming Lei , Laibin Qiu , Andy Shevchenko , Jens Axboe , References: <20220124184125.121143506@linuxfoundation.org> <20220124184159.785093232@linuxfoundation.org> From: John Garry Message-ID: Date: Tue, 25 Jan 2022 08:38:01 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.12.1 MIME-Version: 1.0 In-Reply-To: <20220124184159.785093232@linuxfoundation.org> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.47.84.133] X-ClientProxiedBy: lhreml727-chm.china.huawei.com (10.201.108.78) To lhreml724-chm.china.huawei.com (10.201.108.75) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 24/01/2022 18:46, Greg Kroah-Hartman wrote: > From: Laibin Qiu > > commit 180dccb0dba4f5e84a4a70c1be1d34cbb6528b32 upstream. > > In case of shared tags, there might be more than one hctx which > allocates from the same tags, and each hctx is limited to allocate at > most: > hctx_max_depth = max((bt->sb.depth + users - 1) / users, 4U); > > tag idle detection is lazy, and may be delayed for 30sec, so there > could be just one real active hctx(queue) but all others are actually > idle and still accounted as active because of the lazy idle detection. > Then if wake_batch is > hctx_max_depth, driver tag allocation may wait > forever on this real active hctx. > > Fix this by recalculating wake_batch when inc or dec active_queues. > > Fixes: 0d2602ca30e41 ("blk-mq: improve support for shared tags maps") > Suggested-by: Ming Lei > Suggested-by: John Garry > Signed-off-by: Laibin Qiu > Reviewed-by: Andy Shevchenko > Link:https://lore.kernel.org/r/20220113025536.1479653-1-qiulaibin@huawei.com > Signed-off-by: Jens Axboe > Signed-off-by: Greg Kroah-Hartman JFYI, Somebody reported a hang with this commit: https://lore.kernel.org/linux-block/78cafe94-a787-e006-8851-69906f0c2128@huawei.com/T/#t Thanks, John