Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp706391pxb; Thu, 21 Apr 2022 08:37:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyZfzWYOZtI1JMwluZMf/jk6wn3rgu522SdlACF1jNiZ4aZbrnKG05Mig6fX5lmcyj/HHtf X-Received: by 2002:a17:907:33cc:b0:6e8:81ca:f9e8 with SMTP id zk12-20020a17090733cc00b006e881caf9e8mr102690ejb.51.1650555462735; Thu, 21 Apr 2022 08:37:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650555462; cv=none; d=google.com; s=arc-20160816; b=zYBiyvrtnbMspAoQeUETFfwYylE+JLz5vdmROsvYPtHX76H80KB43p0jrdwDH0ajfa o/kpFPPj+VKojCgEl1kLPu19m+UZuuxcYH27aF/x69JCbfcPht3ZopfBZCyZgbKqrP6I BT3ZCqv3Ebd7a5mvgR1BkX3F4Ut0s1fC0CIb8S8Rp6PTjo0YMmHrSyf/Eoq5IqHrcsDj VgAsqLl96Z2GsNdLFoPNOQKnP2S/NtGS2vxkcOQxYpNE1J6RDyFwqAfjMoXeB1Dyq3Na sBSTNqMlUqA43Crfv/7O+yHb1y2YkQoodAXRhWuSn4wImvTNzVHdKop1XjcCtLX4RZN0 wMEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=CIL7ig4ne/h1LgZxz8/JxhT2oGMYZ2VjyaHLoNy0IU4=; b=Wlyoov8SeqU8uci0gU3+X1RhkJv8y0YhrSrmAm59pnsq7um3jBCYXRsqRwmpw1u8Tr 1f3QTRNrbwWPKoHOnvrT5OkOTy2VFsvK+bm4E3XOqT/7Du5BMHN8EA7dkBPExUbvYgot n+nJGbM6ZWaKiVlS5KEnUqPJQOVdVlvpqRH+gbWbyV4nB3sisqW+j2N0L5SPVKZom4Fw /tiGz2X+kgQLgOwa8RyyO6NYCIQFSsagM0F3Ol3fyCUDgblMwjyVA3DT1A4lyP+djcSK qzVwwjox07GVjUM9yy+ZgY+V1G8IIJLPvWF5RW0zg15MVRy/d9htahor1dNli7t6Voba OfYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=OcckWkju; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k21-20020a170906971500b006dfad220facsi4087009ejx.474.2022.04.21.08.37.18; Thu, 21 Apr 2022 08:37:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=OcckWkju; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378739AbiDTSG2 (ORCPT + 99 others); Wed, 20 Apr 2022 14:06:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58280 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355250AbiDTSGW (ORCPT ); Wed, 20 Apr 2022 14:06:22 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 03FD347078 for ; Wed, 20 Apr 2022 11:03:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650477815; 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=CIL7ig4ne/h1LgZxz8/JxhT2oGMYZ2VjyaHLoNy0IU4=; b=OcckWkju5hhzK2qA0GCXlSubk9aXmyT/0ERpESlO3wuKqiuE6y+FRqbGvKS+4DXEWMU+j2 Y83I5zQN6djZKPuvMU4A3hqLxfleOXeYvIotXQCJsVseZD9ZhNB+wYYn+Zolqbxgse6UPG ojFfEpWmzeCpPecnhulmiTkAC4pcRSI= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-665-rjH9If2oMhOJ4NqgafTknw-1; Wed, 20 Apr 2022 14:03:29 -0400 X-MC-Unique: rjH9If2oMhOJ4NqgafTknw-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B11D08002BF; Wed, 20 Apr 2022 18:03:28 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.40.192.37]) by smtp.corp.redhat.com (Postfix) with SMTP id 9AEC140D0166; Wed, 20 Apr 2022 18:03:25 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Wed, 20 Apr 2022 20:03:27 +0200 (CEST) Date: Wed, 20 Apr 2022 20:03:23 +0200 From: Oleg Nesterov To: Peter Zijlstra Cc: rjw@rjwysocki.net, mingo@kernel.org, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, mgorman@suse.de, ebiederm@xmission.com, bigeasy@linutronix.de, Will Deacon , linux-kernel@vger.kernel.org, tj@kernel.org, linux-pm@vger.kernel.org Subject: Re: [PATCH 2/5] sched,ptrace: Fix ptrace_check_attach() vs PREEMPT_RT Message-ID: <20220420180323.GA14947@redhat.com> References: <20220413192053.GY2731@worktop.programming.kicks-ass.net> <20220413195612.GC2762@worktop.programming.kicks-ass.net> <20220414115410.GA32752@redhat.com> <20220414183433.GC32752@redhat.com> <20220415101644.GA10421@redhat.com> <20220415105755.GA15217@redhat.com> <20220418170104.GA16199@redhat.com> <20220420131731.GF2731@worktop.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220420131731.GF2731@worktop.programming.kicks-ass.net> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/20, Peter Zijlstra wrote: > > Does something like: > > #define JOBCTL_TRACED_BIT 25 > #define JOBCTL_TRACED_QUIESCE_BIT 26 > > work? Agreed! ;) > > } else { > > /* > > * By the time we got the lock, our tracer went away. > > - * Don't drop the lock yet, another tracer may come. > > - * > > + * Don't drop the lock yet, another tracer may come, > > + * tasklist protects us from ptrace_freeze_traced(). > > + */ > > + __set_current_state(TASK_RUNNING); > > + clear_traced_xxx(); > > + /* > > * If @gstop_done, the ptracer went away between group stop > > * completion and here. During detach, it would have set > > * JOBCTL_STOP_PENDING on us and we'll re-enter > > This is that same else clause again; perhaps make signal_wake_up_state() > also clear TRACED_XXX instead? I swear, I too thought about this after my last email. Yes, I think this makes sense. Thanks, Oleg.