Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp1415016ybx; Thu, 7 Nov 2019 11:33:24 -0800 (PST) X-Google-Smtp-Source: APXvYqwClQQLSjeTb/7L4pXzSWAI/FlcwdWaT4nk+MvpmAqsQoLY/WGIpEhopaBvYzNsGaj70wne X-Received: by 2002:a17:906:da1d:: with SMTP id fi29mr3952100ejb.26.1573155204253; Thu, 07 Nov 2019 11:33:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573155204; cv=none; d=google.com; s=arc-20160816; b=WSO+AjfuigXNNN/Q0PyUGxn/Dh8NYpdU7biYDm/9ph+2ZtjQBTnzXchx620fX/biXJ 7bTQG29rtI9UIAtqEfaZvry6dB9vIdVzG3cpGXyceZtAv6GAv6Po0ufAg5klDBfbLRdX AGr+ruzFK5x0gJGCDR81zn+ErmHGjVxLQqDoyRkUOzuR/e1OW2M+jWmktyBG4dw4r0qI 43kvD5yXoPAD9uhAk3J0Kll4GiUXHlAqUvRshVsgJRMhechDAPS6GBSmB6CHPhjP6Pp8 V1GzCDsq/MwR7cdxro6LTcT9dFFfS/kDp36wPMkFXr8HP/BdYp8ATCUeCQFu4laLFS5I sUuw== 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-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=mQxP0NlH0MuR5NgfBa7ZCQQ8PQRRveWOV37ydOHPvRw=; b=qdbqiDCV+wJ7R0u86g3qhm3ALajiD6Y4J5qAf30i6m7m0wTPa6T+J4tWrEPrv+nziJ e0FwjH0QTlnOQIJ02t2+woGDjYLfGHCJ/DdpN6pK7F0KxR7Q/8Jn07l8whi8304R9+DB KQCFGV9r+FZjAS0aqC0pAPEOEq1CFoFTr07gBZg77e/dRkFkcYZHnVISsj3GDGTvYR2n BXeXQ5L6k9nYIddCSO9hy0HGIwb/10R9a2fEUfl/GKWD+Nc9dRyKqNGyT1fNwV56AEra 7WFwFpqWFSFhQaztPnbmQexABVHszJclpfMl7gCy1mxQJC2j5AynJahSTGcw1pEagKe7 zH5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=VXy6MZot; 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 v4si2326071edm.299.2019.11.07.11.33.00; Thu, 07 Nov 2019 11:33:24 -0800 (PST) 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; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=VXy6MZot; 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 S1726282AbfKGTcA (ORCPT + 99 others); Thu, 7 Nov 2019 14:32:00 -0500 Received: from merlin.infradead.org ([205.233.59.134]:36356 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725785AbfKGTcA (ORCPT ); Thu, 7 Nov 2019 14:32:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.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:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=mQxP0NlH0MuR5NgfBa7ZCQQ8PQRRveWOV37ydOHPvRw=; b=VXy6MZotTpf66qPz/dBlVidRi 9xFpSlqueLKA1mQXklQszdCmr3x+2uuDXpl9697ql4kmJhqWLBj4h+yeTGiec9tAHurB3gbAZ12TP pyjm1XPs0m8QuvgVrKzvRfEBHmabBd5SFYtBJjVGppjmvdxKERSGn+ZT5O6lYBZl/x+t6ItOaOxq5 XzS/s4gMmj5ygv5KEsPGs25H6VYx7BfHZoMYcPzp9YCIIm6GQHb+5cNbbNRxF46sNTqORSiB3kFsP NiWnM3T/VJ1ZCbuxsu199qFIBGB7LgP6uJp9Zbx0WyfDC3rCR3/X34YqcXw6RcPZBXJpICsTn1Cka 5eJLwEhbw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=worktop.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1iSnVJ-0007Lr-NN; Thu, 07 Nov 2019 19:31:38 +0000 Received: by worktop.programming.kicks-ass.net (Postfix, from userid 1000) id D198E980E2D; Thu, 7 Nov 2019 20:31:34 +0100 (CET) Date: Thu, 7 Nov 2019 20:31:34 +0100 From: Peter Zijlstra To: Quentin Perret Cc: Kirill Tkhai , linux-kernel@vger.kernel.org, aaron.lwe@gmail.com, valentin.schneider@arm.com, mingo@kernel.org, pauld@redhat.com, jdesfossez@digitalocean.com, naravamudan@digitalocean.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, juri.lelli@redhat.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, kernel-team@android.com, john.stultz@linaro.org Subject: Re: NULL pointer dereference in pick_next_task_fair Message-ID: <20191107193134.GJ3079@worktop.programming.kicks-ass.net> References: <20191028174603.GA246917@google.com> <20191106120525.GX4131@hirez.programming.kicks-ass.net> <33643a5b-1b83-8605-2347-acd1aea04f93@virtuozzo.com> <20191106165437.GX4114@hirez.programming.kicks-ass.net> <20191106172737.GM5671@hirez.programming.kicks-ass.net> <831c2cd4-40a4-31b2-c0aa-b5f579e770d6@virtuozzo.com> <20191107132628.GZ4114@hirez.programming.kicks-ass.net> <20191107153848.GA31774@google.com> <20191107184356.GF4114@hirez.programming.kicks-ass.net> <20191107192753.GA55494@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191107192753.GA55494@google.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 07, 2019 at 07:27:53PM +0000, Quentin Perret wrote: > On Thursday 07 Nov 2019 at 19:43:56 (+0100), Peter Zijlstra wrote: > > But you mean something like: > > > > for (class = prev->sched_class; class; class = class->next) { > > if (class->balance(rq, rf)) > > break; > > } > > > > put_prev_task(rq, prev); > > > > for_each_class(class) { > > p = class->pick_next_task(rq); > > if (p) > > return p; > > } > > > > BUG(); > > > > like? > > Right, something like that, though what I had was basically doing the > pull from within the pick_next_task_*() functions directly, like we were > doing before. I'm now seeing how easy it is to get this wrong, and that > even good-looking code in this area can be broken in very subtle ways, > so I didn't feel comfortable refactoring again so close to rc7. If you > feel more confident, I'm more than happy to test a patch implemeting the > above :) Thing is, if we revert (and we might have to), we'll have to revert more than just the one patch due to that other (__pick_migrate_task) borkage that got reported today.