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 003C7C021B0 for ; Thu, 20 Feb 2025 02:07:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4648D4401B9; Wed, 19 Feb 2025 21:07:14 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 415124401AE; Wed, 19 Feb 2025 21:07:14 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 303B84401B9; Wed, 19 Feb 2025 21:07:14 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 0D9354401AE for ; Wed, 19 Feb 2025 21:07:14 -0500 (EST) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 930851609FB for ; Thu, 20 Feb 2025 02:07:13 +0000 (UTC) X-FDA: 83138685546.25.42732B2 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf29.hostedemail.com (Postfix) with ESMTP id E2906120005 for ; Thu, 20 Feb 2025 02:07:11 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=CyBAFG+Y; spf=pass (imf29.hostedemail.com: domain of mhiramat@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=mhiramat@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1740017232; 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:dkim-signature; bh=nxukntJaNyon7DJR7VWWBSge5ZqeD47gHMUqOwlc7Vw=; b=VesJE+bVNudgSzOKF9s3DN5t6YCoNTUe2HNlxtXbagBz1sfDQ7+qzZykO7jWPgNM8dXS7T OB+7il2KXlt1gTH//wwV0BL7+ZoeYFWiRH/xr/tM8HxQAQA7h6dXzTvsRQVxYiXuO9B5en to+ASZrtUARJK93+CdcxzLqqHnHc2oA= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=CyBAFG+Y; spf=pass (imf29.hostedemail.com: domain of mhiramat@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=mhiramat@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1740017232; a=rsa-sha256; cv=none; b=yNBn+m49AlaXs7/UXbVaxB4e2v18/iUM2B66lclc+r8RhqIGgW3exYX57qrWNVi9wH8vgU PIxMvnRWZmWZHOlRNGES9xsZLhKrAgyHNDw8zRtCocgGoST+B421bppNuHv41OhR/RMCBv +9eLBFslFOvu+8ofutgqEYwDJLEiYPQ= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id DFED95C55C0; Thu, 20 Feb 2025 02:06:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A7E2AC4CED1; Thu, 20 Feb 2025 02:07:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1740017230; bh=ETbib4yNHDbWkAwhdNnXPyinNb8qr6IJyreKJvR+MHc=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=CyBAFG+YC6AGkJi3Ky+40y0fuQJpAhXYrGViHAjxzOZCor/V4WiIVGDh3dj0+bB9m KBb5MyCTXGvgYl/1Ooii3U/3t9iyztUSHf+/4ayhpLLfZl98wUDzF0n0/ieb0X6f2h PyPqyh5LIdlfC7MqUzPt9ke7WJr3y8eYNSITA8rfPituuzCQBhVMBU/p/oi1KYTNth ysrqk0rqUUkla324qCDGpX2J0gowmSswLZWgFtA57vLwGzReDUdAL7Y8Q2vvuy+ypo lufNdza83daT7Jhbbqxv8u9ZyjW+L9l9fEVAxcNe43nq2bZQuiDif8diAqDlQp54Ky k1fNcyoVNjxDg== Date: Thu, 20 Feb 2025 11:07:07 +0900 From: Masami Hiramatsu (Google) To: Steven Rostedt 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: <20250220110707.a314d394ccf68575047e75cb@kernel.org> In-Reply-To: <20250219185531.1140c3c4@gandalf.local.home> 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> X-Mailer: Sylpheed 3.8.0beta1 (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-Rspam-User: X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: E2906120005 X-Stat-Signature: ijw7wfcheqwt6yyc6e7qsah6yamecjz7 X-HE-Tag: 1740017231-145379 X-HE-Meta: U2FsdGVkX1/cPnTMDPE0aCyBSX0wcExC4l3fB50H26BXYE5dCwNJRXdJ/bK9PY9By4U68GLjgjcItL/kn/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ZHsytLNYVP9+ObNSYCJkU3JN8Kww/Azh3NG8e1aaxLp8AHmTORUiwj3htth3ewsJQPEvq+SYBkpUlxYr/xR6LSiQpeA97KfDnYalVGnaxzvEvuRwcHb95GDs/m4eBDpCeu9iQGtmARd23B6EvMnhyfQ3yZTfCB/gHFsgJ62tpy7J01Zl3OpKdKcyxXB8Jpq2w9nqtB4+0SEkYHd71riH3ZHLsSmCvKPRtzZMTys84BlUAKLvR1dGmgw7lRJx48d1KjfebRiHmHYVUf9kQpFRg267PbFfP4csPAFCmFBn 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 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_*(). > > > > > > > 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? Thank you, > > -- Steve > -- Masami Hiramatsu (Google)