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 2AEB0C433EF for ; Wed, 24 Nov 2021 08:58:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 94A476B0075; Wed, 24 Nov 2021 03:57:47 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 8FA776B0078; Wed, 24 Nov 2021 03:57:47 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7C2A46B007B; Wed, 24 Nov 2021 03:57:47 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0044.hostedemail.com [216.40.44.44]) by kanga.kvack.org (Postfix) with ESMTP id 695B36B0075 for ; Wed, 24 Nov 2021 03:57:47 -0500 (EST) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 3066D8248076 for ; Wed, 24 Nov 2021 08:57:37 +0000 (UTC) X-FDA: 78843220554.22.7ABDFB3 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf18.hostedemail.com (Postfix) with ESMTP id 1F2024002088 for ; Wed, 24 Nov 2021 08:57:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1637744256; 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=TVGzFQPQlGn5U1mE3m4XSY5JB0lBn/n06rnEA04Gx5Y=; b=gp3NpgcF9BX569zdb3LR4wq6oIr8J6zj1IbfgRYKumbiprx0rFbld7PpvQ+Dq2/SxE1gm4 bixEsHX8cRD1B5g7QWpxxYdiEvmdI9nAoLqTm5mZjEp99zMvZI0cLbiiSZSIzOtza4a8v/ Tnse7MSPsVl5y1V4iJH0oAP2j2c1mlY= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-251-FxsVcT5gP6O-HzxCA_WjXw-1; Wed, 24 Nov 2021 03:57:34 -0500 X-MC-Unique: FxsVcT5gP6O-HzxCA_WjXw-1 Received: by mail-wm1-f72.google.com with SMTP id a85-20020a1c7f58000000b0033ddc0eacc8so756996wmd.9 for ; Wed, 24 Nov 2021 00:57:34 -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:subject :content-language:to:cc:references:from:organization:in-reply-to :content-transfer-encoding; bh=TVGzFQPQlGn5U1mE3m4XSY5JB0lBn/n06rnEA04Gx5Y=; b=7RBrvqDKtRYoxZddSpZw5xu9o/xpCIAMwWxVigd8fgjVVpsoAzgi8eVOjYarPIlGzY Dh5yZN+Lgg5jPPyUNDJC8m8m4sa5W1dYxavW35LrGLHhs2Z+9E5XhfJhwhKIiskVg/wF d4XgYEFlP7GV05XYyT2pSH4lfwetwjf5Quzmmmr9Ldthq6LmVMRJRYOShfM82/koR0nQ 81aRaM9YwnsD+3BwW28sL5EpM9rgjlcJk7YhLKHB6TCNaTmNiD4DYm2FEr/knLNkpGqV WIXfcEfqR7Jhdl6JuuF3CCLSAPzoOt/ByhAkE5Rlw+CK8ekdlrJM7Te1Fkd0BLqSlcy0 Lfcw== X-Gm-Message-State: AOAM533MAEw8U7+2t8QSui8w/3mroGoIg1lgIGpdWitDS91WbIEMgLqi 3Txc7VnqhruoN8Jgx4MtoerZuCEY/fAmGQUuH+FjVO9UOJg+8cSbmjGYQWxSGcb5+76qvRkj8C3 bpjG2Co0cVqU= X-Received: by 2002:adf:ea0a:: with SMTP id q10mr16624888wrm.1.1637744253683; Wed, 24 Nov 2021 00:57:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJzyi+zQkpv4TT2GNLv4kRZkNnRXzh1SkmiJ1oViYiQs5PhmxYxCZmXd1XJr0v4EH3FZy65rjw== X-Received: by 2002:adf:ea0a:: with SMTP id q10mr16624845wrm.1.1637744253433; Wed, 24 Nov 2021 00:57:33 -0800 (PST) Received: from [192.168.3.132] (p5b0c6380.dip0.t-ipconnect.de. [91.12.99.128]) by smtp.gmail.com with ESMTPSA id u15sm4422950wmq.13.2021.11.24.00.57.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 24 Nov 2021 00:57:32 -0800 (PST) Message-ID: <2adca04f-92e1-5f99-6094-5fac66a22a77@redhat.com> Date: Wed, 24 Nov 2021 09:57:32 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 Subject: Re: [PATCH] Increase default MLOCK_LIMIT to 8 MiB To: Jason Gunthorpe , Vlastimil Babka Cc: Jens Axboe , Andrew Dona-Couch , Andrew Morton , Drew DeVault , Ammar Faizi , linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, io_uring Mailing List , Pavel Begunkov , linux-mm@kvack.org References: <8f219a64-a39f-45f0-a7ad-708a33888a3b@www.fastmail.com> <333cb52b-5b02-648e-af7a-090e23261801@redhat.com> <5f998bb7-7b5d-9253-2337-b1d9ea59c796@redhat.com> <20211123132523.GA5112@ziepe.ca> <10ccf01b-f13a-d626-beba-cbee70770cf1@redhat.com> <20211123140709.GB5112@ziepe.ca> <20211123170056.GC5112@ziepe.ca> <20211123235953.GF5112@ziepe.ca> From: David Hildenbrand Organization: Red Hat In-Reply-To: <20211123235953.GF5112@ziepe.ca> 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: rspam10 X-Rspamd-Queue-Id: 1F2024002088 X-Stat-Signature: eby5cyojsqreissegegbpjko9prpnwfc Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=gp3NpgcF; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf18.hostedemail.com: domain of david@redhat.com has no SPF policy when checking 170.10.129.124) smtp.mailfrom=david@redhat.com X-HE-Tag: 1637744253-915095 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 24.11.21 00:59, Jason Gunthorpe wrote: > On Tue, Nov 23, 2021 at 11:04:04PM +0100, Vlastimil Babka wrote: >> On 11/23/21 18:00, Jason Gunthorpe wrote: >>> >>>> believe what you say and I trust your experience :) So could as well be >>>> that on such a "special" (or not so special) systems there should be a >>>> way to restrict it to privileged users only. >>> >>> At this point RDMA is about as "special" as people running large >>> ZONE_MOVABLE systems, and the two are going to start colliding >>> heavily. The RDMA VFIO migration driver should be merged soon which >>> makes VMs using this stuff finally practical. >> >> How does that work, I see the word migration, so does it cause pages to > > Sorry I mean what is often called "VM live migration". Typically that > cannot be done if a PCI device is assigned to the VM as suspending and > the migrating a PCI device to another server is complicated. With > forthcoming hardware mlx5 can do this and thus the entire RDMA stack > becomes practically usable and performant within a VM. > >> be migrated out of ZONE_MOVABLE before they are pinned? > > GUP already does this automatically for FOLL_LONGTERM. > >> Similarly for io-uring we could be migrating pages to be pinned so that >> the end up consolidated close together, and prevent pathologic >> situations like in David's reproducer. > > It is an interesting idea to have GUP do some kind of THP preserving > migration. Unfortunately it will only be a band aid AFAIU. I can rewrite my reproducer fairly easily to pin the whole 2M range first, pin a second time only a single page, and then unpin the 2M range, resulting in the very same way to block THP. (I can block some THP less because I always need the possibility to memlock 2M first, though). -- Thanks, David / dhildenb