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 EAA86C433F5 for ; Thu, 10 Feb 2022 15:30:35 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 67E7F6B0073; Thu, 10 Feb 2022 10:30:35 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 605BA6B007B; Thu, 10 Feb 2022 10:30:35 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4825C6B007D; Thu, 10 Feb 2022 10:30:35 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 32A456B0073 for ; Thu, 10 Feb 2022 10:30:35 -0500 (EST) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id DAE65180ACF6C for ; Thu, 10 Feb 2022 15:30:34 +0000 (UTC) X-FDA: 79127257188.30.747B7A4 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf20.hostedemail.com (Postfix) with ESMTP id 33A601C000F for ; Thu, 10 Feb 2022 15:30:34 +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 C54C61F399; Thu, 10 Feb 2022 15:30:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1644507032; 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=MVgiEFREX1O1RYr6L2jCxGTAckkdJ9S53te9ojdXMrg=; b=lJ2hJJ/ssfwaFl5Y+SGMKdqm8MB1iZd7YZYRIbgYCxyTD4gPuC3rV1QLMxiYomPDM81eFc LNwUKRogHiDRwiyAgdKwja8RKa1P4crhLW3kOCPL/M5HXuuZNUvImRAWoL+uer+9HT4Xq+ +pm0PCRNiSzHh0YfucZnb+LIWA6M2SY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1644507032; 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=MVgiEFREX1O1RYr6L2jCxGTAckkdJ9S53te9ojdXMrg=; b=hCNfQ8iprhyVXleHcSrGsA+pH/OtngQHdhcVn8spqhNvHrmcW00NaC6OTbgrWFjQkOIIRW cSSvo9ycF7rbR5Dg== 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 77D0013BD6; Thu, 10 Feb 2022 15:30:32 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id iyynG5gvBWILFAAAMHmgww (envelope-from ); Thu, 10 Feb 2022 15:30:32 +0000 Message-ID: <5363cc40-e4ae-d1fd-9f94-fc61811e70ac@suse.cz> Date: Thu, 10 Feb 2022 16:30:32 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.1 Subject: Re: [PATCH 03/13] mm/munlock: delete munlock_vma_pages_all(), allow oomreap Content-Language: en-US To: Hugh Dickins , Andrew Morton Cc: Michal Hocko , "Kirill A. Shutemov" , Matthew Wilcox , David Hildenbrand , Alistair Popple , Johannes Weiner , Rik van Riel , Suren Baghdasaryan , Yu Zhao , Greg Thelen , Shakeel Butt , linux-kernel@vger.kernel.org, linux-mm@kvack.org References: <8e4356d-9622-a7f0-b2c-f116b5f2efea@google.com> <8dddb3d4-361-da5-538-3f3ae1b326b@google.com> From: Vlastimil Babka In-Reply-To: <8dddb3d4-361-da5-538-3f3ae1b326b@google.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b="lJ2hJJ/s"; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=hCNfQ8ip; dmarc=none; spf=pass (imf20.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.29 as permitted sender) smtp.mailfrom=vbabka@suse.cz X-Rspam-User: X-Rspamd-Queue-Id: 33A601C000F X-Stat-Signature: gw3dgt4jegxxrnfq3drdmwuu5zdubm1p X-Rspamd-Server: rspam07 X-HE-Tag: 1644507034-447455 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 2/6/22 22:34, Hugh Dickins wrote: > munlock_vma_pages_range() will still be required, when munlocking but > not munmapping a set of pages; but when unmapping a pte, the mlock count > will be maintained in much the same way as it will be maintained when > mapping in the pte. Which removes the need for munlock_vma_pages_all() > on mlocked vmas when munmapping or exiting: eliminating the catastrophic > contention on i_mmap_rwsem, and the need for page lock on the pages. > > There is still a need to update locked_vm accounting according to the > munmapped vmas when munmapping: do that in detach_vmas_to_be_unmapped(). > exit_mmap() does not need locked_vm updates, so delete unlock_range(). > > And wasn't I the one who forbade the OOM reaper to attack mlocked vmas, > because of the uncertainty in blocking on all those page locks? > No fear of that now, so permit the OOM reaper on mlocked vmas. > > Signed-off-by: Hugh Dickins Acked-by: Vlastimil Babka