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 35778C021B0 for ; Thu, 20 Feb 2025 01:53:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A9979280284; Wed, 19 Feb 2025 20:53:09 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A4998280282; Wed, 19 Feb 2025 20:53:09 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 910B8280284; Wed, 19 Feb 2025 20:53:09 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 725B6280282 for ; Wed, 19 Feb 2025 20:53:09 -0500 (EST) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 154634CBEE for ; Thu, 20 Feb 2025 01:53:09 +0000 (UTC) X-FDA: 83138650098.16.701EBFD Received: from mail-ed1-f54.google.com (mail-ed1-f54.google.com [209.85.208.54]) by imf20.hostedemail.com (Postfix) with ESMTP id 1E9271C0019 for ; Thu, 20 Feb 2025 01:53:06 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=HsxNrhMl; spf=pass (imf20.hostedemail.com: domain of ioworker0@gmail.com designates 209.85.208.54 as permitted sender) smtp.mailfrom=ioworker0@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1740016387; 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=VsWYuOocFG8H9OvoYBsSenQTRN91GcfiNLb0Cptd6h0=; b=AgcelO9TEtHOIUmNuxvi5xE5GO6z4sYrcAQhuG9oq46zdjmzUuN5wPMC34qWX+ix0CVoGD IbOdXxFROHk3cPFSfRKAadwv5cvOvI9nUdk39tN1EN729eMe6sCq3qswVXABoqYbsDxlsz +C3kQzHNjQDF/d4wJIKKnkMJ78puyoE= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=HsxNrhMl; spf=pass (imf20.hostedemail.com: domain of ioworker0@gmail.com designates 209.85.208.54 as permitted sender) smtp.mailfrom=ioworker0@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1740016387; a=rsa-sha256; cv=none; b=YN9ch5AXkJ/+9udQGTIoZ8qofIw530g5votEN7dQYj5rO0iZwGVqC3S2cIjt3kxsRdM4fa NHGsV5R5tnzbenMVrvCOuF9FbWu947pnJYAk5QVCSJnugXiryiCsEsjJDTHpihQ5wyrGEP EyPLy6zTAE3Epu0AaNiQv8ldZQN7Br4= Received: by mail-ed1-f54.google.com with SMTP id 4fb4d7f45d1cf-5e058ca6806so617595a12.3 for ; Wed, 19 Feb 2025 17:53:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1740016385; x=1740621185; darn=kvack.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=VsWYuOocFG8H9OvoYBsSenQTRN91GcfiNLb0Cptd6h0=; b=HsxNrhMlB8YYcoFh180phdcdMKztiDjWqFDBXVvSKbTn3wurcHLJPuQF0bO7HLKZEY dbmbgSVRs2WAeRxw4kNpR/fEDGfFTb5DXxNFi4AR9UtxDmbCUA17135zNOWjVwwft9XN eDrT1CFTZ56pPFZLXLEnK+OGSqaT2N8Ko+av0a8NjHSpmT2Ch17TIQL7a0fD5IB4lJtc 2ySQl+054+TzQEdh4/cBliAncF1F6O5BM7+aS4cw8tC4ZbeNzL2HVa3/DQh+Ymff4SfK ji9Hl4kKR4mHpa2Bu5Td1oynko+Q8LffbGaKll3luGHO3aOJPocJfkPn+oHwUcv80wIf iSeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740016385; x=1740621185; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VsWYuOocFG8H9OvoYBsSenQTRN91GcfiNLb0Cptd6h0=; b=ntcw05t8ZaYaoRE3sfhM75CNWZpg/er/KVnsRVwLrtS6PzYxsSn9lNxAzfFLgvqDMI qCnyzk27sHMpSUmj0nzkVZAZ66ggWh7avsTVYvNYpGpfuFl6ZnojmHq4aCELGDXyKcDY fu70p3573wTc7KmoJrZektlJp0u5QxjthsEmefd4GHOQELkdGa7MUPAlNGV21MjpBvuG TWohAMoH2FC5HWd928zs11bS54LGxguMppou2crzr+IReJbBssLcV7J9cmNSDs/7Jryq 5OET+ooJOEoMHd18/b++h/XAZt0qwzI82+vswj8ZdGSy2qu3jWDmn+yjMjcZbwCXtsv6 JXKA== X-Forwarded-Encrypted: i=1; AJvYcCVt6lFjrjxc+AWJzl4+qsZDBwgt++o/xQ8kfTVEpGW+HzJqIDPGV9inqzuC4s2s4CGutdJ63aAiBA==@kvack.org X-Gm-Message-State: AOJu0YwcFxjGoWIYF5lMP7P31adZhf0MAhlXOhDl1BNo8MHjDUNLKxOi q8/afc/YjcOq16ykUJEKn530WkUypBzPSJ8cUO84Pbv8blLpL7lW64WlJcqlJALrE+S454oeim7 9dbU1vMh0ftwIjBQoZlflNPwWE9c= X-Gm-Gg: ASbGncsnO/t8ddDHBM6pwTIFjvtnf8tfdVHmKv9rxGytjOCHpzg3pDMSPQSCFxZqPvV yc1rr8kmIOLpRVWL+OmmBkwMy4xieKa9EwzvXQ4HMmW+3uTpd22yoxA76QE5u/hNXyrWsrpIbr7 A= X-Google-Smtp-Source: AGHT+IFhzt2J0AqeR+vIAI7bZz8MxZFOD0m8T0wn4hNryhSisAcfEXygPVO/cJgQ5GIN8SMpY2LtadfxFH0d+fL5HyA= X-Received: by 2002:a05:6402:1ec5:b0:5df:35ff:dc47 with SMTP id 4fb4d7f45d1cf-5e0361c0cd7mr19614345a12.26.1740016385488; Wed, 19 Feb 2025 17:53:05 -0800 (PST) MIME-Version: 1.0 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> In-Reply-To: <20250219185531.1140c3c4@gandalf.local.home> From: Lance Yang Date: Thu, 20 Feb 2025 09:52:29 +0800 X-Gm-Features: AWEUYZkkvsksjNhmabBQW4GXcXWCnpHKpxhhJ7xinS7Xw-NdASDGtQ3beXYnghQ Message-ID: Subject: Re: [PATCH 1/2] hung_task: Show the blocker task if the task is hung on mutex To: Steven Rostedt Cc: "Masami Hiramatsu (Google)" , Waiman Long , Peter Zijlstra , Ingo Molnar , Will Deacon , Andrew Morton , Boqun Feng , Joel Granados , Anna Schumaker , Kent Overstreet , Yongliang Gao , Tomasz Figa , Sergey Senozhatsky , linux-kernel@vger.kernel.org, Linux Memory Management List Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspam-User: X-Stat-Signature: hfrdfdjx8w9ahmpykt1mdgm8d9jg5w1c X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 1E9271C0019 X-HE-Tag: 1740016386-177017 X-HE-Meta: U2FsdGVkX1/O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/QQuHJ6LSlw1eXx77tdmdwZp9f9BpfKktTdAtCq1vwQrlZLrYizXi6Fe6yGD5tr29TQ1tGvUMxbmWJrIPpvp1vwRsoqzrqvBXtnuNcZeva5Q4acqRTHIEI6M8qJtXJH0iBaQCh/fdMBaMQjDcTAsYNirXnM3FvLR/D0GGDic7l3bBMEqNyVG0pu2nbks6XRhRtvo6/a30uQAxtVP5btl5gevTqcAxPsorZs2CDB+EYmtUKDigSW9uT84Jao6hSrZtYP0yhaivm1tOySHPF6Z4ojIyO2ZrbULaGKt5Zi6ay72tslFCnraEHAYYPi1mzYI7EhHHYNTrM7KORyI0Zr5MIKSKLcSWtjmJ7rmCL9JB6VvX2BEa1UBSTIinp9iGcJmoyTEiXla3bB35O8lGx6LO3bwbauhYSfCF8Fvxzh+KlCo= X-Bogosity: Ham, tests=bogofilter, spamicity=0.006210, 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, Feb 20, 2025 at 7:55=E2=80=AFAM 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_loc= k 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 disabl= ed. > > > > > > > But perhaps if we add a new config option for this feature, we coul= d 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 ga= mes > > > > getting the lock owner from the blocked_on field. > > > > > > Yes, it could be a new config option. This will be a useful feature t= hat > > > I believe most distros will turn it on. Or we may just include that i= n > > > 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. Agreed. Making it a separate config option that depends on DETECT_HUNG_TASK sounds like a reasonable approach. It could help us to identify the root cause, but it also adds a bit of extra overhead. Thanks, Lance > > -- Steve