Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp364483ybl; Wed, 4 Dec 2019 04:10:00 -0800 (PST) X-Google-Smtp-Source: APXvYqxS5wPQ9zLfRBVI/aPBY2cQbRzDO6UAvr9THAMk4BMqI4THa1EIxU/9JmWVhu1YacsuRrhB X-Received: by 2002:aca:d507:: with SMTP id m7mr2144461oig.48.1575461400043; Wed, 04 Dec 2019 04:10:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575461400; cv=none; d=google.com; s=arc-20160816; b=SHYOMjfxdVlfbCqY45xEUOHwjaygeo7WDaJsb7bkQlyUR9Lycn2Pk3BOEe0xoJbuth Wns2D/MKzhMji04SE4mQeWuQrQp64q3KHsjO7Wpxp3fqYgTiuEuXVzRHZRhhqfBo6+xM nhU+Q2F/kh6aZ1TESm5RFKRm9j+1CEVybkHya8edbNvu+mjfbiRWRzRwizs4dN2YIGds BcLk1y4/jm4GEJHSYvlggB3qMxHH5NeJv3VPlXmw88Qb7pcMy3oInoGtVKu6vEMXl/s9 l9VmcdqP8jLqvYPZPkWSjmL2I2ENJjes7WYC45lAqlVNvnMGtykE18AV9JH5/519n4zz HDwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=n53lGt+YzNiyRiDyZo76uBdQF7IlqBjHXPOJ4vHrqxM=; b=f6/mhooeE3509lZtSq/FlHthYome8uKwH4iJeH+8hbXqOA3P+hJC0OE8X0I3nTLAyT vtJ3DOMcrb/BakMsyvkBZOrJeZKTx7HAwy14CdqrdNWCNyB6/0yzFotOuqkmbztGpasQ U1OmMCM8a6iC+NzjCZixrdVvtPYZI6iYz8NdrVYQmtNHrW3yUXjZBeXhlUN8LJrYNPf/ LT1by3KgfFPDxnFvFXmd1tgg9HP8rqjIsSM/zbZcPrTo1JSk9y0a7e1YS2TT8Y3p7ELg gVRcw4olgOgrYsHdAmFAsFVTfjIOpOVIEpKOgBw5ryfvIvCwOpp2G81i0bu1bFYevQ9t Icjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vFaMtUKt; 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 l131si3114117oig.120.2019.12.04.04.09.47; Wed, 04 Dec 2019 04:10:00 -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=vFaMtUKt; 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 S1727766AbfLDMIQ (ORCPT + 99 others); Wed, 4 Dec 2019 07:08:16 -0500 Received: from mail-lj1-f195.google.com ([209.85.208.195]:33024 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727469AbfLDMIQ (ORCPT ); Wed, 4 Dec 2019 07:08:16 -0500 Received: by mail-lj1-f195.google.com with SMTP id 21so7845087ljr.0 for ; Wed, 04 Dec 2019 04:08:14 -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; bh=n53lGt+YzNiyRiDyZo76uBdQF7IlqBjHXPOJ4vHrqxM=; b=vFaMtUKtLpQSTyGB1kwgIGUx3nSPgfGss6k8BSSqjQpqh6HDYV39976MRwkvxutXzZ MfwNPyjFY8zn7m1sNwuk6+1NmmYS+MuWaergGtY5QiPgaxvSbjYY70HdBawELXXRgD9n mibvueJC6kcfT9egfIx58Z3UROFxYZfprxn5sHYRdPNMcVxePgnyFEc++QO+XMdVr3Wh IKXP5p2P6jJou3YHdOtzwnBXAJlBl6Nx4Q36L46YXhw2e+OsMo1EHUJMAOuA9v25an6d UMJR79vfy/CaGRLfJBdqATu8wj7d05zJPTSmCH6uZJNcz0O94kFL9dYhzU/zt4KUXefr TOtg== 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; bh=n53lGt+YzNiyRiDyZo76uBdQF7IlqBjHXPOJ4vHrqxM=; b=Ak6bAd0Yiie2LsWWLGeoBU/4NG3W32gaIic9oWXBVpc34SnbR2wI4eb8eEI5Xz8Frs aIBQ8M0IO8cUaIhJcK0cI/4STZgEUWxuXopm1PZjz5DrdXrMu+YwzN8F5L1anmOi3eEc isAFWU4kSqwQPvfmG1dHajXT5tGSJrfI6Sj3zCD619lw5IbTEZiVmnnEYIyhP+1O0moS kGqPTzTITxRJpmNfAFxAEjEfMr/kWBq4i1loWlFb+VQstpWZ6/b7bMqcAImUCsVr3Cca JHhZ+jtBbn9RKIS0tlTUJT28yzj7vT3fnH80H7dUdwViXYK3NvrIxcHxKNXXkQTMdtQi wbWg== X-Gm-Message-State: APjAAAUXxyUjia8tueaNuTGljyxcxpO8Xl1DJ2Ivyoxi9CNvH5Pc/+rT ZRei+IMjc3va4mQcnBpFdnT1Gp7/mXen/1EZUHD3dw== X-Received: by 2002:a05:651c:208:: with SMTP id y8mr1812145ljn.36.1575461293758; Wed, 04 Dec 2019 04:08:13 -0800 (PST) MIME-Version: 1.0 References: <20191204094216.u7yld5r3zelp22lf@e107158-lin.cambridge.arm.com> <20191204100925.GA15727@linaro.org> <629cca09-dde7-5d77-42e1-c68f2c1820d2@arm.com> In-Reply-To: <629cca09-dde7-5d77-42e1-c68f2c1820d2@arm.com> From: Vincent Guittot Date: Wed, 4 Dec 2019 13:08:02 +0100 Message-ID: Subject: Re: Null pointer crash at find_idlest_group on db845c w/ linus/master To: Valentin Schneider Cc: Qais Yousef , John Stultz , Quentin Perret , Peter Zijlstra , Dietmar Eggemann , Juri Lelli , Patrick Bellasi , Ingo Molnar , lkml Content-Type: text/plain; charset="UTF-8" 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 11:41, Valentin Schneider wrote: > > On 04/12/2019 10:09, Vincent Guittot wrote: > > 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 the task doesn't fit in the CPUs > > > > So we can probably imagine a scenario where we change task affinity while > > 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 > > > > Shoot, I think you're right. If it is the local group that is NULL, then > we most likely splat on: > > if (local->sgc->max_capacity >= idlest->sgc->max_capacity) > return NULL; > > We don't splat before because we just use local_sgs, which is uninitialized > but on the stack. > > Also; does it really have to involve an affinity "race"? AFAIU affinity > could have been changed a while back, but the waking CPU isn't allowed > so we skip the local_group (in simpler cases where each CPU is a group). In fact, this will depend of the uninitialized values of local_sgs. I have been able to reproduce the situation where we skip local group but not to trigger the crash because the values already in the stack don't trigger the misfit comparison. I wait for John feedback to confirm that this fix his problem and will send a clean version of the patch > >