From patchwork Sun Jul 10 04:21:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yu Kuai X-Patchwork-Id: 12912393 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D395FC433EF for ; Sun, 10 Jul 2022 04:09:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229566AbiGJEJi (ORCPT ); Sun, 10 Jul 2022 00:09:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40420 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229552AbiGJEJg (ORCPT ); Sun, 10 Jul 2022 00:09:36 -0400 Received: from dggsgout12.his.huawei.com (unknown [45.249.212.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 01E6E12D2B; Sat, 9 Jul 2022 21:09:34 -0700 (PDT) Received: from mail02.huawei.com (unknown [172.30.67.143]) by dggsgout12.his.huawei.com (SkyGuard) with ESMTP id 4LgYR80ScHz6PCT4; Sun, 10 Jul 2022 12:08:36 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.127.227]) by APP3 (Coremail) with SMTP id _Ch0CgB32mn4UMpiguJUAg--.16364S4; Sun, 10 Jul 2022 12:09:30 +0800 (CST) From: Yu Kuai To: axboe@kernel.dk, asml.silence@gmail.com, osandov@fb.com, jack@suse.cz Cc: kbusch@kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, yukuai3@huawei.com, yukuai1@huaweicloud.com, yi.zhang@huawei.com Subject: [PATCH RFC v3 0/3] bugfix for sbitmap Date: Sun, 10 Jul 2022 12:21:57 +0800 Message-Id: <20220710042200.20936-1-yukuai1@huaweicloud.com> X-Mailer: git-send-email 2.31.1 MI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Ja73UjIFyTuYvjfUoO J5UUUUU X-CM-SenderInfo: 51xn3trlr6x35dzhxuhorxvhhfrp/ X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Changes in v3: - rename patch 2, and add some comments. - add patch 3, which fixes a new issue pointed out by Jan Kara. Changes in v2: - split to spearate patches for different problem. - add fix tag This patchset fixes problems in the wakeup path on concurrent scenarios, the problems are found during code review, and it's not reporduced in real test yet in my environment. Keith reported a possible related io hung problem in nvme: https://bugzilla.kernel.org/show_bug.cgi?id=215679 Previous versions: v1: https://lore.kernel.org/all/20220617141125.3024491-1-yukuai3@huawei.com/ v2: https://lore.kernel.org/all/20220619080309.1630027-1-yukuai3@huawei.com/ Yu Kuai (3): sbitmap: fix that same waitqueue can be woken up continuously sbitmap: fix invalid wakeup on the wrong waitqueue sbitmap: fix that 'wait_cnt' can be decreased while waitqueue is empty lib/sbitmap.c | 70 +++++++++++++++++++++++++++++++-------------------- 1 file changed, 43 insertions(+), 27 deletions(-)