From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751549AbdJNRvK (ORCPT ); Sat, 14 Oct 2017 13:51:10 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:60470 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751105AbdJNRvJ (ORCPT ); Sat, 14 Oct 2017 13:51:09 -0400 Date: Sat, 14 Oct 2017 10:51:05 -0700 From: "Paul E. McKenney" To: linux-kernel@vger.kernel.org Cc: mingo@redhat.com, peterz@infradead.org Subject: [PATCH RFC tip/core/rcu 0/2] Avoid sending IPIs to offline CPUs Reply-To: paulmck@linux.vnet.ibm.com MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 x-cbid: 17101417-0056-0000-0000-000003D9D916 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00007897; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000236; SDB=6.00931119; UDB=6.00468746; IPR=6.00711375; BA=6.00005639; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00017543; XFM=3.00000015; UTC=2017-10-14 17:51:07 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17101417-0057-0000-0000-00000810DD44 Message-Id: <20171014175105.GA15409@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-10-14_01:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1710140257 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello! This RFC series contains a couple of small patches that avoid splats due to resched_cpu() and rt_mutex_setprio() sending IPIs to offline CPUs. They make the obvious (and thus perhaps inappropriate) changes to avoid this. Nevertheless, they do seem effective in rcutorture testing. The patches are as follows: 1. Stop resched_cpu() from sending IPIs to offline CPUs, unless that offline CPU happens to be the current CPU. (This last proviso is required to preserve resched_cpu()'s unconditional semantics for expedited RCU grace periods.) I am reasonably confident in this patch. 2. Stop switched_to_rt() from sending IPIs to offline CPUs, in particular, when invoked via rt_mutex_lock(). This -looks- correct to me, but I am assuming that the fact that the current CPU is holding the target task's CPU's rq lock is preventing the to-be-boosted task from doing anything, and that a later migration of the target task will finalize the priority boosting. But there might be an odd corner case involving offlining an extremely heavily loaded CPU with lots of preempted tasks, one of which is blocking a high-priority real-time task somewhere else. Note: The first patch depends on a patch intended for the upcoming merge window, and this latter patch may be found here: lkml.kernel.org/r/1507152575-11055-6-git-send-email-paulmck@linux.vnet.ibm.com Thanx, Paul ------------------------------------------------------------------------ core.c | 3 ++- rt.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-)