Received: by 10.223.185.116 with SMTP id b49csp3213161wrg; Mon, 5 Mar 2018 16:41:28 -0800 (PST) X-Google-Smtp-Source: AG47ELvcygQLmTM59ljwVX7r4CJMlxrd5XJ99Bz8bBjf5JA+0IT0F9GBWwaZyRzdNy2WzVwqofs2 X-Received: by 2002:a17:902:146:: with SMTP id 64-v6mr14814269plb.30.1520296888097; Mon, 05 Mar 2018 16:41:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520296888; cv=none; d=google.com; s=arc-20160816; b=dHVNyITY5BBvXOhF3ZUkNbw4o5aQfy/tLXFLg4PQBFMp+Z0GvpY0JTAuHIvfzvt8Iu 9/X5da0T4MxYGwtqS7PDXnxAUhtF350nkI72jAHyuE10t2CjSFSTntO1wp9UklwJOfjJ 2eUnHjLgcuPILFAtvZUXfooye+juZ7MxVG30yOfk2qFF0acie29YMpRRBLOSZ8ZmW/MC UD+LO8Ig+vFILqg7LPEjVGvKT5KBqb5onEt3LQlEYbXMmbyG9f0Jrc7WypyiM1qpROr9 mG/Tz/llKT7x7urMpH7XSCQcRgrntfXqEiSUlYzSBaYW3A3YAbCy5jjM+O3lZKZkDajH gKbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:to:from:dkim-signature:arc-authentication-results; bh=ISymb/JSMqLef2glkK3eGHMRnV3nWhFiZBV5jTu+ocg=; b=VbSM8kQuZw7tLlsWbzHTnC/vcKF18FPghZ9g3BG8Vr39TrhtQ4VLa3ozTJzJAinaHr 4fBsUfohPfHxCkR8486hMibXEj4ns1U4Ma+h4xmpODDnFqVigCAvBQPade7ookP6rcpt VFFXsM/NKMWWwROTN7H39yUyq5k+ybhJDZa/KfY6S02JRgBkCJ2hn6uWaRJrcrn2xROp VfhHMb7t/fK4p+EtZGXRPEaUhoWx4LGHS9TQApbqQ/cAJkQ7XLs+o0Txb6owGeCLAiv4 PbWbNX8RB7CVer+cnCYQHrastWONGRL2uc6N7mCOY2v/O7585QLn44o1qJO7qSmok3o5 3O2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=TM5eUHgp; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n59-v6si10074949plb.690.2018.03.05.16.41.14; Mon, 05 Mar 2018 16:41:28 -0800 (PST) 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; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=TM5eUHgp; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933016AbeCFA0Q (ORCPT + 99 others); Mon, 5 Mar 2018 19:26:16 -0500 Received: from userp2130.oracle.com ([156.151.31.86]:40500 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932968AbeCFA0N (ORCPT ); Mon, 5 Mar 2018 19:26:13 -0500 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w260LT1q187149; Tue, 6 Mar 2018 00:26:08 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id : in-reply-to : references; s=corp-2017-10-26; bh=ISymb/JSMqLef2glkK3eGHMRnV3nWhFiZBV5jTu+ocg=; b=TM5eUHgpmvE+a3Xc700KS/sqNFH9ugRGtkgfRPeLOLgGzKXNbRuM181W1H2AETHFmvwx Jote891/oWxcCdFupgpZ7Cmv3ZOnzyCWdqu26ducCsZfbZn3j7RTIT8xZgjgOANvbCHT QKbOPSWBKBNGmAh1yBHWrzVvM6GpKQnN4LpuJXn6GGDLc+rN5o21QYrrcTF50cl1HaEd kf1SmeNyOgh/XeVSbpG6u0wO2TiM7PIHKW3/lcFZnEB+Z20pHJ5PrWEZi9pdDKVlAHDL qBUVDTSyxMrn3KD3QZB+Oq/q39wQPnrSFetbAU8sK/T5wpGXVlsuXLj96HVF3Q0OCeOM NA== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp2130.oracle.com with ESMTP id 2ghdxf8jqf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 06 Mar 2018 00:26:08 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w260Q7WQ023061 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 6 Mar 2018 00:26:07 GMT Received: from abhmp0008.oracle.com (abhmp0008.oracle.com [141.146.116.14]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w260Q7qv032655; Tue, 6 Mar 2018 00:26:07 GMT Received: from localhost.localdomain (/98.216.35.41) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 05 Mar 2018 16:26:06 -0800 From: Pavel Tatashin To: steven.sistare@oracle.com, daniel.m.jordan@oracle.com, linux-kernel@vger.kernel.org, Alexander.Levin@microsoft.com, dan.j.williams@intel.com, sathyanarayanan.kuppuswamy@intel.com, pankaj.laxminarayan.bharadiya@intel.com, akuster@mvista.com, cminyard@mvista.com, pasha.tatashin@oracle.com, gregkh@linuxfoundation.org, stable@vger.kernel.org Subject: [PATCH 4.1 11/65] sched/core: Idle_task_exit() shouldn't use switch_mm_irqs_off() Date: Mon, 5 Mar 2018 19:24:44 -0500 Message-Id: <20180306002538.1761-12-pasha.tatashin@oracle.com> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180306002538.1761-1-pasha.tatashin@oracle.com> References: <20180306002538.1761-1-pasha.tatashin@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8823 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1803060003 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andy Lutomirski commit 252d2a4117bc181b287eeddf848863788da733ae upstream. idle_task_exit() can be called with IRQs on x86 on and therefore should use switch_mm(), not switch_mm_irqs_off(). This doesn't seem to cause any problems right now, but it will confuse my upcoming TLB flush changes. Nonetheless, I think it should be backported because it's trivial. There won't be any meaningful performance impact because idle_task_exit() is only used when offlining a CPU. Signed-off-by: Andy Lutomirski Cc: Borislav Petkov Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: stable@vger.kernel.org Fixes: f98db6013c55 ("sched/core: Add switch_mm_irqs_off() and use it in the scheduler") Link: http://lkml.kernel.org/r/ca3d1a9fa93a0b49f5a8ff729eda3640fb6abdf9.1497034141.git.luto@kernel.org Signed-off-by: Ingo Molnar Signed-off-by: Greg Kroah-Hartman (cherry picked from commit 18a5348d49afcfc2b95da939143c9420edd78b9e) Signed-off-by: Pavel Tatashin --- kernel/sched/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index d253618d09c6..9c905bd94ff0 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -4979,7 +4979,7 @@ void idle_task_exit(void) BUG_ON(cpu_online(smp_processor_id())); if (mm != &init_mm) { - switch_mm_irqs_off(mm, &init_mm, current); + switch_mm(mm, &init_mm, current); finish_arch_post_lock_switch(); } mmdrop(mm); -- 2.16.2