Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp757786ybl; Wed, 4 Dec 2019 10:21:03 -0800 (PST) X-Google-Smtp-Source: APXvYqz5bzGr/SwlKcH25GwAmOQ9+eQGjPa7gNC2zLf9Qfa9oJjO+7S/3E+3IM3IZCPUa7Qbt8cI X-Received: by 2002:aca:4a08:: with SMTP id x8mr3882266oia.39.1575483663511; Wed, 04 Dec 2019 10:21:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575483663; cv=none; d=google.com; s=arc-20160816; b=mBEEZwoC9tTH/lRgPdJ7xWUGbHorbVE6wAf8dF2XzVv13bXqPs7xyU5qS3d4mEqpAF tj11KBnYg2sw2TnG2NwL5aMrcotu20wyAUPZeAY3tFm/YibX1pbTnfUb2zQSWD/KEyBS JM/Dl5sb1l6wBSX+beMJMgEbkDCl272l8JxnJJ1o0rvlxcmiilMLoPAcIhEo6Y+8bEZ8 ilK3KPsiwN7Y0lMVOw8mUhe1tbSL+4QoEVE57qZyllc6mXgIknZjx1GAGqcWISxmyFqI 6CFS75BAvwP1a3d03P3JxuGfiIG+fJN1/LELlPtDF88Os8oGgeJkY6S/uSp4OiO1IU7h MgRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=TO3M4JRDwYEQYalzC1JJGfXlWb3K9ShCnnIC37XGBvg=; b=Lwa6XMrVMM6TvU2dud0jxqMVTSyNr4Rlb/aLhmv8KfElBR5piITfy75fTZDDA/HjvN HYEJek2HQ/3uu+TbQRBvC8iK2AVpNWxRWGcjdj122LscGzQdjFau9RmRJ/YRfIgpIgyn rx7iowLP9vvKo3u59tblgAWEBzTB7sGMp5ZdqKKDqmNpvWjTh6dbZ/2KSF8iOcfpE6+9 uH9qXLGsvBqWOgr2GmhniNCzHj42dv1Q45DZTf8AhNNwhIV9xLioacnZlnWhw2JuOFwD c2YtZHjXirQpVUPfBORmSPEbw4lCpyqWkzvcbp+p4vNHIVb1JF+lCtmbDhq8PixsbOLW QUEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JdRLHNFl; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z6si3666915oic.18.2019.12.04.10.20.51; Wed, 04 Dec 2019 10:21:03 -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=pass header.i=@linaro.org header.s=google header.b=JdRLHNFl; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730971AbfLDSTo (ORCPT + 99 others); Wed, 4 Dec 2019 13:19:44 -0500 Received: from mail-lj1-f195.google.com ([209.85.208.195]:33140 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728482AbfLDSTm (ORCPT ); Wed, 4 Dec 2019 13:19:42 -0500 Received: by mail-lj1-f195.google.com with SMTP id 21so441833ljr.0 for ; Wed, 04 Dec 2019 10:19:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=TO3M4JRDwYEQYalzC1JJGfXlWb3K9ShCnnIC37XGBvg=; b=JdRLHNFl/zP5IdAJrHumL9k5kT+8N/SXMgaszfW6wKBo84jtVsc8GDMDEnHdUfzsxb UH5/xrbFYWjsnujb1VgNV0ifwdAa6m2rUr/VbbeTKuNW4BHdAB17wKII+KD6isEytVz9 8kEgho3g4wpnYqC27M7LDRh8voiRk1Fr197UjvGqnmez4aSHveJEcfdpWGs4ON0Kb58l TPd/YkqWWyCAHUvV5oZqSTPSe4c20GL8w5run9Fva+GzuNglr8j/ZmchkzY5PT9zY4le EKDlDTR/jCYBd92gms9jcyKKt3MPmcpzYfYz25tbx2QBYpR3qsI/DNV9BYYPR+kf4+gG D2TQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=TO3M4JRDwYEQYalzC1JJGfXlWb3K9ShCnnIC37XGBvg=; b=eFceCEEcKDk31XPZB9pzxAfByFDxzcDbVvfwmiE79m+Gfk0jmb7cgXRemmzcn4jQGG PKxW3hfcQW+Wrzqz32mJzKAkG50Zd1hpx6CQbBdnewRo5d+eobdOddM/KWZwFCbs6ybZ TGvAa6LJ2S/5am3WWA7izWmViPrCUcLQMbu6AVTAShAWyV/DPBUhTuUTydAr7wnwxW9y dhrrYRVnZ7GPLVWPSoQrRMCWD4kcs1XuOShsiZCtM86RVF/+NrDiQAVfbKlNSMBzxOg7 QQQdj0KTXZ6vrPMVhO1TLIP8Ay5NmWOGODEhwmn/zhoK787opfK4X2GiUj0tF6XSxiiq za0w== X-Gm-Message-State: APjAAAXxt1cx4+7IcbaGJgDHVDChPJ4FxOaxF9pr50iA5bk01Jp31EMU XC2vPU89JjHeVwhX5UvFclXpiLIpMNDIuGquxxVvSA== X-Received: by 2002:a05:651c:239:: with SMTP id z25mr510830ljn.48.1575483580174; Wed, 04 Dec 2019 10:19:40 -0800 (PST) MIME-Version: 1.0 References: <20191204094216.u7yld5r3zelp22lf@e107158-lin.cambridge.arm.com> <20191204100925.GA15727@linaro.org> In-Reply-To: From: Vincent Guittot Date: Wed, 4 Dec 2019 19:19:26 +0100 Message-ID: Subject: Re: Null pointer crash at find_idlest_group on db845c w/ linus/master To: John Stultz Cc: Qais Yousef , Quentin Perret , Peter Zijlstra , Dietmar Eggemann , Juri Lelli , Valentin Schneider , Patrick Bellasi , Ingo Molnar , lkml Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 4 Dec 2019 at 19:16, John Stultz wrote: > > On Wed, Dec 4, 2019 at 2:09 AM Vincent Guittot > wrote: > > > > Le Wednesday 04 Dec 2019 =C3=A0 09:42:17 (+0000), Qais Yousef a =C3=A9c= rit : > > > On 12/04/19 09:06, Vincent Guittot wrote: > > > > Hi John, > > > > > > > > On Tue, 3 Dec 2019 at 20:15, John Stultz w= rote: > > > > > > > > > > With today's linus/master on db845c running android, I'm able to > > > > > fairly easily reproduce the following crash. I've not had a chanc= e to > > > > > bisect it yet, but I'm suspecting its connected to Vincent's rece= nt > > > > > rework. > > > > > > > > Does the crash happen randomly or after a specific action ? > > > > I have a db845 so I can try to reproduce it locally. > > > > > > Isn't there a chance we use local_sgs without initializing it in that= function? > > > > Normally not because the cpu belongs to its sched_domain > > > > Now, we test that a group has at least one allowed CPU for the task so = we > > could skip the local group with the correct/wrong p->cpus_ptr > > > > The path is used for fork/exec ibut also for wakeup path for b.L when t= he task doesn't fit in the CPUs > > > > So we can probably imagine a scenario where we change task affinity whi= le > > sleeping. If the wakeup happens on a CPU that belongs to the group that= is not > > allowed, we can imagine that we skip the local_group > > > > John, > > > > Could you try the fix below ? > > > > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c > > index 08a233e..bcd216d 100644 > > --- a/kernel/sched/fair.c > > +++ b/kernel/sched/fair.c > > @@ -8417,6 +8417,10 @@ find_idlest_group(struct sched_domain *sd, struc= t task_struct *p, > > if (!idlest) > > return NULL; > > > > + /* The local group has been skipped because of cpu affinity */ > > + if (!local) > > + return idlest; > > + > > /* > > * If the local group is idler than the selected idlest group > > * don't try and push the task. > > This patch does seem to solve the issue for me! Thanks so much! Thanks for testing > > Tested-by: John Stultz > -john