Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1121852pxu; Sat, 12 Dec 2020 02:49:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJxd1uaPlIIdwq3pYOGjOfDIyF539t+TioGTLmTO76YlSrc5tJ5f+vSdrVFOQNl2RLOYwDc3 X-Received: by 2002:a50:9a83:: with SMTP id p3mr1244214edb.42.1607770196061; Sat, 12 Dec 2020 02:49:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607770196; cv=none; d=google.com; s=arc-20160816; b=JMxyPzQB0mHOUF5JrB/lrrp2Tg+hlhFFyOOfAzvGNj2df+nZYsM0rjrmElU31dcqDr rrG2FpuhXCpZCCv6rwf9T+7hiTMSOE6asBPUQDitVAV0ZKbEoDnHa1REcEkP+GxuK8t0 zQDW7XcJAlLfrWwsfURAVCHi5pRre3Xi/3wyKhAGG9T6g4H3ZA6+yvc6px9olbKT8fEP WZzvMxjs3BD4IxMF0NpiGxHrVTmzs0BLyY9cNhT32zx2GoBQHIdFlQk+ufk0wJ0uNddm DXKc/97VVbfnl92dLnqhjqMyjet89pwvocCHqs8TKSHvXLy+T0HdISDTU1wO/lJH24Tg Hp9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=M+VVNm+84SZSaOW8k58ieK+CRk2n/coXq5iG1qYzUJU=; b=t+j3D6p0RRwftsaruhmle/EVrEPHi0okNVwOYXcJe97PvUi18c9JzVZMTF2XcqK4eG ksvYc9BeY+ow0U6EOKWRhefBTvJpSuxv8zTk93BLtn6MIirHjcxpVYrYmkAnMX49CkDf hAK2ZIUm7+hwwgNRQ4lFyeZX5yad3p0ha7RnI1HicM0bHLYIWf7/EX7XMIR+QV1ViS88 1SefuJgpPfYY6R13jQeFpTpXWDezUndpjbJXet98UNIMaLcF6O89BiDAkf4I5Ndm4IE8 1yVcQTPCG2rU8yHirymATzrqKwMoNeE9efxcEPG0hvjTrnUZG2q5XKRVF6MQh3mA7V1U A3rw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t17si5899790eji.269.2020.12.12.02.49.33; Sat, 12 Dec 2020 02:49:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2393911AbgLKJqj (ORCPT + 99 others); Fri, 11 Dec 2020 04:46:39 -0500 Received: from outbound-smtp35.blacknight.com ([46.22.139.218]:48731 "EHLO outbound-smtp35.blacknight.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726086AbgLKJqe (ORCPT ); Fri, 11 Dec 2020 04:46:34 -0500 Received: from mail.blacknight.com (pemlinmail05.blacknight.ie [81.17.254.26]) by outbound-smtp35.blacknight.com (Postfix) with ESMTPS id 20D2F1A3D 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 Cc: Peter Ziljstra , Ingo Molnar , LKML , Aubrey Li , Barry Song , Juri Lelli , Vincent Guittot , Valentin Schneider , Linux-ARM 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-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <20201211093443.3259-1-hdanton@sina.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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