Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3747667imu; Mon, 28 Jan 2019 10:05:18 -0800 (PST) X-Google-Smtp-Source: ALg8bN4nKLXPBiqzCtcEdD7tM/qPKRVts/rG6Gd0pW5gArw15HJaiZCBxN0yxnHcrM3d0swlsGCg X-Received: by 2002:a17:902:9897:: with SMTP id s23mr21804360plp.69.1548698718272; Mon, 28 Jan 2019 10:05:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548698718; cv=none; d=google.com; s=arc-20160816; b=nONvT1jvmkh2KE7Eyeb2pc0qL+lufrv25rrBKOBQ5p4JwqVQMvWVs8dpB+LxstYMMn 7Ww2HLTQTWZMkMJSvF7GTw19gv42EqmaQamnfLedxG3VW3CVeWc8v3XyVCSJNv9XYANE Ji4FcAjVOUFw8/5WOaj3E+pSkvrYr3tmcJmVoZr1OWItxLIYI1O84hhijIKzEzUbaGBA NCs5pQmCzgXZ819feItJVzECEaLuEx1Eewm2hCyXudZKm0WIFajdYvPNy7e5Brii13GQ 4l7tEnUGk7SzJ1vUV+riQQJFJrCkj9LXOlY2U8h2smLdNKi+deOH7oarXBTG174z55nT MHCw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=eIE34BMPRz7jrvuDkO/iayiOTbPdr4IGFEDTV3foALs=; b=u0qrCYBV7P6sb2/nQOqFut0sp2lWfgvsO2+TD28h/dwUPneHoYyG4a1u8onB+r+F/L 1cIfj3XwNuDyIEq81utzynONEorSX4EtSWfIGGYgwL+j4YMjmt0is0z9hWigyiY15EL9 xj7RvzMvDKy05mBu6jFS5VMv+nrXgsBIXMM4NYahg7VkB/yxrIrVNjmDwWzhSRp/Acta TeFTBuEvo5XIKVl3/BFjgZ7FjTtCH013tb7Qti8++fLzS99ROV9G2iys1mzBovAmtzip 3ThmdIJ7L8L/vs4bJ6B6ZHNhhvtub1Ga+c1VsUmPnESepcvMxt26g0gpIP7dtlTRaaZc Lhtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@posteo.de header.s=2017 header.b=T+p09RSz; 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=posteo.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h96si25143269plb.230.2019.01.28.10.04.46; Mon, 28 Jan 2019 10:05:18 -0800 (PST) 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=@posteo.de header.s=2017 header.b=T+p09RSz; 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=posteo.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726877AbfA1SBa (ORCPT + 99 others); Mon, 28 Jan 2019 13:01:30 -0500 Received: from mout01.posteo.de ([185.67.36.65]:55235 "EHLO mout01.posteo.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726266AbfA1SBa (ORCPT ); Mon, 28 Jan 2019 13:01:30 -0500 Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id 49DBF160060 for ; Mon, 28 Jan 2019 19:01:25 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1548698485; bh=n6QO8/kBOLSwDXVKRis8rB30gKt/R4phl4zvGqFALoA=; h=From:To:Cc:Subject:Date:From; b=T+p09RSzjJug4lGkgjDwxmryUH67+N2REZAW/mFdWvPgPYu0X8rUsFo+XMkL/pu76 iUnU2CzVbc1al8tJWxKLBX/hSBrjm8EoH6hefipmtcDMlUIMv39NcSoxbMQuU6Kd+Y 9RYno6V6PzX6u26o8ccTRNsygfSqd1WDvTuhw9q+9fUGhFHih1NSqxQbdZcdNEklWK QfO7u7a5bIMP+H4CGCLiVXP0RWzmMe+TsgFDH7t9j30+fSL0aW/dGHQDNHf/sYN/5f l24MgV2vqSVI2HJOwJpjMKyu3sC1LRShJmaO/pZr5rdn5/MMyUvUd/e+Wu27hYDfwx EwLEXsQJiB9hA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 43pHW82LT2z6tmG; Mon, 28 Jan 2019 19:01:24 +0100 (CET) From: Martin Kepplinger To: gregkh@linuxfoundation.org, jslaby@suse.com Cc: linux-kernel@vger.kernel.org, Manfred Schlaegl , Martin Kepplinger Subject: [PATCH v2] tty: increase the default flip buffer limit to 2*640K Date: Mon, 28 Jan 2019 19:01:10 +0100 Message-Id: <20190128180110.14795-1-martink@posteo.de> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 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 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 --- revision history ---------------- v2: more verbose commit message answering Greg's questions v1: initial post 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.20.1