From patchwork Thu Sep 29 07:34:11 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jisheng Zhang X-Patchwork-Id: 9355817 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3369A60757 for ; Thu, 29 Sep 2016 07:41:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2604129867 for ; Thu, 29 Sep 2016 07:41:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1AA3029879; Thu, 29 Sep 2016 07:41:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B901129877 for ; Thu, 29 Sep 2016 07:41:03 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bpVwX-0000ZP-VQ; Thu, 29 Sep 2016 07:39:45 +0000 Received: from mx0b-0016f401.pphosted.com ([67.231.156.173]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bpVwT-0000TW-4Z for linux-arm-kernel@lists.infradead.org; Thu, 29 Sep 2016 07:39:42 +0000 Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id u8T7ZOsJ029030; Thu, 29 Sep 2016 00:38:32 -0700 Received: from sc-exch04.marvell.com ([199.233.58.184]) by mx0b-0016f401.pphosted.com with ESMTP id 25rq6haysj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 29 Sep 2016 00:38:32 -0700 Received: from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1104.5; Thu, 29 Sep 2016 00:38:31 -0700 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server id 15.0.1104.5 via Frontend Transport; Thu, 29 Sep 2016 00:38:30 -0700 Received: from xhacker.marvell.com (unknown [10.37.130.134]) by maili.marvell.com (Postfix) with ESMTP id 0222E3F7044; Thu, 29 Sep 2016 00:38:27 -0700 (PDT) From: Jisheng Zhang To: , , , , , , Subject: [PATCH] mm/vmalloc: reduce the number of lazy_max_pages to reduce latency Date: Thu, 29 Sep 2016 15:34:11 +0800 Message-ID: <20160929073411.3154-1-jszhang@marvell.com> X-Mailer: git-send-email 2.9.3 MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-09-29_03:, , signatures=0 X-Proofpoint-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=2 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609020000 definitions=main-1609290127 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160929_003941_515309_75DD37DE X-CRM114-Status: GOOD ( 10.69 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jisheng Zhang , linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP On Marvell berlin arm64 platforms, I see the preemptoff tracer report a max 26543 us latency at __purge_vmap_area_lazy, this latency is an awfully bad for STB. And the ftrace log also shows __free_vmap_area contributes most latency now. I noticed that Joel mentioned the same issue[1] on x86 platform and gave two solutions, but it seems no patch is sent out for this purpose. This patch adopts Joel's first solution, but I use 16MB per core rather than 8MB per core for the number of lazy_max_pages. After this patch, the preemptoff tracer reports a max 6455us latency, reduced to 1/4 of original result. [1] http://lkml.iu.edu/hypermail/linux/kernel/1603.2/04803.html Signed-off-by: Jisheng Zhang --- mm/vmalloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/vmalloc.c b/mm/vmalloc.c index 91f44e7..66f377a 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -596,7 +596,7 @@ static unsigned long lazy_max_pages(void) log = fls(num_online_cpus()); - return log * (32UL * 1024 * 1024 / PAGE_SIZE); + return log * (16UL * 1024 * 1024 / PAGE_SIZE); } static atomic_t vmap_lazy_nr = ATOMIC_INIT(0);