Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3915638pxb; Sat, 6 Nov 2021 03:08:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxAqHvPEg77Wd+Au6fLeTJ6bnRCHxFNe6MbiRYxZFZtjl/9URfCN1VFoa7Y76ch2lMwADvp X-Received: by 2002:a17:906:b209:: with SMTP id p9mr28908753ejz.66.1636193331806; Sat, 06 Nov 2021 03:08:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1636193331; cv=none; d=google.com; s=arc-20160816; b=t6RZ7WBXDDKA8Z2O5DVguWOHVUbW84lDgADRnMQ0y4mWit8pag2v6SQx54SdcyE7t9 pkALGTN5PbrZ4k+Tm0lx0Ctf6h9kmWukvHx7eHiI4DjOTdtANLs1RZybkViQeg41nTeg sgHykaj/2XqrttpXqetjXuNlz0cg5Vj3QohGVRjFmvsMlAjD9DXDaDfhUfN6P2Wz9JWF a99B+tBxvzCSQ45EwUUkDLqcwYghilMQzxn318WcsPMJpIaFuU2DHW/2Gb4xafM5UAJt ImuyoMsZbg6jNazMLHmK+zLCv6oF5Gt8gFwofmmpTP+ZK8k8YG++NpF26UXq/xcZbuKF C3hg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=exQ9ooWMPRHqpT7+iJzLmW26HdvMvLosZ8ptXUUowu4=; b=JBkH+hMXNmnJGvFw04Z9knmU2XPOIeHyzLP2F00ig406jRB+lErZiRy8+g6Ohya0tR qOMmSz5tG+947YE1K+YrbMD7CpJt7uVWgC6BQNawJrdaMaoNcq1jB0NfLF1ItrruZzbC 9M/OvhIqP51FdwRb8iufOCdhb0OC5u0eEKlYjOutqEUq9LwHqBN/SRHof/7ytklJ5mdA JLZksFVsos9JQ97odkEYHsGrPHA5srr1IcvMDFHyfj02hobtxw83YX5MbMZLSS/s5wFf Ackyd2a4jSMrfcSCxYTT6+s10JBuyFvq7hXNnKI7dee00R6xk4vbjieucq8TSDZfTZ31 KpzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gnuweeb.org header.s=default header.b=TqtjXN3J; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g15si20830585edb.25.2021.11.06.03.08.26; Sat, 06 Nov 2021 03:08:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@gnuweeb.org header.s=default header.b=TqtjXN3J; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232619AbhKFCoE (ORCPT + 99 others); Fri, 5 Nov 2021 22:44:04 -0400 Received: from [103.31.38.59] ([103.31.38.59]:52178 "EHLO gnuweeb.org" rhost-flags-FAIL-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S229728AbhKFCoE (ORCPT ); Fri, 5 Nov 2021 22:44:04 -0400 X-Greylist: delayed 469 seconds by postgrey-1.27 at vger.kernel.org; Fri, 05 Nov 2021 22:44:03 EDT Received: from mail-ed1-f48.google.com (mail-ed1-f48.google.com [209.85.208.48]) by gnuweeb.org (Postfix) with ESMTPSA id 5CB99C16F9; Sat, 6 Nov 2021 02:33:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=gnuweeb.org; s=default; t=1636166011; bh=k0/6s4y+RBoxmpT5WkQ6jb4QqMqTeCNGaGkp8JX8AVY=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=TqtjXN3JOi9xmIKPm9AqtMyYDlpNl9NeW6O3XA3lEt44lDGFzdwDVQSQNcFgbl/TN 8pkzqXU8aAzSEbsDgAQ2dE5wyEE16dWIid1NO10Zb/8JFVmqLhyepecDBOjdJMdvou MrSM+mQr+v9oeLbZm5/eQ7rimyDbPv4VliqyttXpkg4DnTSalP9RlNadu8WD4kPNsK NZMLcKvUZl0UvHg9yqKS/eKMySfr+38Dnhb0p+Oa/AVFo9sQmKzPxHCJn8Pax0QrDb MbKOyhCnPhRvLUpbGS76N+ujtm9x33IUYddWDZ3T7Wd/PupKvy82409BGflPI8cy3A nFTtartUT0piA== Received: by mail-ed1-f48.google.com with SMTP id x15so7987989edv.1; Fri, 05 Nov 2021 19:33:31 -0700 (PDT) X-Gm-Message-State: AOAM5331RX7iQEIDZAOjNTbWPFGheklCNWlm6bLOsyAYJrvJwy0HhKGa s1bHJ1sq3/jvAh40Q/o3wMYf2HrNhdK62eC70PM= X-Received: by 2002:aa7:c391:: with SMTP id k17mr60290762edq.263.1636166008005; Fri, 05 Nov 2021 19:33:28 -0700 (PDT) MIME-Version: 1.0 References: <20211028080813.15966-1-sir@cmpwn.com> In-Reply-To: <20211028080813.15966-1-sir@cmpwn.com> From: Ammar Faizi Date: Sat, 6 Nov 2021 09:33:10 +0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] Increase default MLOCK_LIMIT to 8 MiB To: Drew DeVault Cc: linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, io_uring Mailing List , Jens Axboe , Pavel Begunkov Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 28, 2021 at 3:08 PM Drew DeVault wrote: > > This limit has not been updated since 2008, when it was increased to 64 > KiB at the request of GnuPG. Until recently, the main use-cases for this > feature were (1) preventing sensitive memory from being swapped, as in > GnuPG's use-case; and (2) real-time use-cases. In the first case, little > memory is called for, and in the second case, the user is generally in a > position to increase it if they need more. > > The introduction of IOURING_REGISTER_BUFFERS adds a third use-case: > preparing fixed buffers for high-performance I/O. This use-case will > take as much of this memory as it can get, but is still limited to 64 > KiB by default, which is very little. This increases the limit to 8 MB, > which was chosen fairly arbitrarily as a more generous, but still > conservative, default value. > --- > It is also possible to raise this limit in userspace. This is easily > done, for example, in the use-case of a network daemon: systemd, for > instance, provides for this via LimitMEMLOCK in the service file; OpenRC > via the rc_ulimit variables. However, there is no established userspace > facility for configuring this outside of daemons: end-user applications > do not presently have access to a convenient means of raising their > limits. > > The buck, as it were, stops with the kernel. It's much easier to address > it here than it is to bring it to hundreds of distributions, and it can > only realistically be relied upon to be high-enough by end-user software > if it is more-or-less ubiquitous. Most distros don't change this > particular rlimit from the kernel-supplied default value, so a change > here will easily provide that ubiquity. > > include/uapi/linux/resource.h | 13 ++++++++++--- > 1 file changed, 10 insertions(+), 3 deletions(-) Forgot to add Signed-off-by tag from the author? -- Ammar Faizi