From mboxrd@z Thu Jan 1 00:00:00 1970 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=-9.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,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 0D068C10F0C for ; Thu, 4 Apr 2019 09:35:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C8E00205F4 for ; Thu, 4 Apr 2019 09:35:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1554370540; bh=EQwTYqvZE8BUexN8wrkgJVR0ddDO9Oy1q2xslGIZq3g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=ZNqYM2d0EePWaWKJpsGjCsycQcN+itVPyemZjq/VZsQuq+3e3V939m7bIJLyPI71o J44R7IqKC54UJfvwuBVnWQqJo1kce7UTk5ecc5fa+5RIsZD9KsSDlo/rijYIvf17Fv aCQPHBjTtf3eSoqqY/IYgdNnBZpj+rp4acamnnN0= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732051AbfDDJGO (ORCPT ); Thu, 4 Apr 2019 05:06:14 -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: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@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