Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp822959ybx; Wed, 6 Nov 2019 08:57:11 -0800 (PST) X-Google-Smtp-Source: APXvYqwDeKqYU+reGCBAYh9tI++KQVCCoFN8lg/dZVzQONpgxHTV7Jgmc5UNr/zWpNNK2ew4lC0g X-Received: by 2002:a17:906:1505:: with SMTP id b5mr36288144ejd.195.1573059431425; Wed, 06 Nov 2019 08:57:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573059431; cv=none; d=google.com; s=arc-20160816; b=V1q32K5X8o+ESqt1POFxISIf09F2XEogyJY7Dc9o0kxQY2yigoxuz2e4ORqsbj0Oel GL03Pl2bPXRXKJ60H/OBt8CqalBWQsFHsxZg4cr+hFQtvcheskalNKJ2+GuQOb4Vq9Jk yI3HC81T9O1b4wi/cs7BF4q7muVXiBGWe5kVZ+Z/qJbm5wzTydPrYXHiy3CzmhUmBIlz 8tj8ulibbtklCOOGD/hxEj9IxElImDa3TSTEOH+TLVh+g85vxrTTTTsohzgZrvu1vvh8 B7Dx+18G8gWjFq1tvuctF2lqx7WxYi/XJC291SzNnd5dfNmOQlJVrpXe5mU6IbIym270 k45Q== 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=TqFiX/TxrEBMTuixkbn/nkca9tyWxgwszGYJJ1sXL28=; b=OltZpE0dRvVhrFoSgPOIzl9wPYjvYXU5Jbb2+uifp77EkFexk1/MRypUBvPxbGZtSB 3CXGxjD9dsw4DXlNvHSqFxiJrv7FJv0RsIfpr6hl1SA9GPBt177dixlzVK8fGsUHeqGh VzMgPDSUOLGE1muSodcfPOzYOR1NZX5jzK9+1eaYCK0oTY6P99J77A4KDn2V1Gq0l6ol R5LSvRY7EGCbjkqcKxboUsMgvHGj8+EJjvdze+ofAZ5kMmWNuhw2TCk9lKRHFZT+1KR5 bOYhvch63VEcPmEZzOnn5QNTitcufuMLEp2TJWwOtNl/wSGi36umqBwimxZtfxsDcK5x ahug== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=jbKtM3Te; 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 r12si17625486edi.272.2019.11.06.08.56.46; Wed, 06 Nov 2019 08:57:11 -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=bombadil.20170209 header.b=jbKtM3Te; 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 S1732172AbfKFQyx (ORCPT + 99 others); Wed, 6 Nov 2019 11:54:53 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:43380 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727894AbfKFQyx (ORCPT ); Wed, 6 Nov 2019 11:54:53 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.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=TqFiX/TxrEBMTuixkbn/nkca9tyWxgwszGYJJ1sXL28=; b=jbKtM3TeVTPE+bUGcnH546tTM 1eQe+mbjhaiYqn6i13+odDl03kTEil1OszifDPkmh6e+9y5PI7BWus/4vgov7K2GM/DqAEDrDSQji PS81nA8H14dUCXlMSMqD1K2MJ/Nhdcz539fLOxiBkCWEM0eDY+UydhAc6wg58dbJ6rHAa5BimU514 0mYrD1Xx9Yljt0fWLx85staoIYStJ+z74rOJ8LkQiENvobS0Y8VgRs2zyK27mJPo7CIB+elSuXRJ4 GrumUiSptQmLaa2Wk8QX/BgtVJR6VrpxTTxaGjBiJLH21R/27Dl94bG0SyZYzU+A6uOPOD5Gx7wBd cqqD2ai0A==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1iSOZv-0008J4-Jb; Wed, 06 Nov 2019 16:54:43 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 2A2B4302C0F; Wed, 6 Nov 2019 17:53:33 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 451552025EDA7; Wed, 6 Nov 2019 17:54:37 +0100 (CET) Date: Wed, 6 Nov 2019 17:54:37 +0100 From: Peter Zijlstra To: Kirill Tkhai Cc: Quentin Perret , 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: Re: NULL pointer dereference in pick_next_task_fair Message-ID: <20191106165437.GX4114@hirez.programming.kicks-ass.net> References: <20191028174603.GA246917@google.com> <20191106120525.GX4131@hirez.programming.kicks-ass.net> <33643a5b-1b83-8605-2347-acd1aea04f93@virtuozzo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <33643a5b-1b83-8605-2347-acd1aea04f93@virtuozzo.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 Wed, Nov 06, 2019 at 06:51:40PM +0300, Kirill Tkhai wrote: > > +#ifdef CONFIG_SMP > > + if (!rq->nr_running) { > > + /* > > + * Make sure task_on_rq_curr() fails, such that we don't do > > + * put_prev_task() + set_next_task() on this task again. > > + */ > > + prev->on_cpu = 2; > > newidle_balance(rq, rf); > > Shouldn't we restore prev->on_cpu = 1 after newidle_balance()? Can't prev > become pickable again after newidle_balance() releases rq->lock, and we > take it again, so this on_cpu == 2 never will be cleared? Indeed so.