From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-21.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A5EF5C4363A for ; Sat, 24 Oct 2020 11:11:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 59B5224641 for ; Sat, 24 Oct 2020 11:11:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="fPvb9idM" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761133AbgJXLLK (ORCPT ); Sat, 24 Oct 2020 07:11:10 -0400 Received: from linux.microsoft.com ([13.77.154.182]:41094 "EHLO linux.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759511AbgJXLKd (ORCPT ); Sat, 24 Oct 2020 07:10:33 -0400 Received: from [192.168.86.179] (c-73-38-52-84.hsd1.vt.comcast.net [73.38.52.84]) by linux.microsoft.com (Postfix) with ESMTPSA id 751AD20B4905; Sat, 24 Oct 2020 04:10:28 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 751AD20B4905 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1603537832; bh=YshX4IZjFRFJAbMvhPuFYrsQnTBTJ7RfpH7w79K038k=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=fPvb9idMoYeK/5RgEwnQwga2GqzNqXJTqHGWBHV+lQw+FszzF1kWqrEKmDB2XbIAy LcNOzvCsstUfzvwfysS8a8+FboV7d32fLqYwjTrUg4aYjZcw2n/dguTokx8ivdDndq MroJBRBasbElWDMIgXOvqCsfMD4nQtmhpliJdVIM= Subject: Re: [PATCH v8 -tip 02/26] sched: Introduce sched_class::pick_task() To: "Li, Aubrey" , Joel Fernandes Cc: Nishanth Aravamudan , Julien Desfossez , Peter Zijlstra , Tim Chen , Aaron Lu , Aubrey Li , Thomas Glexiner , LKML , Ingo Molnar , Linus Torvalds , Frederic Weisbecker , Kees Cook , Greg Kerr , Phil Auld , Valentin Schneider , Mel Gorman , Pawan Gupta , Paolo Bonzini , vineeth@bitbyteword.org, Chen Yu , Christian Brauner , Agata Gruza , Antonio Gomez Iglesias , graf@amazon.com, konrad.wilk@oracle.com, Dario Faggioli , Paul Turner , Steven Rostedt , Patrick Bellasi , =?UTF-8?B?YmVuYmppYW5nKOiSi+W9qik=?= , Alexandre Chartre , James.Bottomley@hansenpartnership.com, OWeisse@umich.edu, Dhaval Giani , Junaid Shahid , Jesse Barnes , "Hyser,Chris" , "Paul E. McKenney" , Tim Chen , "Ning, Hongyu" References: <20201020014336.2076526-1-joel@joelfernandes.org> <20201020014336.2076526-3-joel@joelfernandes.org> <8ea1aa61-4a1c-2687-9f15-1062d37606c7@linux.intel.com> <20201023214702.GA3603399@google.com> From: Vineeth Pillai Message-ID: <4241e5ac-ecdf-8634-fa0d-dd6759e477e1@linux.microsoft.com> Date: Sat, 24 Oct 2020 07:10:26 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.3.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Aubrey, On 10/23/20 10:48 PM, Li, Aubrey wrote: > >>>> 2. Do you see the issue in v7? Not much if at all has changed in this >>>> part of the code from v7 -> v8 but could be something in the newer >>>> kernel. >>>> >>> IIRC, I can run uperf successfully on v7. >>> I'm on tip/master 2d3e8c9424c9 (origin/master) "Merge branch 'linus'." >>> Please let me know if this is a problem, or you have a repo I can pull >>> for testing. >> Here is a repo with v8 series on top of v5.9 release: >> https://git.kernel.org/pub/scm/linux/kernel/git/jfern/linux.git/log/?h=coresched-v5.9 > I didn't see NULL pointer dereference BUG of this repo, will post performance > data later. There has been a change in tip in pick_next_entity which caused removal of a coresched related change to fix the crash. Could you please try this patch on top of the posted v8 and see if this works? diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 93a3b874077d..4cae5ac48b60 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -4428,12 +4428,14 @@ pick_next_entity(struct cfs_rq *cfs_rq, struct sched_entity *curr)                         se = second;         } -       if (cfs_rq->next && wakeup_preempt_entity(cfs_rq->next, left) < 1) { +       if (left && cfs_rq->next && +                       wakeup_preempt_entity(cfs_rq->next, left) < 1) {                 /*                  * Someone really wants this to run. If it's not unfair, run it.                  */                 se = cfs_rq->next; -       } else if (cfs_rq->last && wakeup_preempt_entity(cfs_rq->last, left) < 1) { +       } else if (left && cfs_rq->last && +                       wakeup_preempt_entity(cfs_rq->last, left) < 1) {                 /*                  * Prefer last buddy, try to return the CPU to a preempted task. There reason for left being NULL needs to be investigated. This was there from v1 and we did not yet get to it. I shall try to debug later this week. Kindly test this patch and let us know if it fixes the crash. Thanks, Vineeth