From patchwork Thu Feb 28 16:13:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Flavio Leitner X-Patchwork-Id: 1049606 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=sysclose.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=sysclose.org header.i=fbl@sysclose.org header.b="cn07YvQa"; dkim-atps=neutral Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 449HyV3y0wz9s1b for ; Fri, 1 Mar 2019 03:27:29 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 504E7AAA4; Thu, 28 Feb 2019 16:27:26 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 069D9A9BE for ; Thu, 28 Feb 2019 16:14:59 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sender-of-o51.zoho.com (sender-of-o51.zoho.com [135.84.80.216]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 886E92D4 for ; Thu, 28 Feb 2019 16:14:38 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; t=1551370466; cv=none; d=zoho.com; s=zohoarc; b=iKt1gX3wTUhePuMHQqchGNTMxaVFJW7N9ZvFDwgi2/Sh7EEzd68SWjRF9fEPH4B9RNfoX1qaQWw+mcXA0lnPZporwCQD5LfQ9d4HSriIxaFZQhW/ZXc1H0jtIxv4SVxGNaHxXwcQyO/44n1AWqJd6OyW8k2N4tcUqVAWPCYnuBo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1551370466; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:MIME-Version:Message-ID:Subject:To:ARC-Authentication-Results; bh=BsCts9h+T0uXETJDKtkLF7TFkXuN9xSuXhI96TPFvog=; b=R4Iq+zUrHOwWaPN5Fw6SwtNw1xlSqM0vpuIkNVEQm1x/+6FR2VSQCzn81LAigGZbiXOMyOjRUaWObF0+17cNqr9fvmY1Px4xNVdHL61ScdWHHnfv/mtQ7ba+rEBhUeDnWjqGVdCoHK+pdPbfINGuRa5M1Ld7W6lnjiDWa73sLlQ= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass header.i=sysclose.org; spf=pass smtp.mailfrom=fbl@sysclose.org; dmarc=pass header.from= header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1551370466; s=zoho; d=sysclose.org; i=fbl@sysclose.org; h=From:To:Cc:Message-ID:Subject:Date:MIME-Version:Content-Transfer-Encoding:Content-Type; l=1589; bh=BsCts9h+T0uXETJDKtkLF7TFkXuN9xSuXhI96TPFvog=; b=cn07YvQamdNHw/i1YEPB+yG9AQM5bKMh/UwF2EeuumLStoq+uqVh6Pam9AV/MxCh uOSOirF0c6loQukikJaZ0Fv6W5kyuCGJpuVWgjGdT+9Kl2OAw+XRQ1CxHc3hSmXezwp pXi1/CGjwQ0Ob1worE3FiNPRG1rbaptdq+o3x8a0= Received: from localhost (177.183.215.126 [177.183.215.126]) by mx.zohomail.com with SMTPS id 1551370462300212.19408720484557; Thu, 28 Feb 2019 08:14:22 -0800 (PST) From: Flavio Leitner To: dev@openvswitch.org Message-ID: <20190228161357.2044-1-fbl@sysclose.org> Date: Thu, 28 Feb 2019 13:13:57 -0300 X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-ZohoMailClient: External X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,RCVD_IN_DNSWL_NONE autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Cc: Flavio Leitner Subject: [ovs-dev] [PATCH] rhel: limit stack size to 2M. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org The default stack size in Fedora/RHEL is 8M, which means when ovs-vswitchd daemon starts and uses --mlockall (default), it will dirty all memory regions for all threads which is proportionally to the number of CPUs. On a big host this increases memory usage to many hundreds of megabytes while OVS actually requires much less. This patch relies on systemd to limit to 2M/thread. That is much more than the minimum documented at function ovs_thread_create(): /* Some small systems use a default stack size as small as 80 kB, but OVS * requires approximately 384 kB according to the following analysis: * https://mail.openvswitch.org/pipermail/ovs-dev/2016-January/308592.html * * We use 512 kB to give us some margin of error. */ Signed-off-by: Flavio Leitner Acked-By: Timothy Redaelli Tested-By: Timothy Redaelli --- rhel/usr_lib_systemd_system_ovs-vswitchd.service.in | 1 + 1 file changed, 1 insertion(+) diff --git a/rhel/usr_lib_systemd_system_ovs-vswitchd.service.in b/rhel/usr_lib_systemd_system_ovs-vswitchd.service.in index 525deae0b..317aa993c 100644 --- a/rhel/usr_lib_systemd_system_ovs-vswitchd.service.in +++ b/rhel/usr_lib_systemd_system_ovs-vswitchd.service.in @@ -14,6 +14,7 @@ Environment=XDG_RUNTIME_DIR=/var/run/openvswitch EnvironmentFile=/etc/openvswitch/default.conf EnvironmentFile=-/etc/sysconfig/openvswitch EnvironmentFile=-/run/openvswitch/useropts +LimitSTACK=2M @begin_dpdk@ ExecStartPre=-/bin/sh -c '/usr/bin/chown :$${OVS_USER_ID##*:} /dev/hugepages' ExecStartPre=-/usr/bin/chmod 0775 /dev/hugepages