From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-x235.google.com (mail-lj1-x235.google.com [IPv6:2a00:1450:4864:20::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.bufferbloat.net (Postfix) with ESMTPS id 1EFFF3B2A4 for ; Tue, 17 Sep 2019 05:21:48 -0400 (EDT) Received: by mail-lj1-x235.google.com with SMTP id q64so2660598ljb.12 for ; Tue, 17 Sep 2019 02:21:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=KinI2n8N6njcBlYo9NqC9nXv4uMXnkaKTW37AG5nFqA=; b=X00PVgvmSBM3LCRUHZlLhGaT8iiQcoBOrm3s9ogj2aaSOsiOUPoV/Eir+WM42kwYHo w0e+hl7OW5faPzuZT57LuJg7Fp9uxIX7uouY126m+4xx0in0JQD8w5fw4cPvWMjb/xQT aStlau/YF37ttstcj53pXG8CfQwcJG1H3nzqyBQp9WGmpbzSt3aRapHNzDZXR1Xy1a2D UzE42s4dHiYH6hObhMeuHyp7Brm+bS55LQutddVEQ1xp5lsmTv/IPuYRcG3zhMKH2eXM DNX/IsBS5au4sHH4RIA4GEk7hee2FBcArvAGEvwz2qdlPfEtM9q3/8MIoZlO3wMCSqYW 8dcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=KinI2n8N6njcBlYo9NqC9nXv4uMXnkaKTW37AG5nFqA=; b=bVVgckNXsBZ9oU+dXC75S9ms8eutKC3aAS/g+OTX2o7r4SYIXN2qk8dfNDUVc2GQUL OP5PDjVrkqTVPSWArKXrIEpFW5zViENgrl7GA6UuHhffvqD71F7XRPdjdY6Rf3Jz2Hc3 9lym1x7OWMOptaGGT8O2LKwYJ0wwE3X67e5CL4VTty2oVPZcH09q5PRXdozFoeN2bEqX FXGP+P99whgX4JtaSbH0Av3M7hvQIEhzDk+qjMzuETZ8AKQyFoDdItNvJbcKDf2cakbn oA0ZNWzE59F+VDPstMSi8rFvdRNmpx65WFYKZpWYtnxpE0Z8eRSODpav47XBNg8cCTXK ByaQ== X-Gm-Message-State: APjAAAVRyCDAZ3HEliNgqxOyRS5Nsu6aKAEqreXehIRZORNViZN/YNjI FDgOTaI6G0KUqG6+Q+mbYWQ= X-Google-Smtp-Source: APXvYqzXTiFF3optJCLEd/oRUdpaBPOGXWrJJqAq9dFWuLs/TMMOTqPI9tUgBewBunuJdaEMjmkc0g== X-Received: by 2002:a2e:3808:: with SMTP id f8mr779279lja.7.1568712107024; Tue, 17 Sep 2019 02:21:47 -0700 (PDT) Received: from jonathartonsmbp.lan (83-245-235-113-nat-p.elisa-mobile.fi. [83.245.235.113]) by smtp.gmail.com with ESMTPSA id b15sm321334lfj.84.2019.09.17.02.21.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Sep 2019 02:21:45 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) From: Jonathan Morton In-Reply-To: <65e68948-6464-23ac-5df0-91735fc298af@newmedia-net.de> Date: Tue, 17 Sep 2019 12:21:44 +0300 Cc: =?utf-8?Q?Toke_H=C3=B8iland-J=C3=B8rgensen?= , cake@lists.bufferbloat.net Content-Transfer-Encoding: quoted-printable Message-Id: <44AD9976-DC81-47F7-BBB3-0D884C880A29@gmail.com> References: <2825CE14-2109-4580-A086-9701F4D3ADF0@gmail.com> <18b1c174-b88d-4664-9aa8-9c42925fc14c@www.fastmail.com> <9a90111b-2389-4dc6-8409-18c40f895540@www.fastmail.com> <43F02160-E691-4393-A0C0-8AB4AD962700@gmail.com> <057ea708-6797-23f5-ef01-9d3d7b002578@newmedia-net.de> <878sqomoj4.fsf@toke.dk> <87h85cl4qk.fsf@toke.dk> <65e68948-6464-23ac-5df0-91735fc298af@newmedia-net.de> To: Sebastian Gottschall X-Mailer: Apple Mail (2.3445.9.1) Subject: Re: [Cake] cake memory consumption X-BeenThere: cake@lists.bufferbloat.net X-Mailman-Version: 2.1.20 Precedence: list List-Id: Cake - FQ_codel the next generation List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Sep 2019 09:21:48 -0000 > On 17 Sep, 2019, at 8:31 am, Sebastian Gottschall = wrote: >=20 > according to the output there is a flaw/bug in the memory limit = calculation > cake_reconfigure may set buffer_limit to ~0 if no rate is set. >=20 > the following line "min(buffer_limit, max(sch->limit * = psched_mtu(qdisc_dec(sch), q->buffer_config_limit))" doesnt make it = better since buffer_config_limit is not configured > so we got a possible memory overuse here. In C, ~0 means "as near to infinity as an unsigned integer can get", or = effectively 4GB. That construct is used to get that part of the = calculation out of the way, so that it has no effect in the following = nested max() and min() macros. What actually happens here is that the "packet limit" property of the = interface becomes governing, and is recalculated in terms of a byte = count by multiplying it by the MTU. So the limit configured for each = Cake instance in your particular case is 15MB, corresponding to 10,000 = packets: > memory used: 0b of 15140Kb With so many Cake instances loaded (very much *not* the normal = configuration!) and only 128MB total RAM, 15MB is obviously too high a = limit to be completely safe - even though Cake's AQM action will keep = the *average* queue depth well below that limit. The correct fix here is not to change the code, but to use the memlimit = parameter to override the default. These unusual configurations, where = the default logic breaks, are precisely why it was added. - Jonathan Morton