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 089A3C021AA for ; Thu, 20 Feb 2025 02:22:45 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9573B4401BC; Wed, 19 Feb 2025 21:22:44 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 907474401AE; Wed, 19 Feb 2025 21:22:44 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7D1154401BC; Wed, 19 Feb 2025 21:22:44 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 605614401AE for ; Wed, 19 Feb 2025 21:22:44 -0500 (EST) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 527B21A054F for ; Thu, 20 Feb 2025 02:22:43 +0000 (UTC) X-FDA: 83138724606.28.A3AF10B Received: from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254]) by imf09.hostedemail.com (Postfix) with ESMTP id A5E0014000B for ; Thu, 20 Feb 2025 02:22:41 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=none; spf=pass (imf09.hostedemail.com: domain of "SRS0=7baa=VL=goodmis.org=rostedt@kernel.org" designates 172.105.4.254 as permitted sender) smtp.mailfrom="SRS0=7baa=VL=goodmis.org=rostedt@kernel.org"; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1740018161; a=rsa-sha256; cv=none; b=K+EpFvVBbm83VtAN/pCz621AQV27iLG1xvI+lquc7AF8hWLFu6Qck7oH6xAyJm7FJr+gw3 U+Vdo8Oea/MbNfmiugiU46CVXv4K/HrFd2D8Pm1dOL6ntXTOkoAkCkQgCVqiCqigPL7yT0 v6jh3wkm3wPgdfa6AvLE9QAA9hWjs7o= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=none; spf=pass (imf09.hostedemail.com: domain of "SRS0=7baa=VL=goodmis.org=rostedt@kernel.org" designates 172.105.4.254 as permitted sender) smtp.mailfrom="SRS0=7baa=VL=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=1740018161; 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=wKIWOAMDHVZtb8UCjhjvbB3u73HLC7RlBgW7ElLkFio=; b=KZO1e/sUgquZn01AaL0W537gkyvcKQW8F0bTsIM8lmJ2px3lmmU73Kuls7kTHOTdFIijH4 6vM59dLYBWRSw7OwmX3QMxl/ahBe0EhrXnbVJljWcYRvv8TCXRse8M7clLqWRv06bjuDGO 0qWImvZ02+o72sixYAO66dumUqlCv7w= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id 7E37761268; Thu, 20 Feb 2025 02:22:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F0D92C4CED1; Thu, 20 Feb 2025 02:22:38 +0000 (UTC) Date: Wed, 19 Feb 2025 21:23:03 -0500 From: Steven Rostedt To: "Masami Hiramatsu (Google)" Cc: Waiman Long , 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: <20250219212303.6a49c011@gandalf.local.home> In-Reply-To: <20250220110707.a314d394ccf68575047e75cb@kernel.org> 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> <20250219152435.35077ac3@gandalf.local.home> <20250220075639.298616eb494248d390417977@kernel.org> <20250219185531.1140c3c4@gandalf.local.home> <20250220110707.a314d394ccf68575047e75cb@kernel.org> 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-Stat-Signature: 8gap1okygs54funodfc8fmiraunbb1mx X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: A5E0014000B X-Rspam-User: X-HE-Tag: 1740018161-355810 X-HE-Meta: U2FsdGVkX1/fh6W1Ax4u070l4AxSutX52R8oarZJaZcw7pUqFmiqRH+flIwkQOy76/8+7rKrb0m6OmIADr8QeFdMFI40KfXz/oMlGY7rrIzhAylnvwCxDkKCOQo67Tt5g6ebkhnyabLoK4lj6pP5bSwomF0uW/Ltxb7qNnctPyphbqkRKOAildRvdV/MZ6aZ7cj85GPrLbdKGoVwMMCQVifPKWvzEx2iFXP2tZBYVszrFeD2oiUpstj1dSHgVMEwiKGcoiC+ZlAgltZBfkur2vwFtmP0/z32SvfK1VSeT2W7afCZZHJ1j/6H/Na3cBK90k2CRIhqeUAkWfWx81IjSMRLsPANmsZTQjUrZWdamgC8EmDtQF4xu5NoRd94eVMU+jL/la6rmFqMhhT39yPoJv/XYAiBY6b2leZvYaIUSWtocTglXx2nOaSPSqTRKuSA6buHTcafAb5/wd73c/7ElIWkQpuqjyokVwsqFHL2p17tiY6PCSPtEEQf8PKWdFVAYvtdez+l6e+xSk8aSpnlYppmszD/I9bX/in9unKt0CJE3zoX0zlyFvh9rv/2W9QBlffOjmiMVgWa1Rl7gguc8fGk4NOD8RwwnkliH27i8eiQbKrSmNYA/QYBaxdBzfuIC0FoDeWB1ZecBc5EFHB94LlJ/uEqi7SFuafMeZ/oDsTq8R2YgjKdaHo2ow4v/FDeLHD+MqW4s7gPHGLuaicQSibC1Ha3lLNPZqzJ+fPcw1XZGCcwVK2NMLgAAv+AEUO9aUDzqtkj24902aUFkyaGCOhRv3h6947RHXi9cd1ACINV05s0QB+CMtrnLrJ/8s6/OE33I9BWjwkuD5d4QdCNV6e5SRJOYfz4focEBOa3pVggcjc4o01hpB9NJMpygZ6d0U5Cj6pLVT7pZAIOPqtCydDXhwjr6sJJO3AHghSUk3GJMmgQS3ghlJ6VmUixsgnKWcGEif29EHV+Hc9mahB CU1WsgUh Y9mslmoWakrPlUNhz+Gwbtlc7KapMaZ7nxN3Ce5WMFMuYGFeEIZqxDfHdrIDZ6eTSAxxayUUbshDDJUvDnHYn4wwuPs1xIMddxfL5Dlt5M3NWdXKFS6vLixXMbn/a27VNf7KKgAlUpA+dAdHn01A1KZOfhGlXZQIitaNyz65nUpgWsxI+NH48XyxNeqgRhl55qvtFS2JalO3nsolOnohBXkAx+QqMo4Dtp7dIgLmsOZQ50j0L4qaFXQlhKtR9agtmxdxpoUfMLOCmRQ4/HnyQnkqzQYsAPbsYgJfw3xOsPA//FrtUqia01UxsP6od27mkyCKXAtiFXv6Gk6PtwSKgo92id/pZPaPznu80foq61EyR4zCF07voOpb8hywZgmClznT6Qp77u9QSCYBZIfOoY2zvBri4wraoIeVjDnaqL64ahCbjgJf9qMITNEagGbcvqXcb 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 Thu, 20 Feb 2025 11:07:07 +0900 Masami Hiramatsu (Google) wrote: > On Wed, 19 Feb 2025 18:55:31 -0500 > Steven Rostedt wrote: > > > On Thu, 20 Feb 2025 07:56:39 +0900 > > Masami Hiramatsu (Google) wrote: > > > > > > >> 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. > > > > > > Do we need to take it just for accessing owner, which is in an atomic? > > > > Updating the task_struct would be in the same location as the blocked_on is > > anyway. I would make it into a wrapper function that is a nop when disabled. > > Should we make it depends on DEBUG_MUTEXES too? I think no. We can introduce > a different kconfig and wrapper function which calls debug_mutex_*(). No it should only depend on HUNG_TASKS. > > > > > > > > > > > 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. > > > > > > > > Yes, it could be a new config option. This will be a useful feature that > > > > I believe most distros will turn it on. Or we may just include that in > > > > the core code without any option. > > > > > > Do we need another option? or just extend DETECT_HUNG_TASK? > > > > DETECT_HUNG_TASK is just that, for detecting hung tasks. This adds more > > information to that, which increases the size of the task_struct not to > > mention adds code in the mutex/rwsem handlers. > > > > I would definitely make it a separate config that may depend on > > DETECT_HUNG_TASK. > > OK, what about CONFIG_TASK_BLOCKER? I'm fine with whatever color you would like the bikeshed to be ;-) -- Steve