Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp5598301img; Wed, 27 Mar 2019 11:24:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqxy6Jv8eKIAz0Vm6+JakA3RCIQCK2iikOll8A9Wq2SlYd6YY1vkTX8XcGIj3Z7zpYo280i/ X-Received: by 2002:aa7:8589:: with SMTP id w9mr36663277pfn.97.1553711088348; Wed, 27 Mar 2019 11:24:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553711088; cv=none; d=google.com; s=arc-20160816; b=P4jU6liAoEOrfQmjo4Hr2wlLmp4WlguX9OOG7B8y9SIBt1ZD416t5j1TGLCBlT/HeP ICTJSzMJ8nwdTQzhbdaHP4DQfz5PBAAWMwLFG4qntmqtFyawibhYHbi+C7wZA5wK/OE8 xS8bWE9JflhW0VOnvq4a0CcnWTkeWjmHKHup6HZOeuw2GsUDbUZXd+GWnzyv13Rz5G1c r5zR93bKvtLGgeOjoidSFMgXdUCLVggjJOzKTRFkL942JeFLhPdQhf5v0XI7D5w4Sgd8 QQUWixEKV+9F35MfK3/yQmGnrRIzIx13rQ333XBG85M/fW6yITRkFcDiGuSbTArh5jai QzZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ppaPl8Z8ZLAbfoSfvjSxKl8BDi8Yp8OlJJmvpuEjXOE=; b=lgQZ+UFm9oF0ulHWz8Co0V6iUGJLk5IGEYv8raQ2owZKWbAoo6gAluzSFTSg70jFt9 Fj5YI201KPdE09MSryoccVkJRwJy5QK1xJJ0w6Zg13KvMjzYFXsMX7WF0yEYT4p4aQXs 5xci8+CY0RGGaKGDfvZYUSmmiTgCKYaF9XPAC8m0/h5+T+4Yu0RRa4LD1/yjMFzP733C s8mKtVkXo0jZ+RvwgwQIRFtXXMSM9URd/xw59VNoYtyS9xS4LLJIkE+6JnRUXwtBosB4 hRuc99LOql0rOcTXDA7R4kDjpzopAIPpxXWDBD7XKqUjFDq7BBpEMJffV3RK2sIjw1BY G3Dg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=dOqKTPie; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x14si19651327pgq.185.2019.03.27.11.24.33; Wed, 27 Mar 2019 11:24:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=dOqKTPie; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391349AbfC0SWq (ORCPT + 99 others); Wed, 27 Mar 2019 14:22:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:40914 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391341AbfC0SWn (ORCPT ); Wed, 27 Mar 2019 14:22:43 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E76B62063F; Wed, 27 Mar 2019 18:22:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553710962; bh=VxLRPoFUaxmkasMBWYgpKIBw+K7EIdjUkpuXT0x37mk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dOqKTPieHOht7uZlwogLtSmPUrO+1FgSlodpNuK2aaG0JSDHaDeZt2XuZnCdJEmk5 CKT80RtdaDvZhsOOjakDIO6KM+lkET0mNtbUYW5cRw63KfO/2miMTWke2dtD7r+tW+ B0Rbto9hT8GujiBMjHUPI/ZdFCHzfS97zSqr5VO8= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Manfred Schlaegl , Martin Kepplinger , Greg Kroah-Hartman , Sasha Levin Subject: [PATCH AUTOSEL 4.9 67/87] tty: increase the default flip buffer limit to 2*640K Date: Wed, 27 Mar 2019 14:20:20 -0400 Message-Id: <20190327182040.17444-67-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190327182040.17444-1-sashal@kernel.org> References: <20190327182040.17444-1-sashal@kernel.org> MIME-Version: 1.0 X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Manfred Schlaegl [ Upstream commit 7ab57b76ebf632bf2231ccabe26bea33868118c6 ] We increase the default limit for buffer memory allocation by a factor of 10 to 640K to prevent data loss when using fast serial interfaces. For example when using RS485 without flow-control at speeds of 1Mbit/s an upwards we've run into problems such as applications being too slow to read out this buffer (on embedded devices based on imx53 or imx6). If you want to write transmitted data to a slow SD card and thus have realtime requirements, this limit can become a problem. That shouldn't be the case and 640K buffers fix such problems for us. This value is a maximum limit for allocation only. It has no effect on systems that currently run fine. When transmission is slow enough applications and hardware can keep up and increasing this limit doesn't change anything. It only _allows_ to allocate more than 2*64K in cases we currently fail to allocate memory despite having some. Signed-off-by: Manfred Schlaegl Signed-off-by: Martin Kepplinger Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/tty/tty_buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/tty_buffer.c b/drivers/tty/tty_buffer.c index 41b9a7ccce08..ca9c82ee6c35 100644 --- a/drivers/tty/tty_buffer.c +++ b/drivers/tty/tty_buffer.c @@ -25,7 +25,7 @@ * Byte threshold to limit memory consumption for flip buffers. * The actual memory limit is > 2x this amount. */ -#define TTYB_DEFAULT_MEM_LIMIT 65536 +#define TTYB_DEFAULT_MEM_LIMIT (640 * 1024UL) /* * We default to dicing tty buffer allocations to this many characters -- 2.19.1