Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1137057lql; Tue, 12 Mar 2024 08:16:29 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWKi7JPLlwFj1/8WVg/ael8sqfgIYiw/kJXxZJ5u5AF9zClvOAC7VbXUS7SJq6uFH+WF3fG4gG56LeFliOv0B72SDBhZoUqwTAPfT1WSA== X-Google-Smtp-Source: AGHT+IEP2tEN1zjp9ZkE6Y0F8zCJf7l+9qZuXvTIxWA08U+W8lLNmEJTC38/g/CVaClPC9dNy7j3 X-Received: by 2002:a17:902:b089:b0:1dd:bf6a:2b97 with SMTP id p9-20020a170902b08900b001ddbf6a2b97mr1064440plr.60.1710256589540; Tue, 12 Mar 2024 08:16:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710256589; cv=pass; d=google.com; s=arc-20160816; b=jh1XwBZViMXdTgLEoIELN92Rw4wNg133Y4w6/duMNTqOG3sDgH5EXdCIZQoQbuzYkX MGLbJK1nsT5biPmeKBRzZz8JfAFqncnKgoFY2bmjmhq6/8tOUg43qRLeuuqHscwy6157 PdBWOvZaC0Yi25LBwBI+b2TQTxXnkMjyV7PAMWhU2u+B3gzd2E5R1FCsm7FBi80IcmmP 7PT9cZ4Y2jfSTIIcAzM+dV9RSVg0uZ6Zjfgmma8haXmPHFG62vzz+E3yFSVxSX/oCMd9 5ySdkN9xl2XQlkA5sUUgP+sZuTr92pSszUtp+v3Uuzed4DlbxXMxGzRWUkMdHkva5L1W wu2w== ARC-Message-Signature: i=2; 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 :subject:cc:to:from:date; bh=sgX2u2dAhtEXbExAAmf9qqcPj5/Q63q08f8xEvpI2zg=; fh=NYA9CalF0w7zML1jt8PPrcllpqOk6Q3F3aHRWciqbYM=; b=nBZcFX8IibdCYWU/CDEeWC7q8Cd5JEZD9fMHIVYiMJRmBuWKF7bAkEi29HgcJmELWx sxLbdXwxO+wAAeBowT5//B3pSD8SpveaHxSUfF0l+u3rdtpn3qKhQ85SdLwufvS/ALqh pt34w54UJOekN+/mWyJdYloSkeoDOIx5Ror0wfiGapRKx2eRHSL7sraipaRYELxy04OZ yoam6Nsu60QVL7wlahDWwDiU7V+EXiRbOJCNbuWf2WnqpoN2mRT7SPJ7qWRtRXcx+/XR H6T5kjxUxGdTVkhxb1ZN7ZGBB1SFfiDCGQpI0osbF1mdm8Wn13g0PFQAD5ME1K0RJB4G o1DQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-100420-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-100420-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id q13-20020a170902eb8d00b001dda3f56957si3395833plg.387.2024.03.12.08.16.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Mar 2024 08:16:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-100420-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-100420-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-100420-linux.lists.archive=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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 3BBC2282FBE for ; Tue, 12 Mar 2024 15:16:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 77F1B7C099; Tue, 12 Mar 2024 15:16:22 +0000 (UTC) Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 026226997A for ; Tue, 12 Mar 2024 15:16:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710256582; cv=none; b=WEpxS+3DBQ7EtbDMV/HNad71t5iTNQKQsJlp9md5Cl43XohQJG54b8TfJHMFUtWWlHGHP75mtbjlEf8w14fWmAQWdeTmYBEb1y3dTMfoS4GluQVjOFDjtAh3Rldc6MBJ3bNYn9TjkCzckFR3BNTDRqEDPlBBT54JtR3EUHCjqi4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710256582; c=relaxed/simple; bh=2tcPIVSB5W57B2YzrkJQ5c17vXSl/d0ZRK/bKySpLsc=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Fk983IqVQVjsshNvb2O+QdfTVS15yXPLJLfIP855cfOSy3cLY3KtHnoOF2MMbFWAPdPij9XQd0JiKowoTmUNm1ZrzVdjeUQVQjMOHHTLRJx6NAlBM0XESfK2EqrfSlA9tq5ejbaPDIfu9jVqyKXQUdmhgGz1Q1B9KZOxhGpIz58= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 65B32C433F1; Tue, 12 Mar 2024 15:16:20 +0000 (UTC) Date: Tue, 12 Mar 2024 11:18:26 -0400 From: Steven Rostedt To: wenyang.linux@foxmail.com Cc: Andrew Morton , Ingo Molnar , Oleg Nesterov , Mathieu Desnoyers , Masami Hiramatsu , Christian Brauner , Mel Gorman , Peter Zijlstra , linux-kernel@vger.kernel.org Subject: Re: [PATCH v3] exit: move trace_sched_process_exit earlier in do_exit() Message-ID: <20240312111826.1b5bec27@gandalf.local.home> In-Reply-To: References: X-Mailer: Claws Mail 3.19.1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Sun, 10 Mar 2024 13:25:29 +0800 wenyang.linux@foxmail.com wrote: > From: Wen Yang > > Currently coredump_task_exit() takes some time to wait for the generation > of the dump file. But if the user-space wants to receive a notification > as soon as possible it maybe inconvenient. > > Move trace_sched_process_exit() earlier in do_exit(). > This way a user-space monitor could detect the exits and > potentially make some preparations in advance. > > Oleg initially proposed this suggestion, and Steven further provided some > detailed suggestions, and Mathieu carefully checked the historical code > and said: > : I've checked with Matthew Khouzam (maintainer of Trace Compass) > : which care about this tracepoint, and we have not identified any > : significant impact of moving it on its model of the scheduler, other > : than slightly changing its timing. > : I've also checked quickly in lttng-analyses and have not found > : any code that care about its specific placement. > : So I would say go ahead and move it earlier in do_exit(), it's > : fine by me. > I'm putting together last minute minor patches for this merge window. I can take this if nobody has any objections. -- Steve > Suggested-by: Oleg Nesterov > Suggested-by: Steven Rostedt > Suggested-by: Mathieu Desnoyers > Signed-off-by: Wen Yang > Cc: Masami Hiramatsu > Cc: Mathieu Desnoyers > Cc: Ingo Molnar > Cc: Andrew Morton > Cc: Christian Brauner > Cc: Mel Gorman > Cc: Peter Zijlstra > Cc: linux-kernel@vger.kernel.org > --- > kernel/exit.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/kernel/exit.c b/kernel/exit.c > index 493647fd7c07..2cff6533cb39 100644 > --- a/kernel/exit.c > +++ b/kernel/exit.c > @@ -826,6 +826,7 @@ void __noreturn do_exit(long code) > > WARN_ON(tsk->plug); > > + trace_sched_process_exit(tsk); > kcov_task_exit(tsk); > kmsan_task_exit(tsk); > > @@ -866,7 +867,6 @@ void __noreturn do_exit(long code) > > if (group_dead) > acct_process(); > - trace_sched_process_exit(tsk); > > exit_sem(tsk); > exit_shm(tsk);