Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp5643701img; Wed, 27 Mar 2019 12:18:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqy+derlaXCsMvemrM0BDdbBq0M6lQ7LPCKRKGwit+D/k26lodoZT9YOzqeovAYK+LICUPib X-Received: by 2002:a65:5685:: with SMTP id v5mr34965851pgs.365.1553714316264; Wed, 27 Mar 2019 12:18:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553714316; cv=none; d=google.com; s=arc-20160816; b=t3MQ6p/5pB+HmmTBaO+VE6xetvShdp6dyxBaHr8G92wStQDk5rZEXKpU1fzoBOX2XU kTA1ImXly82Moed3MzXYQucH7lH2aO300E7tzGMo6BXlinQb+rhaZQwqKJxOuq7SyJ2Z WflsEWiwoAZd5bks52syZsnB/8ulLdXI3FucxJXVz3g+/muJlbn473vp7JfriJbtwA4d B6ufCe7j5F6d4WbMVFdiTyq1Sw6XpSq/4m0pk7TsnCsUX9gyyDo19UUUkRFFNVMNjfka BVHea8krO3KMXAqTBnKq0tq36cR7//3SXCyw3y0dXQVgS06Or+Uk54YDi7o058yqpbke 2XPA== 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=32Lpys6pI4yf4SVKyYDyENEQ5utJRqQXgQTbkuSmc2o=; b=hucJ/RqFbNp78Zdr2fD3m+aFMS8Tbjp9pqUPgH63VHfh7c0tFdGwD6Squcc7v6ylrI 6oCGgOdqP1FVEV5PKLGuvedsgf1sDpJ/cW26LvnVwKZuY9mjMvWjgppSkm+w7p15fj1K CN179CJeUiZ3Nwmx6sOEINUTkWbMGoboua6/xnbl4Rv9JFkV+cgx7/ZFmg3WIkFIEf6z vBs0/fCkF2VLOkAy0yQ4dN9kJrWW94ttGW1ip4Ia0xNXZzXN4HER4tsBda7nlgfCQ8OK QxME5tC6lpnwzg0bF1NpNE+WSWA3Hgi8zsve8zc//D7nfMvvL8d0hnLO2yo2QCR4PfWy Oo1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Ry0FBmuH; 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 x4si841958pll.344.2019.03.27.12.18.16; Wed, 27 Mar 2019 12:18:36 -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=Ry0FBmuH; 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 S2388401AbfC0SIr (ORCPT + 99 others); Wed, 27 Mar 2019 14:08:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:50494 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388376AbfC0SIj (ORCPT ); Wed, 27 Mar 2019 14:08:39 -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 3EF8121738; Wed, 27 Mar 2019 18:08:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553710118; bh=ty07rSuOcAgtx2EACMlSKkOA3c5EN3DtKvsxRqcib2Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ry0FBmuHT2CPuHOkkCC7O0v+gv8IuTK6hH2ObrdbxNH3IVfZ2W8RWl9MrYbvknOP/ ZPCFy0WlXum6IQfsYtj2THPXUV6K4WkVSFdYkpHVsgRMPPKVXgK9gFRSl22tWaqFg3 BGQaCkhT8DoEn5Qt4y0hAK5hN60J6rZYyZYISaVQ= 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 5.0 205/262] tty: increase the default flip buffer limit to 2*640K Date: Wed, 27 Mar 2019 14:01:00 -0400 Message-Id: <20190327180158.10245-205-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190327180158.10245-1-sashal@kernel.org> References: <20190327180158.10245-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 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