Message ID | 20231120-freezer-state-multiple-thaws-v1-0-f2e1dd7ce5a2@quicinc.com |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2b07:b0:403:3b70:6f57 with SMTP id io7csp99839vqb; Mon, 20 Nov 2023 09:37:55 -0800 (PST) X-Google-Smtp-Source: AGHT+IFTM9w5+zKwqwwj/aaBUdM+8dn1YsZZkyRi8rJc5c811Pe43PJT7JIBmJG0uoHINwCCgyJq X-Received: by 2002:a05:6a00:1822:b0:6c4:d5ee:c6 with SMTP id y34-20020a056a00182200b006c4d5ee00c6mr7241245pfa.1.1700501875287; Mon, 20 Nov 2023 09:37:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700501875; cv=none; d=google.com; s=arc-20160816; b=VChkHDGVF/mjcwUHz9S6Ji2WmSrcUYvqKqMRFxaQB5S1we9551jiIe3zmMGsKPd/SX Am9R1zdb8eCAvTNCnL7ujBXn+x95dI3fUvTSP5Qjr11xeY1XEqkmzWC450T9awvvz07A ZRyJoRi1QBUiRDqboyhWLnCwPyF6C3tRotoBhL6EcgYHfoNGyg+x3mobI7BCer5c6WdH lui2LmD5/vrHgPcApzsnTQ4DT4Jde2CrOYBfJbkHdX8JKz4ZdaHiOCavkfuY3OfYqDZL S0eLaCF8p5J32ddFcS9uhaND66ezB3f9KRvn+G8OQ2RbPvuPS3akpHEoNlA4eSY5JXqb 0gTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:content-transfer-encoding:mime-version :message-id:date:subject:from:dkim-signature; bh=Y4hKSC8osUSLbhShv+siTVPHh9deWzSVjPWV2cjpYt4=; fh=NkPvJ5bsylham0ZTJm3gmzlKLfQhTMTVKxpWONm89vA=; b=rsKmzdiJ4ZzYr+NYKBs640H/ZQ0dx5u/JzvGkqXfY9T5aqOS89mGEyVMMQQd1qMF0y HwOyUa96XALNPcDH0fO78Kh4q7M+rvSP8OmaIE2pKd+2zYiacqdvft+cXGbkzwyJYSWO bjbUVu8swa8yNNXpcR/xFOVRqjQ3JHkVAWk59hYTftcGXDwEKA+N76sP1JAl2Am9qqjN urma6RrOaRQSCcVdyAV3ABWNf4i8oTXaoutYYAPyFTJmuEwG+Dxeiui6y3R0kkFhPLJj Tb/f3SIJrWnCZHjzSviy6NLMYLfWUvl/fh/w+H5XWSCuG87Z6ihoJjXIeK0WSUsu7sbd QsIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=Elh8y6kW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id u10-20020a056a00158a00b006cb4f312136si5818452pfk.200.2023.11.20.09.37.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Nov 2023 09:37:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=Elh8y6kW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 845EE80774BB; Mon, 20 Nov 2023 09:37:46 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233688AbjKTRhS (ORCPT <rfc822;heyuhang3455@gmail.com> + 27 others); Mon, 20 Nov 2023 12:37:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45338 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233789AbjKTRhD (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 20 Nov 2023 12:37:03 -0500 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BCE7B132; Mon, 20 Nov 2023 09:36:54 -0800 (PST) Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3AKHQn2A002178; Mon, 20 Nov 2023 17:36:44 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : subject : date : message-id : mime-version : content-type : content-transfer-encoding : to : cc; s=qcppdkim1; bh=Y4hKSC8osUSLbhShv+siTVPHh9deWzSVjPWV2cjpYt4=; b=Elh8y6kWZWbUH8nxcojfCFGnaAltxyVKyptAfngX8J7vH/3cD7UFtAZPbvB1rKx+vZNy rNUWtpJkQKq3rU/TXREwySrbjFTT15fYLOMYadSSYYxaHYRi954oYMFd3/yWvMS5K89H zUWkSNvvmX0TII4zhbovyK2Z1PJJSRHrvquzcBd3zFdFhWTC6/q0ACDeQrj223l6mS2L Fz7/6AA+AWd2LmldoG6FLjzdWP4FIr8E2GVqEZ7xfnPWK2VZ19aNl0O0xQRco2O42vqt mhdsXPi5I6jhjNf2zLgmaBUZJJanrlAsMPybtx/PU3S/591/cv37sO7lRRYcy5qE4NuI jg== Received: from nasanppmta05.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3ug7ea8rjm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 20 Nov 2023 17:36:44 +0000 Received: from nasanex01b.na.qualcomm.com (nasanex01b.na.qualcomm.com [10.46.141.250]) by NASANPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 3AKHahZg026197 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 20 Nov 2023 17:36:43 GMT Received: from hu-eberman-lv.qualcomm.com (10.49.16.6) by nasanex01b.na.qualcomm.com (10.46.141.250) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Mon, 20 Nov 2023 09:36:42 -0800 From: Elliot Berman <quic_eberman@quicinc.com> Subject: [PATCH 0/2] freezer,sched: do not restore saved_state of a thawed task Date: Mon, 20 Nov 2023 09:36:30 -0800 Message-ID: <20231120-freezer-state-multiple-thaws-v1-0-f2e1dd7ce5a2@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIAB6ZW2UC/4XNuxKCMBCF4VdxUrtOlpBBrXwPhyIkG9kZBUwCX hjeXbw0Nlr+p/jOKCIFpii2i1EEGjhy28yBy4WwtWkOBOzmFpnMFKJcgw9EdwoQk0kEp/6YuDs SpNpcIhRGmbXbOOMqJWaiC+T5+uL35dw1x9SG2+ttwOf6gVH/hgcEBK8yVyB5qSu5O/dsubEr2 56eT28mk38ZCSa3uVZeyyLXX0w5TdMD4/4tfhEBAAA= To: "Rafael J. Wysocki" <rafael@kernel.org>, Pavel Machek <pavel@ucw.cz>, "Ingo Molnar" <mingo@kernel.org>, "Peter Zijlstra (Intel)" <peterz@infradead.org> CC: <linux-arm-msm@vger.kernel.org>, Pavan Kondeti <quic_pkondeti@quicinc.com>, "Aiqun Yu (Maria)" <quic_aiquny@quicinc.com>, <linux-pm@vger.kernel.org>, <linux-kernel@vger.kernel.org>, Elliot Berman <quic_eberman@quicinc.com>, Abhijeet Dharmapurikar <quic_adharmap@quicinc.com> X-Mailer: b4 0.13-dev X-Originating-IP: [10.49.16.6] X-ClientProxiedBy: nalasex01c.na.qualcomm.com (10.47.97.35) To nasanex01b.na.qualcomm.com (10.46.141.250) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: 2xFWSMeQIEmKN960l1nM2d2mIlfA7_ql X-Proofpoint-ORIG-GUID: 2xFWSMeQIEmKN960l1nM2d2mIlfA7_ql X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-20_17,2023-11-20_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1011 suspectscore=0 phishscore=0 mlxscore=0 spamscore=0 malwarescore=0 priorityscore=1501 mlxlogscore=575 bulkscore=0 impostorscore=0 adultscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311060000 definitions=main-2311200126 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Mon, 20 Nov 2023 09:37:46 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783105449401064960 X-GMAIL-MSGID: 1783105454517042519 |
Series |
freezer,sched: do not restore saved_state of a thawed task
|
|
Message
Elliot Berman
Nov. 20, 2023, 5:36 p.m. UTC
This series applies couple fixes to commit 8f0eed4a78a8 ("freezer,sched:
Use saved_state to reduce some spurious wakeups") which was found while
testing with legacy cgroup freezer. My original testing was only with
system-wide freezer. We found that thaw_task could be called on a task
which was already frozen. Prior to commit 8f0eed4a78a8 ("freezer,sched:
Use saved_state to reduce some spurious wakeups"), this wasn't an issue
as kernel would try to wake up TASK_FROZEN, which wouldn't match the
thawed task state, and no harm done to task. After commit 8f0eed4a78a8
("freezer,sched: Use saved_state to reduce some spurious wakeups"), it
was possible to overwrite the state of thawed task.
To: Rafael J. Wysocki <rafael@kernel.org>
To: Pavel Machek <pavel@ucw.cz>
To: Ingo Molnar <mingo@kernel.org>
To: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: <linux-arm-msm@vger.kernel.org>
Cc: Pavan Kondeti <quic_pkondeti@quicinc.com>
Cc: Aiqun Yu (Maria) <quic_aiquny@quicinc.com>
Cc: <linux-pm@vger.kernel.org>
Cc: <linux-kernel@vger.kernel.org>
Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
Originally sent to only linux-arm-msm, resending to correct authors.
- Link to v1: https://lore.kernel.org/r/20231120-freezer-state-multiple-thaws-v1-0-a4c453f50745@quicinc.com
---
Elliot Berman (2):
freezer,sched: do not restore saved_state of a thawed task
freezer,sched: clean saved_state when restoring it during thaw
kernel/freezer.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
---
base-commit: 6d7e4782bcf549221b4ccfffec2cf4d1a473f1a3
change-id: 20231108-freezer-state-multiple-thaws-7a3a8d9dadb3
Best regards,
Comments
On 11/21/2023 1:36 AM, Elliot Berman wrote: > This series applies couple fixes to commit 8f0eed4a78a8 ("freezer,sched: > Use saved_state to reduce some spurious wakeups") which was found while > testing with legacy cgroup freezer. My original testing was only with > system-wide freezer. We found that thaw_task could be called on a task > which was already frozen. Prior to commit 8f0eed4a78a8 ("freezer,sched: > Use saved_state to reduce some spurious wakeups"), this wasn't an issue > as kernel would try to wake up TASK_FROZEN, which wouldn't match the > thawed task state, and no harm done to task. After commit 8f0eed4a78a8 > ("freezer,sched: Use saved_state to reduce some spurious wakeups"), it > was possible to overwrite the state of thawed task. > > To: Rafael J. Wysocki <rafael@kernel.org> > To: Pavel Machek <pavel@ucw.cz> > To: Ingo Molnar <mingo@kernel.org> > To: Peter Zijlstra (Intel) <peterz@infradead.org> > Cc: <linux-arm-msm@vger.kernel.org> > Cc: Pavan Kondeti <quic_pkondeti@quicinc.com> > Cc: Aiqun Yu (Maria) <quic_aiquny@quicinc.com> > Cc: <linux-pm@vger.kernel.org> > Cc: <linux-kernel@vger.kernel.org> > Signed-off-by: Elliot Berman <quic_eberman@quicinc.com> Shall we add Fixed tag and Cc: stable@vger.kernel.org ? Since it is fixing a stable user thread hung issue. > > Originally sent to only linux-arm-msm, resending to correct authors. > - Link to v1: https://lore.kernel.org/r/20231120-freezer-state-multiple-thaws-v1-0-a4c453f50745@quicinc.com > > --- > Elliot Berman (2): > freezer,sched: do not restore saved_state of a thawed task > freezer,sched: clean saved_state when restoring it during thaw > > kernel/freezer.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > --- > base-commit: 6d7e4782bcf549221b4ccfffec2cf4d1a473f1a3 > change-id: 20231108-freezer-state-multiple-thaws-7a3a8d9dadb3 > > Best regards,
On Tue, Nov 28, 2023 at 05:12:00PM +0800, Aiqun(Maria) Yu wrote: > On 11/21/2023 1:36 AM, Elliot Berman wrote: > > This series applies couple fixes to commit 8f0eed4a78a8 ("freezer,sched: > > Use saved_state to reduce some spurious wakeups") which was found while > > testing with legacy cgroup freezer. My original testing was only with > > system-wide freezer. We found that thaw_task could be called on a task > > which was already frozen. Prior to commit 8f0eed4a78a8 ("freezer,sched: > > Use saved_state to reduce some spurious wakeups"), this wasn't an issue > > as kernel would try to wake up TASK_FROZEN, which wouldn't match the > > thawed task state, and no harm done to task. After commit 8f0eed4a78a8 > > ("freezer,sched: Use saved_state to reduce some spurious wakeups"), it > > was possible to overwrite the state of thawed task. > > > > To: Rafael J. Wysocki <rafael@kernel.org> > > To: Pavel Machek <pavel@ucw.cz> > > To: Ingo Molnar <mingo@kernel.org> > > To: Peter Zijlstra (Intel) <peterz@infradead.org> > > Cc: <linux-arm-msm@vger.kernel.org> > > Cc: Pavan Kondeti <quic_pkondeti@quicinc.com> > > Cc: Aiqun Yu (Maria) <quic_aiquny@quicinc.com> > > Cc: <linux-pm@vger.kernel.org> > > Cc: <linux-kernel@vger.kernel.org> > > Signed-off-by: Elliot Berman <quic_eberman@quicinc.com> > Shall we add Fixed tag and Cc: stable@vger.kernel.org ? > Since it is fixing a stable user thread hung issue. If you want this routed through urgent, then yes.
On 11/28/2023 11:31 AM, Peter Zijlstra wrote: > On Tue, Nov 28, 2023 at 05:12:00PM +0800, Aiqun(Maria) Yu wrote: >> On 11/21/2023 1:36 AM, Elliot Berman wrote: >>> This series applies couple fixes to commit 8f0eed4a78a8 ("freezer,sched: >>> Use saved_state to reduce some spurious wakeups") which was found while >>> testing with legacy cgroup freezer. My original testing was only with >>> system-wide freezer. We found that thaw_task could be called on a task >>> which was already frozen. Prior to commit 8f0eed4a78a8 ("freezer,sched: >>> Use saved_state to reduce some spurious wakeups"), this wasn't an issue >>> as kernel would try to wake up TASK_FROZEN, which wouldn't match the >>> thawed task state, and no harm done to task. After commit 8f0eed4a78a8 >>> ("freezer,sched: Use saved_state to reduce some spurious wakeups"), it >>> was possible to overwrite the state of thawed task. >>> >>> To: Rafael J. Wysocki <rafael@kernel.org> >>> To: Pavel Machek <pavel@ucw.cz> >>> To: Ingo Molnar <mingo@kernel.org> >>> To: Peter Zijlstra (Intel) <peterz@infradead.org> >>> Cc: <linux-arm-msm@vger.kernel.org> >>> Cc: Pavan Kondeti <quic_pkondeti@quicinc.com> >>> Cc: Aiqun Yu (Maria) <quic_aiquny@quicinc.com> >>> Cc: <linux-pm@vger.kernel.org> >>> Cc: <linux-kernel@vger.kernel.org> >>> Signed-off-by: Elliot Berman <quic_eberman@quicinc.com> >> Shall we add Fixed tag and Cc: stable@vger.kernel.org ? >> Since it is fixing a stable user thread hung issue. > > If you want this routed through urgent, then yes. Fixes tag is added to https://lore.kernel.org/all/20231120-freezer-state-multiple-thaws-v1-1-f2e1dd7ce5a2@quicinc.com/ Is CC'ing stable what triggers routing through urgent? Thanks, Elliot
On Tue, Nov 28, 2023 at 11:33:23AM -0600, Elliot Berman wrote: > > > On 11/28/2023 11:31 AM, Peter Zijlstra wrote: > > On Tue, Nov 28, 2023 at 05:12:00PM +0800, Aiqun(Maria) Yu wrote: > >> On 11/21/2023 1:36 AM, Elliot Berman wrote: > >>> This series applies couple fixes to commit 8f0eed4a78a8 ("freezer,sched: > >>> Use saved_state to reduce some spurious wakeups") which was found while > >>> testing with legacy cgroup freezer. My original testing was only with > >>> system-wide freezer. We found that thaw_task could be called on a task > >>> which was already frozen. Prior to commit 8f0eed4a78a8 ("freezer,sched: > >>> Use saved_state to reduce some spurious wakeups"), this wasn't an issue > >>> as kernel would try to wake up TASK_FROZEN, which wouldn't match the > >>> thawed task state, and no harm done to task. After commit 8f0eed4a78a8 > >>> ("freezer,sched: Use saved_state to reduce some spurious wakeups"), it > >>> was possible to overwrite the state of thawed task. > >>> > >>> To: Rafael J. Wysocki <rafael@kernel.org> > >>> To: Pavel Machek <pavel@ucw.cz> > >>> To: Ingo Molnar <mingo@kernel.org> > >>> To: Peter Zijlstra (Intel) <peterz@infradead.org> > >>> Cc: <linux-arm-msm@vger.kernel.org> > >>> Cc: Pavan Kondeti <quic_pkondeti@quicinc.com> > >>> Cc: Aiqun Yu (Maria) <quic_aiquny@quicinc.com> > >>> Cc: <linux-pm@vger.kernel.org> > >>> Cc: <linux-kernel@vger.kernel.org> > >>> Signed-off-by: Elliot Berman <quic_eberman@quicinc.com> > >> Shall we add Fixed tag and Cc: stable@vger.kernel.org ? > >> Since it is fixing a stable user thread hung issue. > > > > If you want this routed through urgent, then yes. > > Fixes tag is added to https://lore.kernel.org/all/20231120-freezer-state-multiple-thaws-v1-1-f2e1dd7ce5a2@quicinc.com/ > > Is CC'ing stable what triggers routing through urgent? Fixes tag should be enough, lemme go find that other copy then.. so much email :/