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=-10.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 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 E11C3C433FE for ; Fri, 11 Dec 2020 09:47:24 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8074723A7C for ; Fri, 11 Dec 2020 09:47:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8074723A7C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=techsingularity.net Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=gfiF8Ba7CHwvpTpOJrLYxEDQA+YB/+eqkjIwexCxEbA=; b=flVvb8Fmvnp3f2Im/tWreWeFs X8vqy81WrXA/nXDa9LspsbdijS+MOygJCVQoMNtI9+BjiRBWP2woybyZiShE/ONqn2tqcAQydfFbc FCTqZp9qP0/P5eyren0uo8qWnb/0FrMZjcdA4woP9HmpEpX7w1xldzJzfHm8aqi6k1D1GH8OnXcpr muvtI9cE0lV6SkAt07pihkyrFeKfiBB2R7blhZ8fKwQevDpdaIPIRIgfoKdxtxo8diwdgZ0/aVzqd TCdB9keDwUVrxbw0h5Usk+7Z6Fhcd778g/cV2JXQT3EPuG24N7dCByJxfVm/ZkjE4eLkRc3goadqu gZ2SYnMTw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1knezj-0000rf-DU; Fri, 11 Dec 2020 09:45:47 +0000 Received: from outbound-smtp53.blacknight.com ([46.22.136.237]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1knezg-0000r4-Gs for linux-arm-kernel@lists.infradead.org; Fri, 11 Dec 2020 09:45:45 +0000 Received: from mail.blacknight.com (pemlinmail05.blacknight.ie [81.17.254.26]) by outbound-smtp53.blacknight.com (Postfix) with ESMTPS id 273E9FAD1A for ; Fri, 11 Dec 2020 09:45:42 +0000 (GMT) Received: (qmail 8265 invoked from network); 11 Dec 2020 09:45:41 -0000 Received: from unknown (HELO techsingularity.net) (mgorman@techsingularity.net@[84.203.22.4]) by 81.17.254.9 with ESMTPSA (AES256-SHA encrypted, authenticated); 11 Dec 2020 09:45:41 -0000 Date: Fri, 11 Dec 2020 09:45:40 +0000 From: Mel Gorman To: Hillf Danton Subject: Re: [PATCH 3/4] sched/fair: Do not replace recent_used_cpu with the new target Message-ID: <20201211094540.GV3371@techsingularity.net> References: <20201208153501.1467-1-mgorman@techsingularity.net> <20201211062542.3082-1-hdanton@sina.com> <20201211093443.3259-1-hdanton@sina.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20201211093443.3259-1-hdanton@sina.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201211_044544_869414_B2833B48 X-CRM114-Status: GOOD ( 14.88 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Juri Lelli , Barry Song , Vincent Guittot , Peter Ziljstra , Aubrey Li , LKML , Ingo Molnar , Valentin Schneider , Linux-ARM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Dec 11, 2020 at 05:34:43PM +0800, Hillf Danton wrote: > On Fri, 11 Dec 2020 09:02:28 +0000 Mel Gorman wrote: > >On Fri, Dec 11, 2020 at 02:25:42PM +0800, Hillf Danton wrote: > >> On Tue, 8 Dec 2020 15:35:00 +0000 Mel Gorman wrote: > >> > @@ -6277,17 +6277,13 @@ static int select_idle_sibling(struct task_struct *p, int prev, int target) > >> > > >> > /* Check a recently used CPU as a potential idle candidate: */ > >> > recent_used_cpu = p->recent_used_cpu; > >> > + p->recent_used_cpu = prev; > >> > if (recent_used_cpu != prev && > >> > recent_used_cpu != target && > >> > cpus_share_cache(recent_used_cpu, target) && > >> > (available_idle_cpu(recent_used_cpu) || sched_idle_cpu(recent_used_cpu)) && > >> > cpumask_test_cpu(p->recent_used_cpu, p->cpus_ptr) && > >> > >> Typo? Fix it in spin if so. > >> > > > >What typo? > > After your change it is prev that we check against p->cpus_ptr instead of > the recent CPU. Wonder the point to do such a check for returning the > recent one. Ah... yes, this is indeed wrong. It wouldn't affect Vincent's case that showed a problem with a hackbench configuration (which I'm still disappointed about as it's a trade-off depending on machine and workload) but it allows a task to run on the wrong cpu if sched_setscheduler() was called between wakeup events. -- Mel Gorman SUSE Labs _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel