Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1011387yba; Thu, 4 Apr 2019 02:22:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqxmE+6yMZYDmMYehJVb/mOuYVTvkd8EChfr4cxnWaP3OF1JOM4vttjBzxSzRvh2ZWi32SBM X-Received: by 2002:a63:6ec5:: with SMTP id j188mr4577821pgc.191.1554369771854; Thu, 04 Apr 2019 02:22:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554369771; cv=none; d=google.com; s=arc-20160816; b=J14wN8dPb3Gy+7Sa+SnIlhCmPRRW97MWDbh7zzDBvUygBm8Z5ibUq8CVVq2+/5SoNX Lct6Tjr9bBBMSuYkbHNvs6q859OnMGs5Z5UBndfaFbO4Z17X4so/CQQogCzyqVnG2KqE 7ENSIYp97g39ZBQsUGwiBOMdFF5iZW3o1iDaJTrVQR7oPv7UfP4m1zW/4RL2z/qIzPvs IEM9dZNeaZqnk/bijN93GfD91IQ2hnzaK8mjLFAvLWUQzICUvCIBflklMcIH5PQQ6sSc WT8gHxsvlguRNGBoMS/N54bwHDNCu8b90X19MAiejaZHSv1OF3zTisZ9PXbvVjvL0Kbt yjuQ== 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=PqguOtJ6L71a4ofApsQuQXqUihLNaDyKuBVJYsrSfR4=; b=tnZ/6ho9pvOUvleIzdiHZKSFFsNvnc8m94m45P0R9RTATLxD4Cn/Sx7Wl5h8DxBvxc 6jbOEFTMGUxHEUQyZqBW+VpSEUlhddAUUJQV8ThoGWK6uGFvn4lEuQIGmWsmJMCG75DX R3+excd46ur7XI9bWi0we9yV2TF1AAeuYWMLSfV5bgFbpdNen7rV1JdUJKZkue2Q0ccb pxnaokHQ5HqTWkNSLRj1wBVtPu//JetdixCJbsf7igjXFUpB0+IDwOQyJmbQYDq5JzeU a7/5bCG0Dc5YVY/L7elpg+a285RnIqbjqnDY76kTkoK+gHRlzl3dKek3P+xav5M/U8Ll NWIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=CutlSA1r; 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 a1si7858382plp.120.2019.04.04.02.22.36; Thu, 04 Apr 2019 02:22:51 -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=CutlSA1r; 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 S2388290AbfDDJVs (ORCPT + 99 others); Thu, 4 Apr 2019 05:21:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:57854 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388082AbfDDJQi (ORCPT ); Thu, 4 Apr 2019 05:16:38 -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 1E5A9214AF; Thu, 4 Apr 2019 09:16:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1554369397; bh=CfroIvwfCu/73sEN/nJcOsDJ03czemFHEndbg7TPzk8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CutlSA1rNDfjzpleMNpy2xGFzYBrr6TmyHXs0a0IycqlaVOLR7trx8oAfcXCBaAUY C+2T4/ODP7thVW/aoIDkrh70XaiMPwTAYL+vCaVAw6X7pYb8lpwxjsa2jLqP44tTwB B2BQYbVhxW0Dfa/W+M/UmBOotr847Uv9gS1XdO5A= 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 5.0 193/246] tty: increase the default flip buffer limit to 2*640K Date: Thu, 4 Apr 2019 10:48:13 +0200 Message-Id: <20190404084625.943479637@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190404084619.236418459@linuxfoundation.org> References: <20190404084619.236418459@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 5.0-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 77070c2d1240..ec145a59f199 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