Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1021843yba; Thu, 4 Apr 2019 02:37:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqxY0dk6d8XygJMaK48rI1cIgNZKEXKDDetQJ4tzO68mSdPN8QqcLbhx3utIiHARPz4ebgf+ X-Received: by 2002:a17:902:704a:: with SMTP id h10mr242073plt.83.1554370639208; Thu, 04 Apr 2019 02:37:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554370639; cv=none; d=google.com; s=arc-20160816; b=rRYdQs5PGqe4OHkCVOqzSdwYMJgcC0PReXqD0DfW2BMTvD//8MjIHzWJisAm7WmWbU eJY+sUBZnHopy6kIHSFFa+9YWFEq0fxwRUEkPX8uPAhCHIhd7OcwRDIb7C/lSIXkv0o+ MJDcs7fODsUz6J2nbeOLEb/0Edx5t2idIRCJou7FdpuUNSJBUEbU5QvXMSdU/84teugp UwoKbLg3O1hVDIqCVOsty1u/uIR7OYvSMNcvpkb21IT1Q+6LHX7NZJjrFfEUJsTjc6EW B9Rs6DhWSjL6LtN7A8KMHFS+bHQchfufjiAh/xl7VNSrzXz8r2srIXJCGePwh/p7kMqF 80TQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=7FqbFe2kh2qZbCk/2oEzxZZXzRmK+5i+286W0Vz8EcU=; b=oJqDUemfMOwNT/B6lvwHMDARg1Cq5+tNPISgcixyrqBAtLmulzADgCfMU7SH9WAngo 9Zhr3DEsN6UPwBoHqrPQU+jtuJoz9WLrZO5ML+uzl+qc1HhJO8SXiS9VPcrJ59r2pxW7 68epX/0wZj/Gh0roQjXWUtFJPrc481oji63HKN7d76WTrB1sFUk1UR18sEFhre/JH8Ti LFI/E1F3I2yYHCeBoOI9pyPLA3jgaNzq0Bv9w+z/w03SJYnhGC4LDzEtDEZvKQPfPgiA u8XfsevANOtoehNyuEqUc37Vz+AAHIZNP80z5yT3SlkoRIG6teKgrrSar9nl4kufCPPy bF+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=2EzGEfip; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g14si7276495plo.287.2019.04.04.02.37.03; Thu, 04 Apr 2019 02:37:19 -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=2EzGEfip; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732279AbfDDJGQ (ORCPT + 99 others); Thu, 4 Apr 2019 05:06:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:44650 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732273AbfDDJGM (ORCPT ); Thu, 4 Apr 2019 05:06:12 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6C5F521852; Thu, 4 Apr 2019 09:06:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1554368771; bh=EQwTYqvZE8BUexN8wrkgJVR0ddDO9Oy1q2xslGIZq3g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2EzGEfipN4J3BXv8DkYWFYsh2PtuJhWuYW9wa7cRSi6NK3+K6uNHqt3FUaGwlVHQp EuJw9yJeaKA1iyCW3gdCulTQDXJ5mMp5UOJUGMpnnkmycWaaO8zDC+qcczWx9Qmq2N vfn8MM46zqnZek9Njxhly+G6tysiSvUEGw/ALkSs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Manfred Schlaegl , Martin Kepplinger , Sasha Levin Subject: [PATCH 4.19 148/187] tty: increase the default flip buffer limit to 2*640K Date: Thu, 4 Apr 2019 10:48:05 +0200 Message-Id: <20190404084610.117795845@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190404084603.119654039@linuxfoundation.org> References: <20190404084603.119654039@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ [ 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 ae3ce330200e..ee3aa57bc0e7 100644 --- a/drivers/tty/tty_buffer.c +++ b/drivers/tty/tty_buffer.c @@ -26,7 +26,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