From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EAC37C433F5 for ; Tue, 16 Nov 2021 21:52:09 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 6903761BC1 for ; Tue, 16 Nov 2021 21:52:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 6903761BC1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=cmpwn.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 05C206B0072; Tue, 16 Nov 2021 16:51:59 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 00B0E6B0073; Tue, 16 Nov 2021 16:51:58 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E637B6B0074; Tue, 16 Nov 2021 16:51:58 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0217.hostedemail.com [216.40.44.217]) by kanga.kvack.org (Postfix) with ESMTP id D9EC76B0072 for ; Tue, 16 Nov 2021 16:51:58 -0500 (EST) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 79B321829322D for ; Tue, 16 Nov 2021 21:51:48 +0000 (UTC) X-FDA: 78816141096.07.C02A14F Received: from out1.migadu.com (out1.migadu.com [91.121.223.63]) by imf17.hostedemail.com (Postfix) with ESMTP id A5DF7F546EC2 for ; Tue, 16 Nov 2021 18:44:35 +0000 (UTC) MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpwn.com; s=key1; t=1637088271; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XQ2XwIGTrPQqjukfYu8yG6Mr/vLUXkMcbZOfyR81sGQ=; b=Bz4DH332idjMiD26xYTJdvS+LwwwruKBZwnEFlp9MSVS2lBWnoIvL8+JityyEPhyftO/xx FB4ysT4dl1BYiQB2u+E+szQhcrJJkwaio1qIp1GZO+qcaR8lieIC+yWx2k6WmU8MkAyJEP AnaIDlt7RxekiQWwrpXGZtdJ9ZQb3MvvZlUZK7SasmlyD2b83ZMTiVoYJBhLvlylmceHhM B/xziRcTUVtNN4tNR6Kfx0e2XYWBrEaqsXxKm6PZ/15YYEIdQvPv+jMpbJK3racigRFx/2 Tj3h9eADFud69HoTX3cPWWgHGSBE4KtlEiwqSn1z2wy/N2Iq8zjXix/1DBLFgw== Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Tue, 16 Nov 2021 19:44:27 +0100 Message-Id: Cc: "Ammar Faizi" , , , "io_uring Mailing List" , "Jens Axboe" , "Pavel Begunkov" , Subject: Re: [PATCH] Increase default MLOCK_LIMIT to 8 MiB X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: "Drew DeVault" To: "Matthew Wilcox" , "Andrew Morton" References: <20211028080813.15966-1-sir@cmpwn.com> <593aea3b-e4a4-65ce-0eda-cb3885ff81cd@gnuweeb.org> <20211115203530.62ff33fdae14927b48ef6e5f@linux-foundation.org> In-Reply-To: X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: A5DF7F546EC2 X-Stat-Signature: rhaq1xpdjn36o6eg1exg5zhx3uydwbzz Authentication-Results: imf17.hostedemail.com; dkim=temperror ("DNS error when getting key") header.d=cmpwn.com header.s=key1 header.b=Bz4DH332; dmarc=temperror reason="SPF/DKIM temp error" header.from=cmpwn.com (policy=temperror); spf=temperror (imf17.hostedemail.com: error in processing during lookup of sir@cmpwn.com: DNS error) smtp.mailfrom=sir@cmpwn.com X-HE-Tag: 1637088275-727701 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue Nov 16, 2021 at 7:36 PM CET, Matthew Wilcox wrote: > On the one hand, processes can already allocate at least this much > memory that is non-swappable, just by doing things like opening a lot of > files (allocating struct file & fdtable), using a lot of address space > (allocating page tables), so I don't have a problem with it per se. > > On the other hand, 64kB is available on anything larger than an IBM XT. > Linux will still boot on machines with 4MB of RAM (eg routers). For > someone with a machine with only, say, 32MB of memory, this allows a > process to make a quarter of the memory unswappable, and maybe that's > not a good idea. So perhaps this should scale over a certain range? I feel like most of the uber-small machines which are still relevant are not running arbitrary user code, so, something about an airtight hatch goes here. On the other hand, consider your other hand: you can probably find a way to allocate this much stuff anyway. > Is 8MB a generally useful amount of memory for an iouring user anyway? > If you're just playing with it, sure, but if you have, oh i don't know, > a database, don't you want to pin the entire cache and allow IO to the > whole thing? If you're a databse, you're probably running as a daemon with some integration with the service manager, most of which have provisions for tuning the ulimits as necessary. The purpose of this change is to provide an amount which is more useful for end-user programs, which usually cannot adjust their ulimits by any similarly convenient means. 8 MiB is not a lot, but it is enough to allocate a modest handful of read/write buffers for a video game, mail client, or something else along those lines of thought, perhaps specifically narrowing in on the areas which demand the most performance. We could certainly go higher and find an even more useful (but still realistic) value, but I felt it best to err on the side of a more conservative improvements. Honestly, this number could go as high as we want it to and applications would happily take it.