Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp693828imm; Sat, 26 May 2018 08:49:22 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpUaR6eQJOzIffCpTFz4QAHZDf0moOn3PC8A3c+6c110YJACLLF2rOF8VWAU9DlyJwTc/BM X-Received: by 2002:a65:5308:: with SMTP id m8-v6mr5553252pgq.42.1527349761934; Sat, 26 May 2018 08:49:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527349761; cv=none; d=google.com; s=arc-20160816; b=FBbkUggHOuPX5fKVhK+Nj2qVF1P97Q26MEMO/IWObegu8fAgTXZxSIN4yETlo9Yrl9 K7GFPG317MMqgkghwrUNo2LWToHTeTF0ctCPErN5PojkBTqcy7NRQz3cIfYTtNhP+hdb hRkR2uwF3c7Xv0hVWGQPNAxy498EKSBG3oygUY9rR5Q/5bhpGbkrBEF1N3hXtAQsEx16 K6V6uU/Fht/qs6+Sys2m+Wg48aMmFK19XOrcHGxW0DfHOmbY8L4pHvxGSZM7Scuv5rYr 6/z4Z7crR21yFRMaxfddpfBq45DObTdfbsvrDxVNNEuVia12/ta8dMG5Yzi1YhGa8uoi teKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:arc-authentication-results; bh=D1MhV28tIyAL+6+pM+U2mHfXFuYa+hDe/S1tKpYPCoE=; b=UQtQvMPSlkP3AW7GHfEiccrsOWcZpY1m6QMsQz0uuMSrgodC3oEJQZPZSK9laT+Tt7 cLip1d93UgdVORMJq2v5NxSGw7IjQhd0Viu7JcFubig6ehLk3X6Spw4E1CiQnD+KGYwO fUtfUqXLhJq0mD5XWZ4500G2x0+iTMuLSJwCxgRE+mzZZEP4wTF1mSFG8NXiVl6Ubqch Qo4LZvkDAZ5xhQrLdLY2SlKIODPGWINagln26di48HBwxWZTzxAqzjDKHT70kH1822Dw 3iZsq+OtyNo+OY6o5cS7c5/+dnx7spzk45psUrim9MxhsFzJK2qAMiCAtar39yleMVtd HwmA== 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 77-v6si25729266pfz.334.2018.05.26.08.49.07; Sat, 26 May 2018 08:49:21 -0700 (PDT) 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 S1031999AbeEZPrX (ORCPT + 99 others); Sat, 26 May 2018 11:47:23 -0400 Received: from 9pmail.ess.barracuda.com ([64.235.154.211]:52054 "EHLO 9pmail.ess.barracuda.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031885AbeEZPrW (ORCPT ); Sat, 26 May 2018 11:47:22 -0400 Received: from mipsdag01.mipstec.com (mail1.mips.com [12.201.5.31]) by mx1403.ess.rzc.cudaops.com (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA256 bits=128 verify=NO); Sat, 26 May 2018 15:46:54 +0000 Received: from mipsdag02.mipstec.com (10.20.40.47) by mipsdag01.mipstec.com (10.20.40.46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1415.2; Sat, 26 May 2018 08:46:58 -0700 Received: from pburton-laptop.ba.imgtec.org (10.20.78.205) by mipsdag02.mipstec.com (10.20.40.47) with Microsoft SMTP Server id 15.1.1415.2 via Frontend Transport; Sat, 26 May 2018 08:46:58 -0700 From: Paul Burton To: CC: Peter Zijlstra , Thomas Gleixner , Ingo Molnar , Paul Burton Subject: [PATCH 0/2] sched: Fix a race between CPU onlining & user task scheduling Date: Sat, 26 May 2018 08:46:46 -0700 Message-ID: <20180526154648.11635-1-paul.burton@mips.com> X-Mailer: git-send-email 2.17.0 MIME-Version: 1.0 Content-Type: text/plain X-BESS-ID: 1527349614-321459-6793-23952-1 X-BESS-VER: 2018.6-r1805181819 X-BESS-Apparent-Source-IP: 12.201.5.31 X-BESS-Outbound-Spam-Score: 0.00 X-BESS-Outbound-Spam-Report: Code version 3.2, rules version 3.2.2.193394 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------- 0.00 BSF_BESS_OUTBOUND META: BESS Outbound X-BESS-Outbound-Spam-Status: SCORE=0.00 using account:ESS59374 scores of KILL_LEVEL=7.0 tests=BSF_BESS_OUTBOUND X-BESS-BRTS-Status: 1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This short series fixes a race condition I've observed in which user tasks can be scheduled on CPUs that are still in the process of being brought online (or rather being made active) by hotplug. I've created a small test case for the observed problem here: https://gist.github.com/paulburton/25187c4f537263a6be9c8aac67bd33bf The issue was first observed on a MIPS system running a test program that was sensitive to CPU affinity, but has been reproduced on x86_64 using the above program too. On my laptop with an Intel i7-5600U CPU the test tends to fail within 10 minutes, but with this series applied runs cleanly overnight. Thanks, Paul Paul Burton (2): sched: Make select_task_rq() require cpu_active() for user tasks sched: Warn if we fail to migrate a task kernel/sched/core.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) -- 2.17.0