Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp1742225ybn; Thu, 26 Sep 2019 01:17:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqwBRWgBRf/ADg+uWZE2TbOn5PteE+KqRp+hH8VX28SJtJGEQ+68gIGld1GY6Ou1C94SejRi X-Received: by 2002:aa7:dc4b:: with SMTP id g11mr2280742edu.70.1569485875895; Thu, 26 Sep 2019 01:17:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569485875; cv=none; d=google.com; s=arc-20160816; b=hy8ZKQlpLgjFQtdgVNp2BNbRnYG8kXOr9YpfjvmI9oEFz1HPCiBIuyvk93jDM5A717 d2ItN/tDPA8SgUUVWFRP+arKpCN+Z1BqrJQjS8ofPmzifDiBnySlCFie202wfNPC71j5 ni3BwTl8f8I9sP20TSjy+L7fqcRoMxinMVFFeRv2X7EoSm8lZyyeGXdw1s2fqIcUeh6Y vbRmXS6dB7JrWt43NLyqVVgzE6jNbVGef3G/MDc/OrgVPrsOI2VMvN7sLZv3IKTLq2kg gL8J0sZdFMy41tNLc6qP4jdBuS0/ly91vZt3FkD+hyKQs5Sr2xNHelxzE2ZsIh55zSs4 GxKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=VqMPseeQpv7yTJ78KiP0hTw7pePU+lHX1PRF9rFrnMM=; b=D1VaXy8fE+W/Tb0ntaiLrma7BuC7tSOenEVms1OwZ06XJE2J9fNN09h+r6Xokay3+y BQZwfkOJ+JRx7SupOiD6NTAFCg2Tjgo1cQnSqocRhaPdAQozH79OCqZHTtotMiSwmStE nJDeL2jGYgDTFQacbQs0DwaxVCVOtmQYRiOQrwG40QXA5sgqbq7b+CxyB2Hl/udNb4iv cHNDKNTZ8BoOhVzw9JDxMOQuXZIUsC5UsUpO1OQ9sndjOfZmtuy5o9EY7yLH2oY942iC B0bIYMnFFCSAiCSR2bxkYkkcg7s/MJF2QMs6yKgcUKEu639a4v2s4GptQdvOxzK+lHqS VGeQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i17si621043ejc.233.2019.09.26.01.17.32; Thu, 26 Sep 2019 01:17:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389278AbfIXPZU convert rfc822-to-8bit (ORCPT + 99 others); Tue, 24 Sep 2019 11:25:20 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:34624 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728107AbfIXPZT (ORCPT ); Tue, 24 Sep 2019 11:25:19 -0400 Received: from bigeasy by Galois.linutronix.de with local (Exim 4.80) (envelope-from ) id 1iCmgk-00055P-JX; Tue, 24 Sep 2019 17:25:14 +0200 Date: Tue, 24 Sep 2019 17:25:14 +0200 From: Sebastian Andrzej Siewior To: Scott Wood Cc: linux-rt-users@vger.kernel.org, linux-kernel@vger.kernel.org, "Paul E . McKenney" , Joel Fernandes , Thomas Gleixner , Steven Rostedt , Peter Zijlstra , Juri Lelli , Clark Williams Subject: Re: [PATCH RT v3 3/5] sched: migrate_dis/enable: Use rt_invol_sleep Message-ID: <20190924152514.enzeuoo5a6o3mgqu@linutronix.de> References: <20190911165729.11178-1-swood@redhat.com> <20190911165729.11178-4-swood@redhat.com> <20190917075943.qsaakyent4dxjkq4@linutronix.de> <779eddcc937941e65659a11b1867c6623a2c8890.camel@redhat.com> <404575720cf24765e66020f15ce75352f08a0ddb.camel@redhat.com> <20190923175233.yub32stn3xcwkaml@linutronix.de> <20190924112155.rxeyksetgqmer3pg@linutronix.de> <55dc19fcc44b2e658b71f68206306c8310335564.camel@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8BIT In-Reply-To: <55dc19fcc44b2e658b71f68206306c8310335564.camel@redhat.com> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019-09-24 08:53:43 [-0500], Scott Wood wrote: > As I pointed out in the "[PATCH RT 6/8] sched: migrate_enable: Set state to > TASK_RUNNING" discussion, we can get here inside the rtmutex code (e.g. from > debug_rt_mutex_print_deadlock) where saved_state is already holding > something -- plus, the waker won't have WF_LOCK_SLEEPER and therefore > saved_state will get cleared anyway. So let me drop the saved_state pieces and get back to it once I get to the other thread (which you replied and I didn't realised until now). Regarding the WF_LOCK_SLEEPER part. I think this works as expected. Imagine: CPU0 CPU1 spin_lock(); set_current_state(TASK_UNINTERRUPTIBLE); … spin_unlock() -> migrate_enable(); -> stop_one_cpu(); <-- A) other_func(); <-- B) schedule(); So. With only CPU0 we enter schedule() with TASK_UNINTERRUPTIBLE because the state gets preserved with the change I added (which is expected). If CPU1 sends a wake_up() at A) then the saved_state gets overwritten and we enter schedule() with TASK_RUNNING. Same happens if it is sent at B) point which is outside of any migrate/spin lock related code. Was this clear or did I miss the point? > -Scott Sebastian