Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp281599ybl; Wed, 4 Dec 2019 02:42:03 -0800 (PST) X-Google-Smtp-Source: APXvYqyBWLOBWItFoJccod7PAGRM5D1Ex4effWZOwM0fF/F5gGJ7PuO/NKw09fQxIwBmRgbtxNq8 X-Received: by 2002:a05:6808:258:: with SMTP id m24mr1834976oie.101.1575456123078; Wed, 04 Dec 2019 02:42:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575456123; cv=none; d=google.com; s=arc-20160816; b=ptNMKRgQfBoLSS4aKKE6KPVykfw7TN4IUHRBpegTDpWa0Zjwyc6sZXNBSHJWM9O+m+ Bby5d6F2LtJPFeAQeaRl90VcgQMJ32lUDP8acZSpxAQfvG91dCiacgrUdlPFOE4eoATg rReAwWySqvSQG7BxOEkoKChZKGuoF2hh+rD6X9NLS/R7S6gRHg3p2NfhZcmLKEfwtB1G ZbxR8Ut/EApwm73Gf6U9fd1rjJ+ZCPXF2KrJbN7xZUKw9L0ycH42Fib7K+ZaDtYUY5T8 KZPRdbFpj3oyRTT+YI51viwYD3BTCnWtQGRHzjTGUmZ2bxVxkwFhkT0MXuClJi3pNGX4 7f0Q== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=62c0RBHSY61LEyhy0gUX0ABUGfF1XdvebccZEyo6tDo=; b=vm8D2j5VUlaHwVf/+rDDTAQBibGV+LZ8weC2GloOZuZkNsEd1Vw3So8IwvRLLRzJIN sza+QvDjBq3hM9ayTqHxO1ZGEanjptP7G5LnPiehTlCtgxudl/0VFRU9u23CewBm9naP wahjxqHUNVHbAQs0SZ0k+wGu86amBz19MkagvrBtdOHBf9ujEbKRkD5R9rleUsZ7ZxDf jYlelE6utZ4nlqp4q8NNULCneiqeGFPpmCmZqt+9W+GDKgv8KKKBAtF50UQUPh1LXP4b REhHGTM3f34nsvffwRXc7hYFBrHjSHT35pPjmv6TBPrQzR5hqzPdS/sjpsLwYxX8TH+W aD7A== ARC-Authentication-Results: i=1; mx.google.com; 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 16si3075297otn.228.2019.12.04.02.41.50; Wed, 04 Dec 2019 02:42: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; 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 S1727537AbfLDKlQ (ORCPT + 99 others); Wed, 4 Dec 2019 05:41:16 -0500 Received: from foss.arm.com ([217.140.110.172]:54162 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727446AbfLDKlP (ORCPT ); Wed, 4 Dec 2019 05:41:15 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 3C8601FB; Wed, 4 Dec 2019 02:41:15 -0800 (PST) Received: from [10.1.194.37] (e113632-lin.cambridge.arm.com [10.1.194.37]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 045723F52E; Wed, 4 Dec 2019 02:41:13 -0800 (PST) Subject: Re: Null pointer crash at find_idlest_group on db845c w/ linus/master To: Vincent Guittot , Qais Yousef Cc: John Stultz , Quentin Perret , Peter Zijlstra , Dietmar Eggemann , Juri Lelli , Patrick Bellasi , Ingo Molnar , lkml References: <20191204094216.u7yld5r3zelp22lf@e107158-lin.cambridge.arm.com> <20191204100925.GA15727@linaro.org> From: Valentin Schneider Message-ID: <629cca09-dde7-5d77-42e1-c68f2c1820d2@arm.com> Date: Wed, 4 Dec 2019 10:41:12 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <20191204100925.GA15727@linaro.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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).