Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1033322yba; Thu, 4 Apr 2019 02:54:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqxhFgAtwbvbUJIOEMU1l7V1J9xDjI9WVxypooXnBLdDMD2wXbIUA+PvNRnZ92/gyZaodwm2 X-Received: by 2002:a63:2c4a:: with SMTP id s71mr4549546pgs.373.1554371675684; Thu, 04 Apr 2019 02:54:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554371675; cv=none; d=google.com; s=arc-20160816; b=HA4bPtwzqK+BxyrRPqtCixD5JNbfMQaAanzlGp3kJg1qtcraDBFz1fQv6aWEXLWral 8AEhStaOXntZrKvGg6axbhvRWFkMg2xjFOG6kz/fISoHKmuT96yzsk7eQSdCocVsLrkU GM/NB6w1pWu3YN/3MAFN8iOgd0VAkejwjoR8URZS18PRYC3gK6lyYKjT3NOoF/g6Sxn8 1lz/F72+eayPTjhYXYUxSWADQw4t+/sz3GAK/XhWoXaGPMx6+2Yrntn04mm9QpJapBKL U9dY597/+tYRqKPJMJgFPnFqt0Gnvi2y6k6U3kMik2WgaJ8uFu8xMIBT9Nt5+5enF1zm Bg2Q== 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=sPt8LoVq0A71QeRHh5QObDq5hepb9f0Pdg4VzfcEMuc=; b=wx42jXUE/4cbj8DIie83DTRjTIZtcdlQamaFnM2aekBJ8j3wdmt3OGrh4eenjZRPud /vHF4n0KhUCuG+FwYt4ojjRKSt3zIGoxysXayt6+2h9rY+mjDhyQIsE2RcCNfhEN8/pw cab5NpwcKNHINuq74A1vMU66GJ7TM3OnnGlZ1bcz5RKqDhr+MoFQgkFHtB/uWnLG7nK7 +Q0Q3KFnYNMXzTRL3KnS26pn8f+ghkpA4OvJpTD/iur10BUUC+Og4KdEOYZku6ZaunAd QLIBLxGZbU2Zkxn3SxMeVjnTbZfLb0g16hc2+s51dUJsYa9J9Q5chUlwmrl8P7V64Kpi bAlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=sPa8fO2O; 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 v16si15814390plo.33.2019.04.04.02.54.20; Thu, 04 Apr 2019 02:54:35 -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=sPa8fO2O; 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 S1729302AbfDDIxL (ORCPT + 99 others); Thu, 4 Apr 2019 04:53:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:55350 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729736AbfDDIxI (ORCPT ); Thu, 4 Apr 2019 04:53:08 -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 660B12147C; Thu, 4 Apr 2019 08:53:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1554367987; bh=OiTUFIupJmuJNQuI0QNnOztwupTDiTxEjbRknShYGgk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sPa8fO2O8b63GurDpxO4kw+377Ou8S133BW1ZAQWCC/hG88k4SDkdcWq7i5XHG+SV NZ/sMp5lXrkmu4x9Y+GOgM0EEUn6LRg3LsjRtbwZbGWnxkFJCbmT8ojy28Yta1X4kF 3h50RK3BGTmTZ8Y33rd4sDwspNr7dmcnj9Y6mySc= 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.9 72/91] tty: increase the default flip buffer limit to 2*640K Date: Thu, 4 Apr 2019 10:47:56 +0200 Message-Id: <20190404084539.616532511@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190404084535.450029272@linuxfoundation.org> References: <20190404084535.450029272@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.9-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 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