From patchwork Fri Jun 2 07:39:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 770152 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3wfGvR586mz9s74 for ; Fri, 2 Jun 2017 18:04:19 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="A3PmTChN"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3wfGvR44wvzDqLR for ; Fri, 2 Jun 2017 18:04:19 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="A3PmTChN"; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from mail-it0-x243.google.com (mail-it0-x243.google.com [IPv6:2607:f8b0:4001:c0b::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3wfGN51X8pzDqLV for ; Fri, 2 Jun 2017 17:40:37 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="A3PmTChN"; dkim-atps=neutral Received: by mail-it0-x243.google.com with SMTP id 67so8872422itx.2 for ; Fri, 02 Jun 2017 00:40:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=7IGbBa1aRQrpdEic8mNPozOMW4JP7+xQIGeIAi/QT1Y=; b=A3PmTChNnbfIdkmBOI7gKu+J+WOOBPKuy9/BeBpbnJn/sBI0C2rSyfttpG2fwwhL/R D3UmKevOBVAWFjBsDCEtZjBVbR7EsKw9Qhye6GXTmuMMas1DhbueEP5TWiuIqTCTlV32 qP/J7X/PyQTzTPzjdrV7O72vcFNvxXtGY1+kbwkIp1pOxxMJRVRqzZ90aewruW8PXZao E0KC6DV72ktvvUpgJalF5QVk8vpIMU57lq2wu4yxXfhhF9qEjnG05nNRCvFu+jmJvu4L tpcbyN3AhSlkSvMICChnyAUPADCZK5MHrKDrqbjwNKcbVS4BeNug5BpqCio595G97qjh PSLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=7IGbBa1aRQrpdEic8mNPozOMW4JP7+xQIGeIAi/QT1Y=; b=XWSKeyJyHL4DtmtxK89iUcH61mQjRKxP3mESTRbyB3JFBiUyXVtVzhlKllwMIjzeM/ PPVDRy7ULVNdO7ZeTfhdwDyW8tDEsLLWzCgt4j8XGdJuuUJVP6XPmnhIFaeZqQ0WAMFH otuRDovoWTecK4iPI/1QAaC96bk6ZRfcmnkw/Uqg2Gyj91Mv71kjP73Z4uMxZ+mgLbjP YIh/WAGOc2xsjKCyR0NuorNu9r8wdHQhDwWkRfo3Px1Z1sQcbxyXj04dQRDqZzWr2Z5N hJOKPmU2qByXa/gI7VV/xF8pKmiBhztWRy9gfsZWpLBQRuf/4plib8uNqVwXR/OTvYZJ rMXA== X-Gm-Message-State: AODbwcDg4F99Mn5CPtBjlO4/x6xUgTuGcaj4Arh/eyKO4ua0Ouwbs4Ip mcEc8H9lnrQhqNFb X-Received: by 10.98.79.210 with SMTP id f79mr5545735pfj.148.1496389234946; Fri, 02 Jun 2017 00:40:34 -0700 (PDT) Received: from roar.au.ibm.com ([203.221.51.192]) by smtp.gmail.com with ESMTPSA id 3sm33754096pgb.22.2017.06.02.00.40.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 02 Jun 2017 00:40:34 -0700 (PDT) From: Nicholas Piggin To: linuxppc-dev@lists.ozlabs.org Subject: [PATCH 12/14] powerpc/64s: Leave IRQs hard enabled over context switch for radix Date: Fri, 2 Jun 2017 17:39:44 +1000 Message-Id: <20170602073946.8983-13-npiggin@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170602073946.8983-1-npiggin@gmail.com> References: <20170602073946.8983-1-npiggin@gmail.com> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Anton Blanchard , Nicholas Piggin Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" Commit 4387e9ff25 ("[POWERPC] Fix PMU + soft interrupt disable bug") hard disabled interrupts over the low level context switch, because the SLB management can't cope with a PMU interrupt accesing the stack in that window. Radix based kernel mapping does not use the SLB so it does not require interrupts disabled here. This is worth 1-2% in context switch performance. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/process.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c index 633ec9967141..ea1618b62bf8 100644 --- a/arch/powerpc/kernel/process.c +++ b/arch/powerpc/kernel/process.c @@ -1199,12 +1199,14 @@ struct task_struct *__switch_to(struct task_struct *prev, __switch_to_tm(prev, new); - /* - * We can't take a PMU exception inside _switch() since there is a - * window where the kernel stack SLB and the kernel stack are out - * of sync. Hard disable here. - */ - hard_irq_disable(); + if (!radix_enabled()) { + /* + * We can't take a PMU exception inside _switch() since there + * is a window where the kernel stack SLB and the kernel stack + * are out of sync. Hard disable here. + */ + hard_irq_disable(); + } /* * Call restore_sprs() before calling _switch(). If we move it after