Received: by 2002:a05:6a10:c7c6:0:0:0:0 with SMTP id h6csp1639166pxy; Mon, 2 Aug 2021 06:51:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwM4WWfLpywQmdakpTuzl3Co/Yt/KenQpXuu9EDwUSpU6i5j2Xhu37NsCxuYmpTSa3xtj43 X-Received: by 2002:a02:caa1:: with SMTP id e1mr14754638jap.107.1627912276988; Mon, 02 Aug 2021 06:51:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627912276; cv=none; d=google.com; s=arc-20160816; b=NRLHe/U1Fu7uQqTDlDwQQ/XAJWxDv4xGq5SYD9K4UHy9GI1d5YIMOVABfELleYsFOb N6Umo3xkZS0m29KNxsneSZInAdceg0TfDoIE7ukvUfPp8hI8AyFbpFll8j3+xROeYxR+ E0ee34/EhJwVHanoYGKbQ1J+VaJC3iVqnJLW47+e3pw0Lj7w7ZzE7A1yzZhbiaEWUKoK 0oCx0kwS12pKNd+w+B/ZbSET+mzo1phJuG0AHKag8RSMzpN8nfiECZJ2um94wek9TYlU 6oP/dGqCZGnpyQNrSK1Fg4n6hBecmokYu8jhaPk35G71O39YEeN+6e8Mf4UCOYGOkMfr 0XqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=Q89jGrQT4uSlEv+GgwdYWHA/XMPMEt5qJvL/ZC33FB8=; b=iABfgPhondJe0dsdYCsj+ko/qc8NxMN9kV932bJ/0Vi03epnAGY2/bfqgn+6v7HQzu iCgUMCIe7BswPCYs80RX+Ni+ZM/DWE+Up1fI7piGFE8SAtSDQuJWdCe8+PkVNTvxJdgK iFIMGv31We0jwoaIeZBTocA7qOWOcte2L2QiN9QOZ+bnvrOXoBjmpcKFQWv93lu26RvJ aG3SF+bfQ4FZXuy4lF+klKHy+dj3BuLkkkeROd3k41Ni6tZTxnd+iGpUMPVFABTOQYDq Gi7WLXuRCdAKZlp9+mfAwdD1Sxf/QrK/JYyE+vc0v5tHG+jjgHH28HgkhYLS8biSk5G1 eE7g== 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=NONE sp=NONE 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 m13si12977436jam.59.2021.08.02.06.51.04; Mon, 02 Aug 2021 06:51:16 -0700 (PDT) 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=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234662AbhHBNuY (ORCPT + 99 others); Mon, 2 Aug 2021 09:50:24 -0400 Received: from szxga02-in.huawei.com ([45.249.212.188]:7917 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234257AbhHBNrf (ORCPT ); Mon, 2 Aug 2021 09:47:35 -0400 Received: from dggemv711-chm.china.huawei.com (unknown [172.30.72.53]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4GdfNB5NzHz83CY; Mon, 2 Aug 2021 21:43:22 +0800 (CST) Received: from dggpemm500006.china.huawei.com (7.185.36.236) by dggemv711-chm.china.huawei.com (10.1.198.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Mon, 2 Aug 2021 21:47:11 +0800 Received: from thunder-town.china.huawei.com (10.174.179.0) by dggpemm500006.china.huawei.com (7.185.36.236) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Mon, 2 Aug 2021 21:47:11 +0800 From: Zhen Lei To: Greg Kroah-Hartman , stable CC: Zhen Lei , Anna-Maria Gleixner , Mike Galbraith , Sasha Levin , Ingo Molnar , Peter Zijlstra , Thomas Gleixner , linux-kernel Subject: [PATCH 4.4 00/11] Fix a potential infinite loop in RT futex-pi scenarios Date: Mon, 2 Aug 2021 21:46:13 +0800 Message-ID: <20210802134624.1934-1-thunder.leizhen@huawei.com> X-Mailer: git-send-email 2.26.0.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.174.179.0] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpemm500006.china.huawei.com (7.185.36.236) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit 73d786bd043e "futex: Rework inconsistent rt_mutex/futex_q state" mentions that it could cause an infinite loop, and will fix it in the later patches: bebe5b514345f09 futex: Futex_unlock_pi() determinism cfafcd117da0216 futex: Rework futex_lock_pi() to use rt_mutex_*_proxy_lock() But at the moment they're not backported. In a single-core environment, the probability of triggering is high. I also backported commit b4abf91047cf ("rtmutex: Make wait_lock irq safe"), it fixes a potential deadlock problem. Although it hasn't actually been triggered in our environment at the moment. Other patches are used to resolve conflicts or fix problems caused by new patches. Anna-Maria Gleixner (1): rcu: Update documentation of rcu_read_unlock() Mike Galbraith (1): futex: Handle transient "ownerless" rtmutex state correctly Peter Zijlstra (6): futex: Cleanup refcounting futex,rt_mutex: Introduce rt_mutex_init_waiter() futex: Pull rt_mutex_futex_unlock() out from under hb->lock futex: Rework futex_lock_pi() to use rt_mutex_*_proxy_lock() futex: Futex_unlock_pi() determinism futex,rt_mutex: Fix rt_mutex_cleanup_proxy_lock() Thomas Gleixner (3): futex: Rename free_pi_state() to put_pi_state() rtmutex: Make wait_lock irq safe futex: Avoid freeing an active timer include/linux/rcupdate.h | 4 +- kernel/futex.c | 245 +++++++++++++++++++++----------- kernel/locking/rtmutex.c | 185 +++++++++++++----------- kernel/locking/rtmutex_common.h | 2 +- 4 files changed, 262 insertions(+), 174 deletions(-) -- 2.26.0.106.g9fadedd