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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4CCFCC46467 for ; Tue, 5 Apr 2022 23:41:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1576499AbiDEXKo (ORCPT ); Tue, 5 Apr 2022 19:10:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43810 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346344AbiDELBP (ORCPT ); Tue, 5 Apr 2022 07:01:15 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B9299BF534 for ; Tue, 5 Apr 2022 03:29:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1649154573; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=azuyYbBlHpqkJWJQXsWi7U/WoYQgOT7FrtBAFayBwow=; b=STUkJONnbXJ5ExnQxc86t8kx3ysKpMUOamUUr3m5xmDmPIsLV8ccoUMAlOh1MEexa1BTB7 I0vGDnhcL16qD5Wx3fW2F73oinR6UQdUogq0YGtTDP9EZcBqYIGdBnORyOwx6UTr6XY7Wt 8XMuPdBcyzWGCSjMdsnKx4ho06kxXIY= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-568-hM6Z0VhTO6uUdfdQSI1g0g-1; Tue, 05 Apr 2022 06:29:30 -0400 X-MC-Unique: hM6Z0VhTO6uUdfdQSI1g0g-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 56FBC3822201; Tue, 5 Apr 2022 10:29:28 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.40.194.75]) by smtp.corp.redhat.com (Postfix) with SMTP id 2D53F112D17B; Tue, 5 Apr 2022 10:29:05 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Tue, 5 Apr 2022 12:29:26 +0200 (CEST) Date: Tue, 5 Apr 2022 12:29:03 +0200 From: Oleg Nesterov To: Peter Zijlstra Cc: Sebastian Andrzej Siewior , linux-kernel@vger.kernel.org, Ben Segall , Daniel Bristot de Oliveira , Dietmar Eggemann , Ingo Molnar , Juri Lelli , Mel Gorman , Steven Rostedt , Thomas Gleixner , Vincent Guittot Subject: Re: [PATCH v2] ptrace: fix ptrace vs tasklist_lock race on PREEMPT_RT. Message-ID: <20220405102849.GA2708@redhat.com> References: <20220314185429.GA30364@redhat.com> <20220315142944.GA22670@redhat.com> <20220405101026.GB34954@worktop.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220405101026.GB34954@worktop.programming.kicks-ass.net> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/05, Peter Zijlstra wrote: > > As is, I think we can write task_is_stopped() like: > > #define task_is_stopped(task) ((task)->jobctl & JOBCTL_STOP_PENDING) > > Because jobctl is in fact the canonical state. Not really. JOBCTL_STOP_PENDING means that the task should stop. And this flag is cleared right before set_special_state(TASK_STOPPED) in do_signal_stop(), see task_participate_group_stop(). Oleg.