From patchwork Fri Sep 24 13:28:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pingfan Liu X-Patchwork-Id: 12515549 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 88A0AC433F5 for ; Fri, 24 Sep 2021 13:35:37 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5597F60F4C for ; Fri, 24 Sep 2021 13:35:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 5597F60F4C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=766/fUukhrW6qR9ILgQVQEMVFuDatdil0k2Zd4pjeRg=; b=lnfZdha5RpZcNz 9e8hvrGY+30RrDjFKoexbglSJ1RudlL2NzoQUb3cDhOsrTXdKOm7OFFd6rwjqPf6ut5jYzC/OJKDS mw/9uD+jTM5NGlCd4kTi967EdLr+ZifT7F/G6QSJHsmn7bvej8rMfTVgot8Os/JNPdZOnnGcaXW3H MWOIjTcPZKzko1piu2EG7Bb2nYwmKe56A3/C6usH86b4SNUb30bY6/G2JraGaUWPNEGVsdZvhjM+b UZ99sGTwSdWTFoTuwvHe3CI2nKAKjLATjHB/kZFTjVc19FfVNLoGlhRUMyhpiUFfwUrJu8SjS3Sjp GkaIuqlbhoHyl747HJ6w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mTlKh-00EcUS-IM; Fri, 24 Sep 2021 13:33:44 +0000 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mTlGV-00Eal3-Ap for linux-arm-kernel@lists.infradead.org; Fri, 24 Sep 2021 13:29:24 +0000 Received: by mail-pl1-x631.google.com with SMTP id y1so6451107plk.10 for ; Fri, 24 Sep 2021 06:29:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=EPqUASWwyNuUhMior37hMo+yqFA/0CFRmHFpRpWedHU=; b=jXd4h1P5tG3/KArfkSmvmYJXBb6aKx5mKYkgNooa6owTVly6XeFrlShLn/IKEikiTK WuSSDdkdb5CgOwivKMKLoWx15Vmqf2dk30u2oP0KyTfnabjWFX79lwcaNhQRAL8o2QHh WBTF0mJXYwd8h1CIXUaj9ZBN8iYqYU1LA7XAelBRsLG580OII2hvCSJeLrkR/12RFSmt RGSQ7bbGY522F+kcyr7J7nw9UwXb6ILp9hFeLpJ1fJfzmZFSGc2fDVgeYBieNmri4gQz kKfLoZ1HRe9bz59jH26aC52N7CadjXU8x4dY9R8aon5YWDHDmg7hydn0/sjPAzoub5Dq ut6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=EPqUASWwyNuUhMior37hMo+yqFA/0CFRmHFpRpWedHU=; b=sHvGbd1WnMKbTKKYUmeUX9Jcvbq/6WZChokZEES61jLKo084EmXpeRx0mk5+7wXhXT tH3zY2aThedMxC78HSl+jQnMMCNGUhmrx5gUoe/pqvPuxYl2yUDcquldopjjNwJgev01 AhtF/BGGgino00Hlb/7q17/vHhAUWqQ/ikODO30WiXuVTVdUw3nCUCgzVufFSshs5EtV 35x5govpYAeEYhRrfbLidrskUwaoR2+suisjGIKDhiTq9R5NItLxKMFzxqr6vSPp2Y1p n9Kb2A3bMfje8G7UpP+VKn/L0LrVqICPZJkLOK0kvyJ8qoSHBdUhQlqG8PyXb2t6vUjD siCQ== X-Gm-Message-State: AOAM533uzRzv9i+m8VB4Peqonw/r2ClxFnaF8T/e50RglUAEOwGdhTzX mRbjDJK3pGv9/TpjW9nneu7oobFu/g== X-Google-Smtp-Source: ABdhPJyQ1WXP2tX0QuZxhDZ5p5kDJty62Fr2t/SIdOFtZmPHAVPyEc7Cgby/F951HIOQL+ltoiSLzA== X-Received: by 2002:a17:902:a50f:b029:11a:b033:e158 with SMTP id s15-20020a170902a50fb029011ab033e158mr9345901plq.26.1632490161936; Fri, 24 Sep 2021 06:29:21 -0700 (PDT) Received: from piliu.users.ipa.redhat.com ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id 26sm11756573pgx.72.2021.09.24.06.29.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Sep 2021 06:29:21 -0700 (PDT) From: Pingfan Liu To: linux-arm-kernel@lists.infradead.org Cc: Pingfan Liu , Catalin Marinas , Will Deacon , Mark Rutland , Marc Zyngier , Joey Gouly , Sami Tolvanen , Julien Thierry , Thomas Gleixner , Yuichi Ito , linux-kernel@vger.kernel.org Subject: [PATCHv2 5/5] irqchip/GICv3: make reschedule-ipi light weight Date: Fri, 24 Sep 2021 21:28:37 +0800 Message-Id: <20210924132837.45994-6-kernelfans@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210924132837.45994-1-kernelfans@gmail.com> References: <20210924132837.45994-1-kernelfans@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210924_062923_437315_03819683 X-CRM114-Status: GOOD ( 12.76 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org To achieve the light weight as DEFINE_IDTENTRY_SYSVEC_SIMPLE(sysvec_reschedule_ipi) on x86, it had better treat irqnr differently at the frontend. And let IPI_RESCHEDULE call __irq_enter_raw() instead of irq_enter_rcu(). Signed-off-by: Pingfan Liu Cc: Catalin Marinas Cc: Will Deacon Cc: Mark Rutland Cc: Marc Zyngier Cc: Joey Gouly Cc: Sami Tolvanen Cc: Julien Thierry Cc: Thomas Gleixner Cc: Yuichi Ito Cc: linux-kernel@vger.kernel.org To: linux-arm-kernel@lists.infradead.org --- drivers/irqchip/irq-gic-v3.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c index 906538fa8771..593d4539a209 100644 --- a/drivers/irqchip/irq-gic-v3.c +++ b/drivers/irqchip/irq-gic-v3.c @@ -709,6 +709,9 @@ static void gic_handle_nmi(struct pt_regs *regs) gic_deactivate_unhandled(irqnr); } +/* RESCHEDULE IPI hwirq nr is 0, and the only raw one */ +static unsigned long raw_interrupt_mask = 1; + static asmlinkage void __exception_irq_entry gic_handle_irq(struct pt_regs *regs) { u32 irqnr; @@ -729,12 +732,20 @@ static asmlinkage void __exception_irq_entry gic_handle_irq(struct pt_regs *regs else isb(); - irq_enter_rcu(); + if (raw_interrupt_mask & 1 << irqnr) + __irq_enter_raw(); + else + irq_enter_rcu(); + if (handle_domain_irq(gic_data.domain, irqnr, regs)) { WARN_ONCE(true, "Unexpected interrupt received!\n"); gic_deactivate_unhandled(irqnr); } - irq_exit_rcu(); + + if (raw_interrupt_mask & 1 << irqnr) + __irq_exit_raw(); + else + irq_exit_rcu(); } static u32 gic_get_pribits(void)