Message ID | 20230606072229.3988976-7-gerald.yang@canonical.com |
---|---|
State | New |
Headers | show
Return-Path: <kernel-team-bounces@lists.ubuntu.com> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=<UNKNOWN>) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=jliRCe9d; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Qb24p34xTz20WK for <incoming@patchwork.ozlabs.org>; Tue, 6 Jun 2023 17:23:06 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from <kernel-team-bounces@lists.ubuntu.com>) id 1q6R1u-0000Xc-JX; Tue, 06 Jun 2023 07:22:58 +0000 Received: from smtp-relay-internal-1.internal ([10.131.114.114] helo=smtp-relay-internal-1.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from <gerald.yang@canonical.com>) id 1q6R1m-0000Nt-UN for kernel-team@lists.ubuntu.com; Tue, 06 Jun 2023 07:22:50 +0000 Received: from mail-pl1-f199.google.com (mail-pl1-f199.google.com [209.85.214.199]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id 78BE43F0EF for <kernel-team@lists.ubuntu.com>; Tue, 6 Jun 2023 07:22:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1686036169; bh=RTzBHpf7pNxeVKUNSCI3X7DgPVjuRy939w+zZ4Zr6Fg=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=jliRCe9dnDuGinKGAS5Nih3S1KTuiFf+5sRpCYztWKpKgaY1CceKelo2arbgAgqFY 1ZzCPqMpKi2wX2Q57SKsBIZzeaRGWrEIvvdakJvAy4VRvN2q73EffLOkntNiXVCIXv F/vteFXfDKRSDAmJHrWlceNXKx/8Vd32vJyM9VgWF6FYcuk9P3av5ptfbZB+TqZpvC Nva+qj3C3uy3QsgVsFOgR7foCZs2gzRrsbb7yu9g4awGiRbOXu67eAnUb6SXsjmoGq ZhQtDXVY8szyKrGH9xeCvmojupYX2mV2d92hKLOGz71uVE+N237Vby8iYm8WZZ52hv 4hZXilWMestXQ== Received: by mail-pl1-f199.google.com with SMTP id d9443c01a7336-1b03f9dfd52so23188995ad.3 for <kernel-team@lists.ubuntu.com>; Tue, 06 Jun 2023 00:22:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686036167; x=1688628167; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=RTzBHpf7pNxeVKUNSCI3X7DgPVjuRy939w+zZ4Zr6Fg=; b=UO4yGf+AvLDZ6lvUM6ogg1TgHXdAnVJoRKdQb9B/lHWTffwyW01wtRw5Mchfeawd1u dC2JcqBPOyfRyEfFK6+q1l7ETCxeVtKeW8B6ljQMUXGOm0KP9Z8sREislbw9eUoC6ixK c0x9ARsaeDQMuQwtO5ovERhWaSARo9KyjXZQo3UStRL5qtI+l2KJ+kNlUdEG+A/2/Tex rnX+2F8IHW/XNmy53OTrXyO48e0nfHgCPYuTw8q1B7Xc43DLpUIMfXhR55XnE2cJdrGh nfmdWhRLtr08LNt8OznnK1lgFl4Mvl2ZczMdDRZMKDxXDzYKPvV5rjYSpzhAM5a8lUA1 ousg== X-Gm-Message-State: AC+VfDxIzUoOKs+xFXQzb90tv85TCj3WZyrzetomB2mJiV6kIJjW2TDe aQ4Z+X6ZnnFa/dc88DEuAAW+8fJV8JaUSHSCWrl3Aiftd6waM9FFXN8UhQfPbvRP4aGVRdYwb2K vr1GYzM5WcMKuP0DwkggtU0lkkUIy5oEN6DcbJCB2kR+7FyguRg== X-Received: by 2002:a17:902:c3c4:b0:1ae:7421:82b5 with SMTP id j4-20020a170902c3c400b001ae742182b5mr798459plj.45.1686036167542; Tue, 06 Jun 2023 00:22:47 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5b8IchWhJIY8k46zS0xptCcYG+Jn/RUtDAYicxMqpniSfTrv2yjy1aMxUy9YM5i3xwAXDcvQ== X-Received: by 2002:a17:902:c3c4:b0:1ae:7421:82b5 with SMTP id j4-20020a170902c3c400b001ae742182b5mr798454plj.45.1686036167171; Tue, 06 Jun 2023 00:22:47 -0700 (PDT) Received: from localhost.localdomain (220-135-31-21.hinet-ip.hinet.net. [220.135.31.21]) by smtp.gmail.com with ESMTPSA id j6-20020a170902758600b001a260b5319bsm7776954pll.91.2023.06.06.00.22.46 for <kernel-team@lists.ubuntu.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jun 2023 00:22:46 -0700 (PDT) From: Gerald Yang <gerald.yang@canonical.com> To: kernel-team@lists.ubuntu.com Subject: [PATCH 6/6] sbitmap: fix lockup while swapping Date: Tue, 6 Jun 2023 15:22:29 +0800 Message-Id: <20230606072229.3988976-7-gerald.yang@canonical.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230606072229.3988976-1-gerald.yang@canonical.com> References: <20230606072229.3988976-1-gerald.yang@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions <kernel-team.lists.ubuntu.com> List-Unsubscribe: <https://lists.ubuntu.com/mailman/options/kernel-team>, <mailto:kernel-team-request@lists.ubuntu.com?subject=unsubscribe> List-Archive: <https://lists.ubuntu.com/archives/kernel-team> List-Post: <mailto:kernel-team@lists.ubuntu.com> List-Help: <mailto:kernel-team-request@lists.ubuntu.com?subject=help> List-Subscribe: <https://lists.ubuntu.com/mailman/listinfo/kernel-team>, <mailto:kernel-team-request@lists.ubuntu.com?subject=subscribe> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" <kernel-team-bounces@lists.ubuntu.com> |
Series |
*** SUBJECT HERE ***
|
expand
|
diff --git a/lib/sbitmap.c b/lib/sbitmap.c index 624fa7f118d1..a8108a962dfd 100644 --- a/lib/sbitmap.c +++ b/lib/sbitmap.c @@ -587,7 +587,7 @@ static struct sbq_wait_state *sbq_wake_ptr(struct sbitmap_queue *sbq) for (i = 0; i < SBQ_WAIT_QUEUES; i++) { struct sbq_wait_state *ws = &sbq->ws[wake_index]; - if (waitqueue_active(&ws->wait)) { + if (waitqueue_active(&ws->wait) && atomic_read(&ws->wait_cnt)) { if (wake_index != atomic_read(&sbq->wake_index)) atomic_set(&sbq->wake_index, wake_index); return ws;