From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933407AbdLRJne (ORCPT ); Mon, 18 Dec 2017 04:43:34 -0500 Received: from outbound-smtp18.blacknight.com ([46.22.139.245]:43355 "EHLO outbound-smtp18.blacknight.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758311AbdLRJn3 (ORCPT ); Mon, 18 Dec 2017 04:43:29 -0500 From: Mel Gorman To: Peter Zijlstra Cc: Ingo Molnar , Matt Fleming , Mel Gorman , LKML Subject: [PATCH 3/4] sched: Comment on why sync wakeups try to run on the current CPU Date: Mon, 18 Dec 2017 09:43:26 +0000 Message-Id: <20171218094327.19562-4-mgorman@techsingularity.net> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20171218094327.19562-1-mgorman@techsingularity.net> References: <20171218094327.19562-1-mgorman@techsingularity.net> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The sync wakeup logic in wake_affine_idle deserves a short description. Signed-off-by: Mel Gorman --- kernel/sched/fair.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 392e08b364bd..95b1145bc38d 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -5737,6 +5737,11 @@ wake_affine_idle(int this_cpu, int prev_cpu, int sync) static int wake_affine_sync(int this_cpu, int sync) { + /* + * Consider stacking tasks if it's a sync wakeup and there is only + * one task on the runqueue. sync wakesups are expected to sleep + * either immediately or shortly after the wakeup. + */ if (sync && cpu_rq(this_cpu)->nr_running == 1) return this_cpu; -- 2.15.0