Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp3241026pxb; Thu, 10 Feb 2022 16:09:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJxa2pyVX71ihHU8Uvky7BuR636nBfnPAFb9gK/y6qUrg356kNDrfPVpYOAycjGg5F30Xt3u X-Received: by 2002:a17:907:3f19:: with SMTP id hq25mr8492411ejc.55.1644538175113; Thu, 10 Feb 2022 16:09:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644538175; cv=none; d=google.com; s=arc-20160816; b=WgWSotNf7B/OePAAhOn0yQ+Aui7cSGPfSmeIliGzETI5qo6SyzZefQ/WUeGY0eqm/j 37E7xZ4OT5oS0z3g2W3uKW1GvWvbO2/hu+RXNsqymGauYdb19i6pQ9bhSs9dngAUWz4h l1ft+zeqCKMDaMy4TeMfIyxMK9AAFuSuapsI6ANpBcLJ1pUvDPdZffbFTL1+LRPiynDZ 6QmKTspgfKV8qApSaJW9HNaSbJ7Heds389ADNkk3uiIE88rcYQd4datM6mzJGCQI7juR sWLQDdqn8hMpofJOBrIK+TWPUyNeByhwNW8c+ejol+qF6jX61v3aHK5kVvfE8ShPTlj0 SbSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature:dkim-signature; bh=MVgiEFREX1O1RYr6L2jCxGTAckkdJ9S53te9ojdXMrg=; b=VEM/AhkjKQXPrFN0UnekLKNN8kSONOve5T879ksrVDHpSfE0uqHMQ75CvBDcDK9gYk HifrEV2DXcZcCkp8YY0KUC0bjn5IUzm/yguBbf6foKly/V6vAAVzaykcOMEJP/Bq51ZL /xNHG6YeegBcrwIUKVuzQohfYuwN4W8sYpKUGTbs/UEi4hTfru94dWJlU44wVhHYCmQv Zf2xJ1J+c3rg13wQJJQ67le6E7fNEj28e49XoHlJp0RldB2gDKrsBd+4LDmExjed0jSI K/pa0I45N6vPWOTxdI2fTT2uQptZr277f09SvGpI/R+EipsjX7D9dj5fYw4zguujEYPs fTeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b="lJ2hJJ/s"; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=hCNfQ8ip; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hc38si13150177ejc.625.2022.02.10.16.09.10; Thu, 10 Feb 2022 16:09:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b="lJ2hJJ/s"; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=hCNfQ8ip; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243635AbiBJPae (ORCPT + 99 others); Thu, 10 Feb 2022 10:30:34 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:59974 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243625AbiBJPad (ORCPT ); Thu, 10 Feb 2022 10:30:33 -0500 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 13C831B3 for ; Thu, 10 Feb 2022 07:30:34 -0800 (PST) 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 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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