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 X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 041D9C2B9F4 for ; Mon, 14 Jun 2021 18:38:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DC3DD610CD for ; Mon, 14 Jun 2021 18:38:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233041AbhFNSk4 (ORCPT ); Mon, 14 Jun 2021 14:40:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54914 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232802AbhFNSkz (ORCPT ); Mon, 14 Jun 2021 14:40:55 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA4E5C061574; Mon, 14 Jun 2021 11:38:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=4tHLuqmgdgsWH9+Oan4cN/C2KwNR0UqEdUEL10Y7OWA=; b=A/q5A9ocg4uEv/akQNc9poVyAA WAdjFOB5BQpqVtcMB6RyDLgtzXUGv2kiTvL6im0d//2rt3l1dpdtfrWVbkb/mJHxHOiqWShhxSc37 6rthibJdTvbUr1jd4BDnHYe7etM+DnqfEKRVE3wv59djWu3wJ0i+c4Ul62fqDQSH4+z32alAbNkZa wd6+ZiIDGTjdkSgR/uxukUHtW3QcXn6BFC0+7BXZz6nFWJTrHq4klMPSAcf6GNLD5PHne8hu5iTWh w8+kMUTRZJHOduBp35oBVBLYqNdUbBeNsj2wPeCFnCiU/y/xJ5VaQbdioReqkyLwnfVnw+vg3RnAx 126qNDqQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=worktop.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94 #2 (Red Hat Linux)) id 1lsrTI-005ij6-6b; Mon, 14 Jun 2021 18:38:12 +0000 Received: by worktop.programming.kicks-ass.net (Postfix, from userid 1000) id C0DEB982D9F; Mon, 14 Jun 2021 20:38:01 +0200 (CEST) Date: Mon, 14 Jun 2021 20:38:01 +0200 From: Peter Zijlstra To: Oleg Nesterov Cc: rjw@rjwysocki.net, mingo@kernel.org, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, mgorman@suse.de, Will Deacon , Tejun Heo , linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Subject: Re: [PATCH] freezer,sched: Rewrite core freezer logic Message-ID: <20210614183801.GE68749@worktop.programming.kicks-ass.net> References: <20210614154246.GB13677@redhat.com> <20210614161221.GC68749@worktop.programming.kicks-ass.net> <20210614165422.GC13677@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210614165422.GC13677@redhat.com> Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org On Mon, Jun 14, 2021 at 06:54:23PM +0200, Oleg Nesterov wrote: > On 06/14, Peter Zijlstra wrote: > > > I guess you do this to avoid freezable_schedule() in ptrace/signal_stop, > > > and we can't use TASK_STOPPED|TASK_FREEZABLE, it should not run after > > > thaw()... But see above, we can't rely on __frozen(parent). > > > > I do this because freezing puts a task in TASK_FROZEN, and that cannot > > preserve TAKS_STOPPED or TASK_TRACED without being subject to wakups > > Yes, yes, this is what I tried to say. OK, thanks for all that. Clearly I need to stare at this code longer and harder. One more thing; if I add additional state bits to preserve __TASK_{TRACED,STOPPED}, then I need to figure out at thaw time if we've missed a wakeup or not. Do we have sufficient state for that? If so, don't we then also not have sufficient state to tell if a task should've been TRACED/STOPPED in the first place? If not, I probably should add this... I'll go dig.