Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3593566imw; Thu, 7 Jul 2022 04:34:32 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tjdMe5tyGIye4ZbLkpxh1pbZ62PYVlyZHAs/QkhN+KM65N83Nnh/e2xu+HQWuHRc9u1X01 X-Received: by 2002:a17:907:c24:b0:725:eba2:1c0 with SMTP id ga36-20020a1709070c2400b00725eba201c0mr44225742ejc.756.1657193671779; Thu, 07 Jul 2022 04:34:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657193671; cv=none; d=google.com; s=arc-20160816; b=tUktvDt6VntEVtp0joSHqc5L6xlC6nK3g2+zZ0UTRZ7C8vyw5WmYmJ0VnnZRFmcGOc uT+aoTs73ow0MVVvW67cw2ZsKCJTShdJOzyT00w3yH5W4RotsP2r6vD9kBT3sauy5ORU 60fDaPnKSLGvlpD+VR4Y5racY4NX0olhpqNtNqll3BzYId++mAUJH9DyqFVEF+0avOCF JRFSLOPAC9jyu9iCvB5EdMAW1yXWvQcK3SFjH2XsNtqoXdXi+8VmqLmT7JPlGznEDeT9 2y3uyy/NctN/lG3pPs5ZdUGPZVI4tYw8EzrI8f1qzbbZo8kd5bKHGlMl4//ZcdCpwzsP GCWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=2zTI0bt2hGXniMSOabFtFhfhTaMs/YC0V+EzqH6eZXw=; b=01+Ac/m3qdJW28YnWSvfvxQkdWkhVSl5qaQ60ppUPL7VmniFlYuSxAUltjb8B0MNxG /djDYrmpD4E3W9nF6DFFolapPIwCU9Vf+4gM1mNZLaN7iT/NcD6kNIIhiwroYfrqpF6T 5SdkW/5GV4d7lFvS3lcRu3O0Rue7d9B8pS7g1FRZmq6FEQxPhHc7Q5IUNu77qeXbarj9 MYeGiKVqan37Gm8gqYhpquocWgDUmo7Z+YIzSYZ4/sqKSotCxIQkKszr63RJp2IwKxr9 hJoLUasf7qAnM+4XtW44d//2D5PFWmNYrnpnB4MKVOlwSZ3xzLp0CUChwnbJf5BNyw+m rqzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=LXn5sdpP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f9-20020a0564021e8900b0043a86c4afabsi3144036edf.152.2022.07.07.04.34.05; Thu, 07 Jul 2022 04:34:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=LXn5sdpP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235264AbiGGLF7 (ORCPT + 99 others); Thu, 7 Jul 2022 07:05:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54056 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234799AbiGGLF6 (ORCPT ); Thu, 7 Jul 2022 07:05:58 -0400 Received: from mail-pf1-x42d.google.com (mail-pf1-x42d.google.com [IPv6:2607:f8b0:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 51F072F00D for ; Thu, 7 Jul 2022 04:05:57 -0700 (PDT) Received: by mail-pf1-x42d.google.com with SMTP id j3so6004141pfb.6 for ; Thu, 07 Jul 2022 04:05:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=2zTI0bt2hGXniMSOabFtFhfhTaMs/YC0V+EzqH6eZXw=; b=LXn5sdpPpDgBpxYruZLrgEgmKOMkrd56ZWQge3eXK4T89PrUHE38kacARLZDn3lzTy vgo/a5n4GihYikVq5NHgs5ycps/uX8spRNyTkTdLg4FlTeGrrdhFwo3YldAPmWhfAsVe c8O8dUA4XSXFIVbUFuZIPxwLxhzI2ksf4CNW98jKzIw3QHJ4L/OpnOr0rgQZdIXOfEMn AhBf8DaqGoLRZJ7eZ816sy68TV3di2ZkgQQsQQQtFgrUE7WZIdYsYoh7KWqm38Gh4bmH c0jhNQJqwRMTD79FUtf3PTVuRZ5cXzbmFnrYz321esiWPMrNd4ii/DrrSMuyY4ZSaYSQ C1Sg== 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:mime-version :content-transfer-encoding; bh=2zTI0bt2hGXniMSOabFtFhfhTaMs/YC0V+EzqH6eZXw=; b=2UFa62YnKbnEcuCsIRkR5Out/pvCFPYdNNIIYlsx4TMD5CA+JAz7Y+e8ArHjwGy0y9 2lxUYCCDkixYgFt7LGbjhZYRJGeZ1uyZigeSepoIuGMbR6Z7ELzW22J9sxO/K9oqaISe MLKa+eQOqsGp2jDXnay0FwML67K6ukNevJGrr7tdL0gYGJo+CJ+G9C3TXYrYn15Gntvv 5QzMszThMjRGwb25mxUe1/yUGldRcO77k68VI7nJJY0HE3z41cNsQ9GED+0hrGsTj0GW kKyKxp+tRTK6PEQEXslvthu9uxFOkFYE6eqIIMdeMrQzxBzfuUZej/Z65RCKy6Wwmhub QSxA== X-Gm-Message-State: AJIora+56I8xzvQWajjgmi3FKEhT7W4JAwrOJz9bIqRsFqr0XcJ79V29 Vw5lioEWAbqQ6k2vRQYSRcgCQA== X-Received: by 2002:a17:902:a388:b0:16b:d52b:a038 with SMTP id x8-20020a170902a38800b0016bd52ba038mr28321674pla.56.1657191956605; Thu, 07 Jul 2022 04:05:56 -0700 (PDT) Received: from C02DW0BEMD6R.bytedance.net ([139.177.225.229]) by smtp.gmail.com with ESMTPSA id 72-20020a62174b000000b005289a50e4c2sm1046403pfx.23.2022.07.07.04.05.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Jul 2022 04:05:56 -0700 (PDT) From: Qi Zheng To: catalin.marinas@arm.com, will@kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Qi Zheng Subject: [RFC PATCH 0/2] arm64: run softirqs on the per-CPU IRQ stack Date: Thu, 7 Jul 2022 19:05:09 +0800 Message-Id: <20220707110511.52129-1-zhengqi.arch@bytedance.com> X-Mailer: git-send-email 2.24.3 (Apple Git-128) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi all, Currently arm64 supports per-CPU IRQ stack, but softirqs are still handled in the task context. Since any call to local_bh_enable() at any level in the task's call stack may trigger a softirq processing run, which could potentially cause a task stack overflow if the combined stack footprints exceed the stack's size. And we did encounter this situation in the real environment: Call trace: dump_backtrace+0x0/0x1cc, show_stack+0x14/0x1c, dump_stack+0xc4/0xfc, panic+0x150/0x2c8, panic+0x0/0x2c8, handle_bad_stack+0x11c/0x130, __bad_stack+0x88/0x8c, vsnprintf+0x2c/0x524, vscnprintf+0x38/0x7c, scnprintf+0x6c/0x90, /* ... */ __do_softirq+0x1e0/0x370, do_softirq+0x40/0x50, __local_bh_enable_ip+0x8c/0x90, _raw_spin_unlock_bh+0x1c/0x24, /* ... */ process_one_work+0x1dc/0x3e4, worker_thread+0x260/0x360, kthread+0x118/0x128, ret_from_fork+0x10/0x18, So let's run these softirqs on the IRQ stack as well. This series is based on next-20220705. Comments and suggestions are welcome. Thanks, Qi. Qi Zheng (2): arm64: run softirqs on the per-CPU IRQ stack arm64: support HAVE_IRQ_EXIT_ON_IRQ_STACK arch/arm64/Kconfig | 2 ++ arch/arm64/include/asm/exception.h | 4 +++- arch/arm64/kernel/entry-common.c | 30 ++++++++++++++++++++---------- arch/arm64/kernel/entry.S | 6 ++++-- arch/arm64/kernel/irq.c | 12 ++++++++++++ 5 files changed, 41 insertions(+), 13 deletions(-) -- 2.20.1