From patchwork Wed Aug 18 07:15:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maninder Singh X-Patchwork-Id: 12443535 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=-17.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable 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 6187EC4338F for ; Wed, 18 Aug 2021 07:52:32 +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 2E1E86108E for ; Wed, 18 Aug 2021 07:52:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 2E1E86108E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=samsung.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:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:References: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:In-Reply-To: List-Owner; bh=eNPy06etj2XzygM949SNAoG4YzWPtcOO8ysTK/Bqtxg=; b=JpTLufiYutFaXn QIAoZ8vPXnTIRCCRgJqSTQva4fn7K8okHe34PnstNGccw7WNAdEEKl5OvoW9XzyDYJpQxLmCWBPAf rc2McSkYhhiAmwICrx5X3Fpk5Et8gqlgaEMvgo4IKJJEdUcgq3StrTqP5sQuKRAFy3eyrkHWqkHc4 Mu0ygo5Faqe3Y2V2nBmGxVJZpuoSCpWxEPrVheP3oqHEwAsLavJb+eyMI/d12ytLTHiBZQlpSIw7N KBYVbU6P74UJ6GzL04Ku+RMU/OWUUkljT9kUFGccBEwPZM+WV/cn9ecMdd64VpFi19VCr62o2Tlxx uTRhuevUXh9Sr1KUYjuA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mGGLF-004Xb8-0d; Wed, 18 Aug 2021 07:50:29 +0000 Received: from mailout4.samsung.com ([203.254.224.34]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mGGL8-004XaC-4v for linux-arm-kernel@lists.infradead.org; Wed, 18 Aug 2021 07:50:26 +0000 Received: from epcas5p4.samsung.com (unknown [182.195.41.42]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20210818075018epoutp043b83aab5a5f23e72d03b9e3fa4b34094~cVy2ip6vg0653606536epoutp04q for ; Wed, 18 Aug 2021 07:50:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20210818075018epoutp043b83aab5a5f23e72d03b9e3fa4b34094~cVy2ip6vg0653606536epoutp04q DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1629273018; bh=M9QkWflZWhzJ8C4UH0KXV/Xs5kR42oPIJsd+pOc8ukY=; h=From:To:Cc:Subject:Date:References:From; b=indZTeAGBmt6W96Ak6bwlxSyUnU4UcIumxF2CvQ64RhrTejvJ8cLJgBFPX2nc2L3r E8GCQQpYrxv7poogyGdZK8pcmjdOgAlRGSfKXR8L1q9WIVgehwKRe8p7rnaVpe428u /uJ7L2GeSJEXLi/1JmrwzxiBEEPjnZcZIgwUoGdU= Received: from epsmges5p1new.samsung.com (unknown [182.195.42.73]) by epcas5p1.samsung.com (KnoxPortal) with ESMTP id 20210818075017epcas5p17c8978ebda5ba5e27ed6b8d0d0b8f7af~cVy1cbJkX0231402314epcas5p1q; Wed, 18 Aug 2021 07:50:17 +0000 (GMT) Received: from epcas5p2.samsung.com ( [182.195.41.40]) by epsmges5p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 37.4F.40257.9BBBC116; Wed, 18 Aug 2021 16:50:17 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas5p4.samsung.com (KnoxPortal) with ESMTPA id 20210818071602epcas5p4fecf459638312c95c5d5aaa29e7e983a~cVU7kK0KC2682326823epcas5p4w; Wed, 18 Aug 2021 07:16:02 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20210818071602epsmtrp24cf8c22343093d9852b6140df47a26fc~cVU7jB2ba0816408164epsmtrp2D; Wed, 18 Aug 2021 07:16:02 +0000 (GMT) X-AuditID: b6c32a49-ed1ff70000019d41-ae-611cbbb9017f Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id D0.EF.08394.2B3BC116; Wed, 18 Aug 2021 16:16:02 +0900 (KST) Received: from localhost.localdomain (unknown [107.109.224.44]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20210818071559epsmtip2108c951d98b4365cb1f7f4385e4d91b9~cVU4xyQ8L2341823418epsmtip2g; Wed, 18 Aug 2021 07:15:59 +0000 (GMT) From: Maninder Singh To: linux@armlinux.org.uk, catalin.marinas@arm.com, will@kernel.org, mark.rutland@arm.com, joey.gouly@arm.com, maz@kernel.org, pcc@google.com, amit.kachhap@arm.com, ryabinin.a.a@gmail.com, dvyukov@google.com, akpm@linux-foundation.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kasan-dev@googlegroups.com, v.narang@samsung.com, a.sahrawat@samsung.com, Maninder Singh Subject: [PATCH 1/1] exception/stackdepot: add irqentry section in case of STACKDEPOT Date: Wed, 18 Aug 2021 12:45:43 +0530 Message-Id: <1629270943-9304-1-git-send-email-maninder1.s@samsung.com> X-Mailer: git-send-email 2.7.4 X-Brightmail-Tracker: H4sIAAAAAAAAA0VSe0gTYQDnu7vdzsXqXKO+pvawh2XlNIo+InuA5SlJIVHR+6hrWm6tnZb2 oKUhbWmltkw3a5RZmaZNM6cZNK1lgihDl6TZw8rsoaYE0ZPtFv33e36/j4+PwmVWkYJK1CRz Og2bFExKiJrGObPn2+sD2XDbmSDUXs8hS0UZic4P1YrQYEkWQOdeZYrRaEYmhm6868WQ7U2n CLnqLCRymBoAarycSaBr7nYM2S3NInS2200i591qHDmaiwA62b1ohT9TdqkMMK7OdpyxF/aI Gasthbmf00wytlIDyTy5+INgqoqPM2eqSwEzYpu8TrJZsnQ3l5R4kNMpl+2UJDQ97QTadFlq /s3XhB44xhkBRUF6Iaz8mWgEEkpG1wNY8d0lFshXAPMeP8MF8g3AwZJfpBH4eRvWd899qQYA TZZWTCCjAPab33pTJB0GS+vuEx5DTg8BWNWR763g9AMAWzuyCM/6eHojbBse64EEPRMWte3w dKX0avjh0x3f2mTY1WrwXgPSBRT83ZiLC0YUbHp42hcaDwec1WIBK+DIlwZSKJwGsMDi8rVv AWjrd4uE1HL4MUOPeZZxeg6sqFMKchA0Pb2NeTBOj4XZP/owQZfC2kv/8Ex4sqvSd0wAHBke JoSXZGBx+VSPLKO3wRfXW/FzIKjw/4AVgFIwidPyahXHL9JGaLhDYTyr5lM0qrBd+9U24P1E oTG1oOflUJgDYBRwAEjhwXJpCKVgZdLdbNphTrd/hy4lieMdIIAigidKt64JYGW0ik3m9nGc ltP9czHKT6HHTkUc4DRR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Pa1N26ecPffOhPVNULlL Ia+YlclXyS8uOl+kVJ7oMbdODkph53zjxXdlomrM0v6/r2qrSrf7yH82Y7ZZIrIm+sH7bpdO BsFNFhpTjwby9L2alpDsP3dNaYxguufMOxMyF0XeDw8+xVqyqG/yv5dsxR8ccn1zHZp8tWVb P8sIz664wpHIufXAkq7rCkwN3pqrW8pYX4m/Obvg898jHkdO+Xk23q/Qn8vcZdZwmYer02SR 6Mq1S865mdXYfN/OXHRnF0NurBJLcUaioRZzUXEiAO+3Lu7ZAgAA X-CMS-MailID: 20210818071602epcas5p4fecf459638312c95c5d5aaa29e7e983a X-Msg-Generator: CA X-Sendblock-Type: REQ_APPROVE CMS-TYPE: 105P X-CMS-RootMailID: 20210818071602epcas5p4fecf459638312c95c5d5aaa29e7e983a References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210818_005022_579334_7550FB99 X-CRM114-Status: GOOD ( 16.20 ) 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: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org As of now if CONFIG_FUNCTION_GRAPH_TRACER is disabled some functions like gic_handle_irq will not be added in irqentry text section. which leads to adding more stacks in stackdepot as frames below IRQ will not be filtered with filter_irq_stack() function. checked with debug interface for satckdepot: https://lkml.org/lkml/2017/11/22/242 e.g. (ARM) stack count 23188 backtrace prep_new_page+0x14c/0x160 get_page_from_freelist+0x1258/0x1350 ... __handle_domain_irq+0x1ac/0x4ac gic_handle_irq+0x44/0x80 __irq_svc+0x5c/0x98 __slab_alloc.constprop.0+0x84/0xac __kmalloc+0x31c/0x340 sf_malloc+0x14/0x18 and for same _irq_svc there were 25000 calls which was causing memory pressure of 2MB more on satckdepot, which will keep increasing. Before patch memory consumption on ARM target after 2 hours: Memory consumed by Stackdepot:3600 KB After change: ============ Memory consumed by Stackdepot:1744 KB prep_new_page+0x14c/0x160 get_page_from_freelist+0x2e4/0x1350 ... __handle_domain_irq+0x1ac/0x4ac gic_handle_irq+0x44/0x80 ^^^^^ no frames below this. Signed-off-by: Maninder Singh Signed-off-by: Vaneet Narang --- arch/arm/include/asm/exception.h | 2 +- arch/arm64/include/asm/exception.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/include/asm/exception.h b/arch/arm/include/asm/exception.h index 58e039a851af..3f4534cccc0f 100644 --- a/arch/arm/include/asm/exception.h +++ b/arch/arm/include/asm/exception.h @@ -10,7 +10,7 @@ #include -#ifdef CONFIG_FUNCTION_GRAPH_TRACER +#if defined(CONFIG_FUNCTION_GRAPH_TRACER) || defined(CONFIG_STACKDEPOT) #define __exception_irq_entry __irq_entry #else #define __exception_irq_entry diff --git a/arch/arm64/include/asm/exception.h b/arch/arm64/include/asm/exception.h index 339477dca551..ef2581b63405 100644 --- a/arch/arm64/include/asm/exception.h +++ b/arch/arm64/include/asm/exception.h @@ -13,7 +13,7 @@ #include -#ifdef CONFIG_FUNCTION_GRAPH_TRACER +#if defined(CONFIG_FUNCTION_GRAPH_TRACER) || defined(CONFIG_STACKDEPOT) #define __exception_irq_entry __irq_entry #else #define __exception_irq_entry __kprobes