From patchwork Wed Nov 15 08:21:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Shixin X-Patchwork-Id: 13456355 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id B4B8DC47074 for ; Wed, 15 Nov 2023 07:23:22 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D88DA900003; Wed, 15 Nov 2023 02:23:21 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id D3904900002; Wed, 15 Nov 2023 02:23:21 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C2725900003; Wed, 15 Nov 2023 02:23:21 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id B3277900002 for ; Wed, 15 Nov 2023 02:23:21 -0500 (EST) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 83500B5C80 for ; Wed, 15 Nov 2023 07:23:21 +0000 (UTC) X-FDA: 81459347802.14.5779148 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by imf23.hostedemail.com (Postfix) with ESMTP id AA705140012 for ; Wed, 15 Nov 2023 07:23:18 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf23.hostedemail.com: domain of liushixin2@huawei.com designates 45.249.212.189 as permitted sender) smtp.mailfrom=liushixin2@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1700032999; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references; bh=FiFeYaebcJAjBuZz5/O4n+4Y8GB8mc5xN0tJmP6Htxo=; b=FrQQJHOafRkcpT7SxxoxAwJAER7mBNRniq3BZIUlGEm/LlMmw/RSxcXfAcYBe+QIajN5pR P98JofiJKVuV5HfkrMPcviJwwSKdP1zEGx6AjgYURQroaSPFQOaEkji00AnaKTyC5/7wvz rxoB0OL0x9XoJugpz7V0IFP047XKy3U= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf23.hostedemail.com: domain of liushixin2@huawei.com designates 45.249.212.189 as permitted sender) smtp.mailfrom=liushixin2@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1700032999; a=rsa-sha256; cv=none; b=jT3WMb6+nfPYdP3E8YoBLSO/MA6B4zTET3LJlm0m8raPF5P7rmDkFgVY9EFjaPRoPnxnSY d8wfaNHwURGw5CuVZfqMLah6Ztqpaq9E6niN++YuCplNGr851LQbPYoIcXR3rrSA514QNq +HKnUrWYg3Mh2ZBfgtkbnokYaUnZA54= Received: from dggpemd200004.china.huawei.com (unknown [172.30.72.57]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4SVZJp2fhzzMl6P; Wed, 15 Nov 2023 15:18:34 +0800 (CST) Received: from huawei.com (10.175.113.32) by dggpemd200004.china.huawei.com (7.185.36.141) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.2.1258.23; Wed, 15 Nov 2023 15:23:09 +0800 From: Liu Shixin To: Geert Uytterhoeven , Catalin Marinas , Patrick Wang , Andrew Morton , Kefeng Wang CC: , , Linux-Renesas , Liu Shixin Subject: [PATCH 0/2] Fix invalid wait context of set_track_prepare() Date: Wed, 15 Nov 2023 16:21:36 +0800 Message-ID: <20231115082138.2649870-1-liushixin2@huawei.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Originating-IP: [10.175.113.32] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpemd200004.china.huawei.com (7.185.36.141) X-CFilter-Loop: Reflected X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: AA705140012 X-Stat-Signature: azheakbcngrnkwdqt3dbkaxc5jq1xg7x X-HE-Tag: 1700032998-6549 X-HE-Meta: U2FsdGVkX1/K7lhOD04UTpThrecoMVQWX1zqgB44YCOwbrxv0XRGTUChEFFrOQTi0jUsrhjkSpc3AkktPy4K6A2uVj7a/ysoEpxUMuOggAz2Wz8eMGIj/r7kJjL69xCmhAVxNuCGqQDQ0TRUQLMhDjNuL2AO1rQRudwKWbzMn71J2kM4UXR+B7VME/nPtX5rZeF4TyvDdRBP5lvZNv5sNA4pSt49zKeXTXDCdJ/J71vg2ICJrQJ3plU9/Puz4eru8QWQleC4bQQ4MARIyReX27E12xM/EUpBe973C3SgrFo3SQRnj/9sXSwv0UFz+2Pm8RgcoXJJ9qIY0r2+fTo14In64sDbgdnCTsPG3Mev8JWEYbxaMlIFaP5bNBZorX/hK19BoVc1gxY2Fakf0IXl0TMbehv0rrTyio81gU5IKmCqf7QTrybMqawhmS33kqZU4VPQGb+PfpYJeSqb43rh3JOOnwkSEBdvVlMYlffHIBWkdBWP69aWrHlSNiZL32KNsDavT6Wtl/mNKkjrYUwo5FzfhWzQGXIalSwVMHvD0ai8JElFpRxl8hvQiGCd2UzKhLJr/ziMpfTHefaRupgMvHUawgtB+MqBTPorzHCYEw7O44VXj5OzA2WiTkxOaEsj9dBr7z5wtX/fBRmKHmxezAbKj+4dCv+URGmkm2+2g4NlZ9ax+vAUH3ElKU4lkTwtrfGASigzeESwG9RY61EZ4SSYMtRvvxMhVNNJzlJPdRBni6MeSd8kf7LGuXMtP5LSZbdkxGfOMC3qVoKpwJnFz8YGuXG1XXmlxXU5imCdtM+yz4eeA/CUHmiiKrZR1LYtfZWFHODzIm6xK0aWI04fCKIs9xmOg51b/G4PpINeVuWE2LUaz2rHhjyqWrXZ9ST869Lk2pVXa0hJHLbp0GnbYJievAT7ZkwkJWKS4tQ7Akinyauf+Lqw6HJOI0a+BV79zY1L3IEtGGiusKt5KZ5 9WJAyTAz ljisnlUtjtcwwKauVfjr25MUkyVLgFx1XyHloEXsZvh+9ybVAr3KnBEopJzD8Db9bhNYPBeU5aYP73xGxMQguslBWqmmaKXqyx1v3vndvZqQULDhrJkyHTuhXbJ1eDM72vTk7ON1Lwbl2eBeLXwnfUiflJtue76BPvujXpnGPgYCKENjCL516wrdvxlKhDTNuR9/k7EebdbuxauuoNBY6Oztrt5ipHb6r13cgA86xbbEIlIjg+5NzBU2a5vI7yCWPDrul0QLwwpnJHXuZH7klc7jazWCxkkDG/wlS5MSZGaLYe19IVOxFuFbgZjhDLw5yenL8 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Geert reported an invalid wait context[1] which is resulted by moving set_track_prepare() inside kmemleak_lock. This is not allowed because in RT mode, the spinlocks can be preempted but raw_spinlocks can not, so it is not allowd to acquire spinlocks while holding raw_spinlocks. The second patch fix same problem in kmemleak_update_trace(). Link: https://lore.kernel.org/linux-mm/CAMuHMdWj0UzwNaxUvcocTfh481qRJpOWwXxsJCTJfu1oCqvgdA@mail.gmail.com/ [1] Liu Shixin (2): Revert "mm/kmemleak: move the initialisation of object to __link_object" mm/kmemleak: move set_track_prepare() outside raw_spinlocks mm/kmemleak.c | 40 ++++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 18 deletions(-)