Message ID | 6019796.lOV4Wx5bFT@kreacher |
---|---|
Headers |
Return-Path: <linux-kernel+bounces-12247-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp1657931dyb; Wed, 27 Dec 2023 12:42:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IG7Ivo78rtkOOCTNH8v/dfgsONuPZoO2uyVV6+mwsghocoOUkFLn96NzCVqLMsJ9znTcPzj X-Received: by 2002:a05:6214:2601:b0:67c:cd09:9b93 with SMTP id gu1-20020a056214260100b0067ccd099b93mr13504469qvb.7.1703709765966; Wed, 27 Dec 2023 12:42:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703709765; cv=none; d=google.com; s=arc-20160816; b=DwJJKQMkSzRdzk7yHudp+/6QAojtjaQXBVdSXqRByvYtd40TAjGgUvqcbGn78UDDoZ Mv/BttEKv+SAOgUZYLzXp/svPeZcyYs0mlqemr+N/KCpmmkzVkpQ+B4PTCgXOUGi4CLy d21vHyb77vsu4mhKV2xKCM0EP938L/I+pMB2TobvzsEqaIKJvKjbJ85cFxl7+dtBB44K XpYKlKOvHUJTQdS7lHp9IsQlRoYYBLtPefN09BFK2FZGm2ehxZJMQzjTirX7+Bp8m+lE g0RdtEETso5cf1vBVjGXIjeCA3ZNJhxw/5HpyCpm5z3yl/r8tvkxEZ8QsS4uU46NBT7c Y6Cw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=U+F+o+B/6Xq5Z63S74jmOKHytlVtgSl7aj22P0J1OQM=; fh=GJObpfi22GEDsdUJ/UPF0sV9R5wqW+3fN2C4DnWtGgw=; b=fUC/Ybn7KzRh9lLvullmCz6Dm02mXWPqvi3V2f+SAie5Wn4p+thBHD4xAfWLfPYOF4 Ov0LsyNI6sG8SY7dhyoM7P6i+iMVOtS9PGVL7QC+D8ZyqKGuIMxrddkg/OEGWjN33Uv/ Ww4r0ILftQXnyQTxBqMdaBNNowdgqDQYQcCNUEF1kgfSjQAuJifV6ixD0vHGyz40nLYX PE7HT7m3suxeasARHDJACSwkBE9sz3XDVnj6YeRzYbvHRt6JfEQDBvf7dd7H8JK73Ior S8aHUmT/apMB1eYBxEJ8y3ERqeizAu8/XHTDnf5Xyk9p+MJyFHZxatelZA0RqSFDMW2z ibxw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-12247-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12247-ouuuleilei=gmail.com@vger.kernel.org" Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id h1-20020a0cf201000000b0067f6b017e53si14807366qvk.585.2023.12.27.12.42.45 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Dec 2023 12:42:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-12247-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-12247-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12247-ouuuleilei=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id BEE011C22638 for <ouuuleilei@gmail.com>; Wed, 27 Dec 2023 20:42:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B6AD448CED; Wed, 27 Dec 2023 20:41:50 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from cloudserver094114.home.pl (cloudserver094114.home.pl [79.96.170.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4D86E47F69; Wed, 27 Dec 2023 20:41:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=rjwysocki.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rjwysocki.net Received: from localhost (127.0.0.1) (HELO v370.home.net.pl) by /usr/run/smtp (/usr/run/postfix/private/idea_relay_lmtp) via UNIX with SMTP (IdeaSmtpServer 5.4.0) id 954e4a2bde97b9af; Wed, 27 Dec 2023 21:41:45 +0100 Received: from kreacher.localnet (unknown [195.136.19.94]) (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 cloudserver094114.home.pl (Postfix) with ESMTPSA id AB00B668E17; Wed, 27 Dec 2023 21:41:44 +0100 (CET) From: "Rafael J. Wysocki" <rjw@rjwysocki.net> To: Greg KH <gregkh@linuxfoundation.org>, linux-pm@vger.kernel.org Cc: Youngmin Nam <youngmin.nam@samsung.com>, rafael@kernel.org, linux-kernel@vger.kernel.org, d7271.choe@samsung.com, janghyuck.kim@samsung.com, hyesoo.yu@samsung.com, Alan Stern <stern@rowland.harvard.edu>, Ulf Hansson <ulf.hansson@linaro.org> Subject: [PATCH v1 0/3] PM: sleep: Fix possible device suspend-resume deadlocks Date: Wed, 27 Dec 2023 21:35:53 +0100 Message-ID: <6019796.lOV4Wx5bFT@kreacher> In-Reply-To: <5754861.DvuYhMxLoT@kreacher> References: <CGME20231227084252epcas2p3b063f7852f81f82cd0a31afd7f404db4@epcas2p3.samsung.com> <2023122701-mortify-deed-4e66@gregkh> <5754861.DvuYhMxLoT@kreacher> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="UTF-8" X-CLIENT-IP: 195.136.19.94 X-CLIENT-HOSTNAME: 195.136.19.94 X-VADE-SPAMSTATE: clean X-VADE-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedrvddvledgudegudcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfjqffogffrnfdpggftiffpkfenuceurghilhhouhhtmecuudehtdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvvefufffkjghfggfgtgesthfuredttddtjeenucfhrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqeenucggtffrrghtthgvrhhnpeefudduuedtuefgleffudeigeeitdeufeelvdejgefftdethffhhfethfeljefgteenucffohhmrghinhepkhgvrhhnvghlrdhorhhgnecukfhppeduleehrddufeeirdduledrleegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepudelhedrudefiedrudelrdelgedphhgvlhhopehkrhgvrggthhgvrhdrlhhotggrlhhnvghtpdhmrghilhhfrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqedpnhgspghrtghpthhtohepuddtpdhrtghpthhtohepghhrvghgkhhhsehlihhnuhigfhhouhhnuggrthhiohhnrdhorhhgpdhrtghpthhtoheplhhinhhugidqphhmsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohephihouhhnghhmihhnrdhnrghmsehsrghmshhunhhgrdgtohhmpdhrtghpthhtoheprhgrfhgrvghlsehkvghrnhgv lhdrohhrghdprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopegujedvjedurdgthhhovgesshgrmhhsuhhnghdrtghomh X-DCC--Metrics: v370.home.net.pl 1024; Body=10 Fuz1=10 Fuz2=10 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1786469171490206999 X-GMAIL-MSGID: 1786469171490206999 |
Series |
PM: sleep: Fix possible device suspend-resume deadlocks
|
|
Message
Rafael J. Wysocki
Dec. 27, 2023, 8:35 p.m. UTC
Hi Everyone, As reported here https://lore.kernel.org/linux-pm/ZYvjiqX6EsL15moe@perf/ the device suspend-resume code running during system-wide PM transitions deadlock on low memory, because it attempts to acquire a mutex that's already held by it in those cases. This series addresses the issue by changing the resume code behavior to directly run the device PM functions synchronously if they cannot be scheduled for asynchronous executions (patch [3/3]). For this purpose, the async code is rearranged (patch [1/3]) and a new variant of async_schedule_dev() is introduced (patch [2/3]). Thanks!
Comments
On Wed, Dec 27, 2023 at 9:41 PM Rafael J. Wysocki <rjw@rjwysocki.net> wrote: > > Hi Everyone, > > As reported here > > https://lore.kernel.org/linux-pm/ZYvjiqX6EsL15moe@perf/ > > the device suspend-resume code running during system-wide PM transitions > deadlock on low memory, because it attempts to acquire a mutex that's > already held by it in those cases. > > This series addresses the issue by changing the resume code behavior > to directly run the device PM functions synchronously if they cannot > be scheduled for asynchronous executions (patch [3/3]). > > For this purpose, the async code is rearranged (patch [1/3]) and a > new variant of async_schedule_dev() is introduced (patch [2/3]). Given the lack of negative feedback, I've queued up this series for 6.8-rc1. Please let me know if there are any issues with that. Thanks!
On Tue, Jan 02, 2024 at 02:18:43PM +0100, Rafael J. Wysocki wrote: > On Wed, Dec 27, 2023 at 9:41 PM Rafael J. Wysocki <rjw@rjwysocki.net> wrote: > > > > Hi Everyone, > > > > As reported here > > > > https://lore.kernel.org/linux-pm/ZYvjiqX6EsL15moe@perf/ > > > > the device suspend-resume code running during system-wide PM transitions > > deadlock on low memory, because it attempts to acquire a mutex that's > > already held by it in those cases. > > > > This series addresses the issue by changing the resume code behavior > > to directly run the device PM functions synchronously if they cannot > > be scheduled for asynchronous executions (patch [3/3]). > > > > For this purpose, the async code is rearranged (patch [1/3]) and a > > new variant of async_schedule_dev() is introduced (patch [2/3]). > > Given the lack of negative feedback, I've queued up this series for 6.8-rc1. > > Please let me know if there are any issues with that. > > Thanks! > Hi Rafael We haven't seen any regression issue under our stress test. So, feel free to add Tested-by: Youngmin Nam <youngmin.nam@samsung.com> Thanks.
On Wed, Jan 3, 2024 at 5:39 AM Youngmin Nam <youngmin.nam@samsung.com> wrote: > > On Tue, Jan 02, 2024 at 02:18:43PM +0100, Rafael J. Wysocki wrote: > > On Wed, Dec 27, 2023 at 9:41 PM Rafael J. Wysocki <rjw@rjwysocki.net> wrote: > > > > > > Hi Everyone, > > > > > > As reported here > > > > > > https://lore.kernel.org/linux-pm/ZYvjiqX6EsL15moe@perf/ > > > > > > the device suspend-resume code running during system-wide PM transitions > > > deadlock on low memory, because it attempts to acquire a mutex that's > > > already held by it in those cases. > > > > > > This series addresses the issue by changing the resume code behavior > > > to directly run the device PM functions synchronously if they cannot > > > be scheduled for asynchronous executions (patch [3/3]). > > > > > > For this purpose, the async code is rearranged (patch [1/3]) and a > > > new variant of async_schedule_dev() is introduced (patch [2/3]). > > > > Given the lack of negative feedback, I've queued up this series for 6.8-rc1. > > > > Please let me know if there are any issues with that. > > > > Thanks! > > > Hi Rafael > > We haven't seen any regression issue under our stress test. > > So, feel free to add > > Tested-by: Youngmin Nam <youngmin.nam@samsung.com> Thank you!