Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1732632pxb; Thu, 4 Nov 2021 07:32:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzb+zcI4RploAL0j3jP134QKrhZ+BzEU8cusuEZ4JIGJ1vT2Yiq1mbTN6SmIdhTwnT43Lit X-Received: by 2002:a17:906:1249:: with SMTP id u9mr59232661eja.96.1636036332268; Thu, 04 Nov 2021 07:32:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1636036332; cv=none; d=google.com; s=arc-20160816; b=bDJX3LUZutKcgFI3No8brbJcMcyB0p9ow4m761Bk41dzyUH0DaX2GhcyoPXxMP1km4 8c1tNB8/fyIEc3mt0MJfvNJ2VkXdfsW1wTNQ6JbMymM35XBA6LThHk8tOefRuaoi1Jbm Z4xuGFSUE/FNerxVNtZiw3zTs25W0p+pBThOaEMHOOP5VEcW/VNGcPqigFzUxKe9lwEx 7487r/uLYbL+0t46THu2fRFOjP1d7rfnFkDY5mRIBWE6KqJN7MxKglNa14ZIpdEsmgn4 e71GXlDPAO8fBi8O98dCVuXk5gU2ck7GWSsQgutCVQ2damgbDxeD9Vjhzp7/gwf6WcM6 MsYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :dkim-signature; bh=AthaTNwsWhomj4CQfeFfXNvryAZHBE+ttAigqWJELZ8=; b=W2sP6nJfEtMyqLUHOaJv/zmSsJgVP5R/WIL4o/MpeGdMM9EuyIyNlazha23FrcCbAK r0CjgNd0EjJot/XdypbQFURArGSlT9DaGvImynMS+/B3vKM8o/yw18/KId+2izClZWeg K23ryeUdYrmZNFK1ox4g9P+C5o5aFldxS5kIN6+l7cj/LnkOtDYIA+0+j5GGLLGarE7a sEweWtvz1m3ONrinjcI9oRDoIcUOqFnrtLpE9F7kaMw6uOyycaBEHyhOOLPo3jDVO2eI xXL7VrHjwV7ea59aJ1IO1IZsNyh9JtApSW+HwJAmEzAKq9H5X28vs2H5ZTZkVRo40d1K rJ7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=Zpi2sSr3; dkim=neutral (no key) header.i=@suse.cz; 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 qw14si9085166ejc.370.2021.11.04.07.31.43; Thu, 04 Nov 2021 07:32:12 -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=pass header.i=@suse.cz header.s=susede2_rsa header.b=Zpi2sSr3; dkim=neutral (no key) header.i=@suse.cz; 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 S231211AbhKDOaV (ORCPT + 99 others); Thu, 4 Nov 2021 10:30:21 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]:56400 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230409AbhKDOaV (ORCPT ); Thu, 4 Nov 2021 10:30:21 -0400 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id EE26E212C0; Thu, 4 Nov 2021 14:27:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1636036061; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=AthaTNwsWhomj4CQfeFfXNvryAZHBE+ttAigqWJELZ8=; b=Zpi2sSr3zc7coy+kFgUoMlTkQCgsnC715jzM/5jmMXYG/Sq82yypiXPgvIjaOQkCJ91dqX P3tGUZOAmlrKHUTArkOSrYFmQ64/XFKgOmm3cq6x03HeaLFtdisFXs+wPiN1HS+F/t7UEP JLMQ37GxOac31JZeHY8cTQgsVWmrUyk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1636036061; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=AthaTNwsWhomj4CQfeFfXNvryAZHBE+ttAigqWJELZ8=; b=NhFnKZZJtHkXF4aRTfwvipQQhUoWn5TpVEhK/YVKeBNP28C1AONZvzrOitda6nYc+EQCp+ 2x+3Uodke2J2E1Cg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id DAEF613BD9; Thu, 4 Nov 2021 14:27:41 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 7QWcM93tg2EbUAAAMHmgww (envelope-from ); Thu, 04 Nov 2021 14:27:41 +0000 Date: Thu, 4 Nov 2021 15:27:32 +0100 From: Cyril Hrubis To: Jens Axboe Cc: Drew DeVault , linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, io-uring@vger.kernel.org, Pavel Begunkov Subject: Re: [PATCH] Increase default MLOCK_LIMIT to 8 MiB Message-ID: References: <20211028080813.15966-1-sir@cmpwn.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi! > > 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. > > Agree with raising this limit, it is ridiculously low and we often get > reports from people that can't even do basic rings with it. Particularly > when bpf is involved as well, as it also dips into this pool. > > On the production side at facebook, we do raise this limit as well. We are raising this limit to 2MB for LTP testcases as well, otherwise we get failures when we run a few bpf tests in quick succession. Acked-by: Cyril Hrubis -- Cyril Hrubis chrubis@suse.cz