From mboxrd@z Thu Jan 1 00:00:00 1970 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 5AD52C021AA for ; Wed, 19 Feb 2025 20:24:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CD8BE44017F; Wed, 19 Feb 2025 15:24:16 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C8961440179; Wed, 19 Feb 2025 15:24:16 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B504144017F; Wed, 19 Feb 2025 15:24:16 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 97A6B440179 for ; Wed, 19 Feb 2025 15:24:16 -0500 (EST) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 196741A01C2 for ; Wed, 19 Feb 2025 20:24:16 +0000 (UTC) X-FDA: 83137821312.06.53BA8C6 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf22.hostedemail.com (Postfix) with ESMTP id 6C65BC0016 for ; Wed, 19 Feb 2025 20:24:14 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=none; spf=pass (imf22.hostedemail.com: domain of "SRS0=Eo3P=VK=goodmis.org=rostedt@kernel.org" designates 139.178.84.217 as permitted sender) smtp.mailfrom="SRS0=Eo3P=VK=goodmis.org=rostedt@kernel.org"; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1739996654; 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:in-reply-to:references:references; bh=PgbnIceU4GuI7WOFhSWoOEfwgZBzcicjZlODcfoaJHw=; b=XmgL6QB2R24ZVQRrpwBlhwaRu+rlQTWf1iSHaKOdyGyd7LcanDdLVZrEaIS1SGqMS3ouIE i/xinJdqSPBpIKzDJoMGXYzm7Y0fCGGeXPELcWc0wI+ESCD108GLT4euXOEK7E98AFALdh t92+nnSCOlU9hUywJGAp0yDxebB23xU= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=none; spf=pass (imf22.hostedemail.com: domain of "SRS0=Eo3P=VK=goodmis.org=rostedt@kernel.org" designates 139.178.84.217 as permitted sender) smtp.mailfrom="SRS0=Eo3P=VK=goodmis.org=rostedt@kernel.org"; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1739996654; a=rsa-sha256; cv=none; b=jUjZxGtH2uF3/OkX/2erNcyhT4dO9zc/gieqoZ8nfYCQp6LaBQ05tvIPtc71QioFtChtzS OZhNNquCGUmwTRVdrlaoVPgPbIvsPQcLthDsuS6gkwrIUclZ7UEqT8Wh3W7DMQ7tdnYWqk b+0A3YL9IgJzMvJdVKcAQVgYEb4bf94= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 3396B5C5C52; Wed, 19 Feb 2025 20:23:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5DA9FC4CED1; Wed, 19 Feb 2025 20:24:11 +0000 (UTC) Date: Wed, 19 Feb 2025 15:24:35 -0500 From: Steven Rostedt To: Waiman Long Cc: "Masami Hiramatsu (Google)" , Peter Zijlstra , Ingo Molnar , Will Deacon , Andrew Morton , Boqun Feng , Joel Granados , Anna Schumaker , Lance Yang , Kent Overstreet , Yongliang Gao , Tomasz Figa , Sergey Senozhatsky , linux-kernel@vger.kernel.org, Linux Memory Management List Subject: Re: [PATCH 1/2] hung_task: Show the blocker task if the task is hung on mutex Message-ID: <20250219152435.35077ac3@gandalf.local.home> In-Reply-To: <0fa9dd8e-2d83-487e-bfb1-1f5d20cd9fe6@redhat.com> References: <173997003868.2137198.9462617208992136056.stgit@mhiramat.tok.corp.google.com> <173997004932.2137198.7959507113210521328.stgit@mhiramat.tok.corp.google.com> <20250219112308.5d905680@gandalf.local.home> <0fa9dd8e-2d83-487e-bfb1-1f5d20cd9fe6@redhat.com> X-Mailer: Claws Mail 3.20.0git84 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 6C65BC0016 X-Stat-Signature: jcbemyqhcjpb3p1kkqytdu6wuf19x8oc X-Rspam-User: X-HE-Tag: 1739996654-587533 X-HE-Meta: U2FsdGVkX18skkzEe6EjCkFArXGXng7G2a2EfZUaAt4Hl1MOp/AkLQXlONpWvpGTPY1NYCXA5/HBJn40WbTdKK08sey4WfKUOwRfVG45Za6MAn8goNnUKyTZFiPZCV5gC5Xk9JpoQdfQxCoTuq3RvuWEVCqGcuIIeS/R/u4hIuH/d83NF0rW78fQ9PxCN1aGSuVzppPeF/fggmJmQspRtucyYvEc7F4ip3wGacQbW4m11pdFATyT01IlJtPuGKmsMsx4u3fEIWokz9C2zd4mOxezn0SsAnbc9aYqacNbKqGi1E1q1TJmiLsaJP41xL0hGCMJYDkpFX1vdZnXQjPmz9i4qjzUo/ZE50fPNrTiR0IRuEDcsva2ydsJ6ouZjOFjp6untslUp6oKfwyfVrcBJZwLdBoMF7yxz9anCrLRpJb4ubBxVGUkkIKD6rTpe/uxQis4/TByGp7gr64bF3itDkdDe8ELndqm8bRpd1HtxnqfTQZ6w61fJG+619u4+bE8u9P1AUpfdBxtoFX2q85NbsiZemhjywP5zTwdjlYlY1fIp9mVl8UQj7/zQC13k6X1FKmBRyiXObeQkyubIWJQ8brttKXABGmyV2n2VnXItn/stwiQtzaqc9z16Nan+d/66e1a5Ul45TW5vQvV1IyfvK+f/urbo8tJ7JAwRSce9rJC1ygHaRjxttgX/c5mbz6msd4qM7MBJ/XeiNkeCnXcqQ041uqp3vtL/KCJiZkaL93irCHJLxfhLDkYjLLk3lco1AZSPpuf+K9wpQBPe09HNWhx9DIfeTzs3Wtmr7fjIu7XEsFWZJSiOcY+oLpupwAZ/iPEcsHLJmqB3fBu1M9bC6thjJgTWAZ7BQ0rQs/Jm9OaUteHKs3d53kVR5GWR/UAc+3kh6IKgeShHEzS/UbiyNFxHUN6RiOXe1C2OABXV7OtXGP11KTV3YGEnRx+FxkRXQcUMJ5M42ltQgeofRm cbFn3GGI LVal+Tv/Lr0BeQ7Y4D1N2SvHEmKgII0iZFFemI3ijao/bJryl/IJ2+D6ojtdbYJSxYlBYuJ59gq2tr1b8O7hyFF7cnxidL/WqFTOEdch/Iu5S7QDPrrKf2VhcMSFchGWz20jR8uiBYtmkLNJX11oMSEXqs3J5N+/XwAhStUmlrTSjScceTZ81MjARNkQbBWZZpaxJhaHWPl15myqlwglfz26hXmsVxuYOHUKK3pBnG6IoJ+YELaCMlLvYGIDBssVbBrzJssPCSy5T5bxIk9vL9nYcssNo0sxY4kOfPkJHby0Lu7SAkeFB8gQRh4LU+rOXY4xf0f0I2b8z3IEhqxsTwdtvKGly2TUJjw9HTcZkeMReR60KGxxbpSEuFzBAYRJmObrHinws9coaWO0FGYHMzlcMy+zZy2V89NnlY0ZSU8ygQBou4pmXlhevyQIjNImgijdc 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: On Wed, 19 Feb 2025 15:18:57 -0500 Waiman Long wrote: > It is tricky to access the mutex_waiter structure which is allocated > from stack. So another way to work around this issue is to add a new > blocked_on_mutex field in task_struct to directly point to relevant > mutex. Yes, that increase the size of task_struct by 8 bytes, but it is > a pretty large structure anyway. Using READ_ONCE/WRITE_ONCE() to access And it's been on my TODO list for some time to try to make that structure smaller again :-/ > this field, we don't need to take lock, though taking the wait_lock may > still be needed to examine other information inside the mutex. But perhaps if we add a new config option for this feature, we could just add the lock that a task is blocked on before it goes to sleep and reference that instead. That would be easier than trying to play games getting the lock owner from the blocked_on field. -- Steve