Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp965075pxb; Fri, 22 Apr 2022 15:28:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwjs9e+iOkirK9mDqIO2oAV7F5TeQEzKDLax7l/1sbh9i9hs7UqchxX79IxtBwXRemV79+R X-Received: by 2002:a63:5564:0:b0:399:1d7c:80a1 with SMTP id f36-20020a635564000000b003991d7c80a1mr5578840pgm.203.1650666525907; Fri, 22 Apr 2022 15:28:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650666525; cv=none; d=google.com; s=arc-20160816; b=hPWW3UeOBOO+0PsZ+xwdce9tKmkmeDhtXnqLoqeIZs/rc2hADJVeuRcKdXpBDBsA6m M+y4mJZ+y+mvcsbUMa7JTQbatyI6Elb7zEd6UDPU2JUY/cxcbyPC8F20atxZPJoMMWpm UgyBJ1x4hs6LI96wFU8LU7ECJewB5M1CTabCwumnsWh0Bvfe34qnc7tHDcdBKFPYq0pZ UKnCkiUxn7+kdVuDRJ0+dbqy6ec7ZNb/3AYRSGbyFk49CogttO9Udc6r6NSFMmcqTgu3 CcQctkRn5eOopnRu19mloGzUzlqKDBDQRCOIxczla4zz6Djg/cZ8u7znDQRLso7/onz9 lvfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:dkim-signature :dkim-signature:date; bh=r35IzhDbN3FW/BuR5UEyJUUkP1Dog8UZeCh3xRNziMg=; b=aR5NplNzSTBKV/kSF42BZAP2y+FrvEPFmnHG1gWRlnmr1e0Z0gS1TwoexQ92gVJKcy pCwCma6dGURq0nJyUoztvf/pC947LLbpyKoUHq4gleBKCNK13ldVJWpRMt6Y2ZhLb0Xd opW6PiqA1FMxcdqBqSCNLE+cRtNzYNfp8on4wNd4H3xFlIgDrf7FW6qN0ZaG6WOoG7/F dDz4WIXlzQ3H4eIBGkSOLkjXOZly4qn9/qTeiATvU6/Bhqz49gEs8/gbUt4KFcjKOpap 8Ibvw1maGdiDmct8zeYsJ2hM7eOavFqbayAVIOvxQWY+ZhxlX1SomYxr74Kt1oFegmHp Y2VQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=o7hPQh1e; dkim=neutral (no key) header.i=@linutronix.de; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id s1-20020a632c01000000b003a36cabcc43si9440746pgs.40.2022.04.22.15.28.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Apr 2022 15:28:45 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=o7hPQh1e; dkim=neutral (no key) header.i=@linutronix.de; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id DE5883F3D12; Fri, 22 Apr 2022 13:35:55 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232063AbiDVRtF (ORCPT + 99 others); Fri, 22 Apr 2022 13:49:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58322 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231362AbiDVRsx (ORCPT ); Fri, 22 Apr 2022 13:48:53 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC3FB2B270; Fri, 22 Apr 2022 10:45:18 -0700 (PDT) Date: Fri, 22 Apr 2022 19:43:18 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1650649400; 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=r35IzhDbN3FW/BuR5UEyJUUkP1Dog8UZeCh3xRNziMg=; b=o7hPQh1ekabXuESidnVM7vcbehFyiWRLFfN4L9HXX6h7DshXLvAfWCCeACLXfpeWcjuuYV haAr6oP01wZcB63goOW2UE3Sup5+qV9YHlu+jX4cvh+MCRSTSmasbLP1l9Xl/yFb29Ptnz d7o3gRtW+svZf+m8ehZghlfIgUHnrUNe7RT8dNJIOCiBHVFeYs+RlP6lGAyiBowVsHLh3a ZTuuLhrFFrKTV/hCSs0NQRvJ8gMm0Wzb0qN+U5QTm/J0RRdla7GyS4AGL6pXFm1Fqcx1YN 6Zn17Bfx7k8kNlGYiQNKrUTI37Zcv6o0rfp+SaXh0B+AKWoxPDqOrmoEcJdeMA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1650649400; 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=r35IzhDbN3FW/BuR5UEyJUUkP1Dog8UZeCh3xRNziMg=; b=HnnVKkPms88wJwa/dhy+NNgkI7KZgDrhI59dCGrQ+kdQdKtLIaKSlNQxkMaIpL1Coh3TuO 8FQ7v37KOyfh30Cg== From: Sebastian Andrzej Siewior To: Peter Zijlstra Cc: rjw@rjwysocki.net, oleg@redhat.com, mingo@kernel.org, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, mgorman@suse.de, ebiederm@xmission.com, Will Deacon , linux-kernel@vger.kernel.org, tj@kernel.org, linux-pm@vger.kernel.org Subject: Re: [PATCH v2 0/5] ptrace-vs-PREEMPT_RT and freezer rewrite Message-ID: References: <20220421150248.667412396@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20220421150248.667412396@infradead.org> X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE autolearn=no 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 2022-04-21 17:02:48 [+0200], Peter Zijlstra wrote: > Find here a new posting of the ptrace and freezer patches :-) > > The majority of the changes are in patch 2, which with much feedback from Oleg > and Eric has changed lots. > > I'm hoping we're converging on something agreeable. I tested this under RT (had to remove the preempt-disable section in ptrace_stop()) with ssdd [0]. It forks a few tasks and then PTRACE_SINGLESTEPs them for a few iterations. The following failures were reported by that tool: | forktest#27/3790: EXITING, ERROR: wait on PTRACE_ATTACH saw a SIGCHLD count of 0, should be 1 | forktest#225/40029: EXITING, ERROR: wait on PTRACE_SINGLESTEP #22241: no SIGCHLD seen (signal count == 0), signo 5 very rarely. Then I managed to figure out that the latter error triggers if I compile something large with a RT priority. Sadly it also happens with my old ptrace hack (but I just noticed it). It didn't happen with without RT (just the 5 patches applied). I also managed to trigger this backtrace with RT: |WARNING: CPU: 1 PID: 3748 at kernel/signal.c:2237 ptrace_stop+0x356/0x370 |Modules linked in: |CPU: 1 PID: 3748 Comm: ssdd Not tainted 5.18.0-rc3-rt1+ #1 |Hardware name: Intel Corporation S2600CP/S2600CP, BIOS SE5C600.86B.02.03.0003.041920141333 04/19/2014 |RIP: 0010:ptrace_stop+0x356/0x370 |RSP: 0000:ffffc9000d277d98 EFLAGS: 00010246 |RAX: ffff888116d1e100 RBX: ffff888116d1e100 RCX: 0000000000000001 |RDX: 0000000000000001 RSI: 000000000000002e RDI: ffffffff822bdcc3 |RBP: ffff888116d1e100 R08: ffff88811ca99870 R09: 0000000000000001 |R10: ffff88811ca99910 R11: ffff88852ade2680 R12: ffffc9000d277e90 |R13: 0000000000000004 R14: ffff888116d1ed48 R15: 0000000000000000 |FS: 00007f0afdad4580(0000) GS:ffff88852aa40000(0000) knlGS:0000000000000000 |CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 |CR2: 00007f0afdad4508 CR3: 0000000558198006 CR4: 00000000000606e0 |Call Trace: | | get_signal+0x553/0x870 | arch_do_signal_or_restart+0x31/0x7b0 | exit_to_user_mode_prepare+0xe4/0x110 | irqentry_exit_to_user_mode+0x5/0x20 | noist_exc_debug+0xe0/0x120 | asm_exc_debug+0x2b/0x30 |RSP: 002b:00007fffae964b70 EFLAGS: 00000346 |RAX: 0000000000000000 RBX: 00000000000000fc RCX: 00007f0afd9c0d35 |RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000001 |RBP: 00007fffae964e38 R08: 0000000000000000 R09: 00007fffae962a82 |R10: 00007f0afdad4850 R11: 0000000000000246 R12: 0000000000000000 |R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 | which is the WARN_ON_ONCE() in clear_traced_quiesce(). [0] https://git.kernel.org/pub/scm/utils/rt-tests/rt-tests.git/tree/src/ssdd/ssdd.c Sebastian