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 EC2C0C433F5 for ; Wed, 24 Nov 2021 14:38:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7CBDA6B0075; Wed, 24 Nov 2021 09:38:05 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 77BF56B0078; Wed, 24 Nov 2021 09:38:05 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 66D826B007B; Wed, 24 Nov 2021 09:38:05 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0179.hostedemail.com [216.40.44.179]) by kanga.kvack.org (Postfix) with ESMTP id 59BB66B0075 for ; Wed, 24 Nov 2021 09:38:05 -0500 (EST) Received: from smtpin05.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 21D2B807C210 for ; Wed, 24 Nov 2021 14:37:55 +0000 (UTC) X-FDA: 78844078320.05.88C3E38 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf28.hostedemail.com (Postfix) with ESMTP id 76D8C90000B2 for ; Wed, 24 Nov 2021 14:37:54 +0000 (UTC) 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-out2.suse.de (Postfix) with ESMTPS id 188741FD2F; Wed, 24 Nov 2021 14:37:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1637764673; h=from:from:reply-to: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=g89M6e4bZVmCAGamFZFhx+PTBdJYL4rU4pHyE6Arzw4=; b=EyZrDNrfpR7D5fH5oI12w5LWSmiNa4aXC3QlPr7YAZyqG3LiF9AbI/17RNZ9LptDFlpdQT AeibRGRQWbMy5hMySB6lMYUNWVKB6tUK+n+6fj87rZQtM0EMZaINBpn9Y3XuJIPmV5ipjg rawBAvdahJ9WTtg2kyAOVc38Yob+r44= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1637764673; h=from:from:reply-to: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=g89M6e4bZVmCAGamFZFhx+PTBdJYL4rU4pHyE6Arzw4=; b=kbd0ArkzFfW6iG8MSbD41gl/ohcBQzmXdtXUYxxIgWwqASW/a40zXPP3GJWa+EXdwrDk1Y iur/avAO8UavRwCg== 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 E08D113F19; Wed, 24 Nov 2021 14:37:52 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id A4LcNUBOnmEjagAAMHmgww (envelope-from ); Wed, 24 Nov 2021 14:37:52 +0000 Message-ID: Date: Wed, 24 Nov 2021 15:37:52 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.3.2 Subject: Re: [PATCH] Increase default MLOCK_LIMIT to 8 MiB Content-Language: en-US To: David Hildenbrand , Jason Gunthorpe 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> <2adca04f-92e1-5f99-6094-5fac66a22a77@redhat.com> From: Vlastimil Babka In-Reply-To: <2adca04f-92e1-5f99-6094-5fac66a22a77@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Stat-Signature: jarbc3kjitw6hrq5ydakdon7njot648x X-Rspamd-Queue-Id: 76D8C90000B2 X-Rspamd-Server: rspam07 Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=EyZrDNrf; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=kbd0Arkz; spf=pass (imf28.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.29 as permitted sender) smtp.mailfrom=vbabka@suse.cz; dmarc=none X-HE-Tag: 1637764674-309965 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 11/24/21 09:57, David Hildenbrand wrote: > On 24.11.21 00:59, Jason Gunthorpe wrote: >>> 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). Hm I see, then we could also condsider making it possible to migrate the pinned pages - of course io-uring would have to be cooperative here, similarly to anything that supports PageMovable. Mlocked pages can also be migrated (I think there's some sysctl to prevent that, if the guarantee of not even a minor pagefault is considered more important).