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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7CD06C433EF for ; Mon, 22 Nov 2021 18:26:46 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A4AB66B0071; Mon, 22 Nov 2021 13:26:30 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 9FB016B0072; Mon, 22 Nov 2021 13:26:30 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 89B676B0073; Mon, 22 Nov 2021 13:26:30 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0084.hostedemail.com [216.40.44.84]) by kanga.kvack.org (Postfix) with ESMTP id 7B1ED6B0071 for ; Mon, 22 Nov 2021 13:26:30 -0500 (EST) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 3D4311838A428 for ; Mon, 22 Nov 2021 18:26:20 +0000 (UTC) X-FDA: 78837396078.11.BA2A46E Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by imf01.hostedemail.com (Postfix) with ESMTP id 664865092EF2 for ; Mon, 22 Nov 2021 18:26:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1637605579; 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=su8UwITbLNscSJUA/m0/+bJ/+gkmAd2xTdWSLbbVwD0=; b=bEDm7VSQH3q7fTY9fWwxsXigtFhbaasoosog5P8G5DEi08E3HFFGTfqt5bANbpD0w+DowG l2P55P1x0G7rA60ZeVylGp/bLow3m+szieCrkYCF9iy1QqJXbHMaMWCWlp4moiOXNdht/Y b/WuMT6sO12pNb3TM9ArDITsLm9mA18= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-573-_SEs1XDOPIWoj4nblVsJpQ-1; Mon, 22 Nov 2021 13:26:18 -0500 X-MC-Unique: _SEs1XDOPIWoj4nblVsJpQ-1 Received: by mail-wm1-f70.google.com with SMTP id j25-20020a05600c1c1900b00332372c252dso287344wms.1 for ; Mon, 22 Nov 2021 10:26:17 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent :content-language:to:cc:references:from:organization:subject :in-reply-to:content-transfer-encoding; bh=su8UwITbLNscSJUA/m0/+bJ/+gkmAd2xTdWSLbbVwD0=; b=owCHcSS31k2BL6CSSWUgScfBRQxBfp75/VeS1oWCCArlvAkJz2clt2XPQSxGTwa8k9 /vXS+x5QYb62HQ5YRNF/MWsEcWOU7Fdf3WWdeeKnExl+yOhSZr3gGqwt/u1fuUqRftpT xsyk02n8y/oqdwSetkQ/bKxnfcIFMGMSHAQ74swcfRCKAEIdHuQQIOsd2ujhn+HJmP+g 59yhp209ePf56tzK/+bkaPw2y2hJpHsvsGMMqP+SyB1jH1fNPzEKQQY8EpT8i2AcJWJb yQBAeSotprO0tFxFoJD0p1iP11xuFZAy41FZkCWgbc5o/NWdXKlo+GpO0IdpSGiIiCpp 7xQw== X-Gm-Message-State: AOAM533laEb7cfNCOoxGvpWH/0YWaPkmYW7XPOXaLN8tnF1vu7QSAn2a qeLGooBdtiXDSgYYgTP7xyReLien/kcjY0svKdN0ndafS0/tBe9sPSbgfmbxIngu1eJYnwlSpf5 zY1z6XTmHViQ= X-Received: by 2002:a7b:c207:: with SMTP id x7mr33034612wmi.108.1637605577038; Mon, 22 Nov 2021 10:26:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJwl1geMQCCGpeHmabH1NU7TvFBIvZ2sdcXAUIiuRx8awMBeyFGSlesgD0P73Py4z3p5I7iiAw== X-Received: by 2002:a7b:c207:: with SMTP id x7mr33034569wmi.108.1637605576784; Mon, 22 Nov 2021 10:26:16 -0800 (PST) Received: from [192.168.3.132] (p5b0c667b.dip0.t-ipconnect.de. [91.12.102.123]) by smtp.gmail.com with ESMTPSA id t8sm11470375wmq.32.2021.11.22.10.26.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 22 Nov 2021 10:26:16 -0800 (PST) Message-ID: <333cb52b-5b02-648e-af7a-090e23261801@redhat.com> Date: Mon, 22 Nov 2021 19:26:14 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 To: Andrew Dona-Couch , Andrew Morton , Drew DeVault Cc: Ammar Faizi , linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, io_uring Mailing List , Jens Axboe , Pavel Begunkov , linux-mm@kvack.org References: <20211028080813.15966-1-sir@cmpwn.com> <593aea3b-e4a4-65ce-0eda-cb3885ff81cd@gnuweeb.org> <20211115203530.62ff33fdae14927b48ef6e5f@linux-foundation.org> <20211116114727.601021d0763be1f1efe2a6f9@linux-foundation.org> <20211116133750.0f625f73a1e4843daf13b8f7@linux-foundation.org> <8f219a64-a39f-45f0-a7ad-708a33888a3b@www.fastmail.com> From: David Hildenbrand Organization: Red Hat Subject: Re: [PATCH] Increase default MLOCK_LIMIT to 8 MiB In-Reply-To: <8f219a64-a39f-45f0-a7ad-708a33888a3b@www.fastmail.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 664865092EF2 X-Stat-Signature: 1w9z4eqpzh89rdob3e5b4q31nqb98zus Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=bEDm7VSQ; spf=none (imf01.hostedemail.com: domain of david@redhat.com has no SPF policy when checking 216.205.24.124) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-HE-Tag: 1637605576-973476 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 22.11.21 18:55, Andrew Dona-Couch wrote: > Forgive me for jumping in to an already overburdened thread. But can > someone pushing back on this clearly explain the issue with applying > this patch? It will allow unprivileged users to easily and even "accidentally" allocate more unmovable memory than it should in some environments. Such limits exist for a reason. And there are ways for admins/distros to tweak these limits if they know what they are doing. > > The only concerns I've heard are that it doesn't go far enough. That > another strategy (that everyone seems to agree would be a fair bit more > effort) could potentially achieve the same goal and then some. Isn't > that exactly what's meant by "don't let perfection be the enemy of the > good"? The saying is not talking about literal perfection -- the idea is > that you make progress where you can, and that incremental progress and > broader changes are not necessarily in conflict. > > This tiny patch could be a step in the right direction. Why does this > thread need dozens of replies? Because it does something controversial. Send controversial patches, receive many opinions, it's that simple. This is not a step into the right direction. This is all just trying to hide the fact that we're exposing FOLL_LONGTERM usage to random unprivileged users. Maybe we could instead try getting rid of FOLL_LONGTERM usage and the memlock limit in io_uring altogether, for example, by using mmu notifiers. But I'm no expert on the io_uring code. -- Thanks, David / dhildenb