Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp5560312pxb; Mon, 14 Feb 2022 01:57:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJzrcgEZcaF/mMBosWi6w7dNrd3QxWEAJBb8mtPiC9hSd2D/e6DRWUgVnpTMFYRGYCDXOA4Z X-Received: by 2002:a17:907:d8d:: with SMTP id go13mr10485216ejc.440.1644832637817; Mon, 14 Feb 2022 01:57:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644832637; cv=none; d=google.com; s=arc-20160816; b=0iOQ6gU6VN/vjCQQhkpWOdzGOMZNFj9aZ4w3iu32AOgS1TNoeyxZrhFXmOWiy/aAcE 6T9yIN6ZBRPnvBoSqWXeJP2/z+7K4Sm8xXJpnvizMS/f/qrvyqPGdiAUhONUN3Gk53GH lykcgjDPJ1J2J6mQV392X10kQo/dF4IQ2A+pwpvGO07DI+jvRvcpA95BDGa/PfgbiqX6 oEKdDmmY5bSU0nI40MIWchb/AfElleqg1fm2s4AQfvIu6B+S5dqXJFGSiz1Km9prE9Y7 ZX8/cniGjKg/WjWnPQCrHHZ12P1e6KcQVOLT8UhPVpvo4LquHvAVx5wxdbXuJTEw7CZH vBfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:message-id:in-reply-to :subject:cc:to:from:date:dkim-signature; bh=L7XXqMw0BJqSwPiX8BdrSc7e/KusNkA7RDmHju/xVA8=; b=Gh+MggL4GWnwUftGOcByDVU9wAgjYpX2p950bC9lbNvkeSayt9xuD5d9Pkmj/HacN8 Lepic+hJu+pU6r+D2W+z7M5z5+DIDsXYZOR8fMG/q5xL4TaawmsEHsO01oDxzk+lgjUN Gncs80g+U3JLlhl6pc5ceCPnb2NBS53C+PfhKJZYD5PmjAgdLKz9uP6x+eM8/VgMRjbU Nkq95NuWuT94PKL9wyw4fZFUozxKzLM7FsKCLIjej7zkrTuPN5JetuQ/HD8M3ujQtPrj BURecBnAlD4Cq0kwbxqhViJnO4gTPtuttbw3CqJk9FXmYKqi3Wowlsg2QEl9nRoBEkKb rssg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b="Av/BOZka"; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s2si20042005ejs.259.2022.02.14.01.56.54; Mon, 14 Feb 2022 01:57:17 -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=@google.com header.s=20210112 header.b="Av/BOZka"; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240441AbiBNFfN (ORCPT + 99 others); Mon, 14 Feb 2022 00:35:13 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:36408 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231794AbiBNFfK (ORCPT ); Mon, 14 Feb 2022 00:35:10 -0500 Received: from mail-oo1-xc30.google.com (mail-oo1-xc30.google.com [IPv6:2607:f8b0:4864:20::c30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EC5AC4E3B9 for ; Sun, 13 Feb 2022 21:35:03 -0800 (PST) Received: by mail-oo1-xc30.google.com with SMTP id p190-20020a4a2fc7000000b0031820de484aso18107515oop.9 for ; Sun, 13 Feb 2022 21:35:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:in-reply-to:message-id:references :mime-version; bh=L7XXqMw0BJqSwPiX8BdrSc7e/KusNkA7RDmHju/xVA8=; b=Av/BOZkalXOtnl373o4nXpwwZIQACBb4OcQ+B0AOpUyLR80QEv/C26HewhnAq6N51D BYt1ZZn1+T/oPQbvb90t3FnCq+rTG9zhZTBx/aD7qKUtYcmkvMXO0Cdku64o8PRDNp2u Rt3N8V9m52xI60oD9qncI93rcNaTBZP9dR3ZiiOPWZlZ9Dtnv2KKUlPaYBU/9SOBQj5I +tyO5tsEwGwOPKknhsP9+xGC/HAbE18v7XxM36ThGlDB0+T2+FZC7cafv3sphrDlz4RA puUPUAxLwANnO0HXMNM5cKuCjhVLbqiGYlCGMfXFZguGi9ZPc60I8a96hI4A2wJkocLK PvRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:mime-version; bh=L7XXqMw0BJqSwPiX8BdrSc7e/KusNkA7RDmHju/xVA8=; b=5Q+gtxbeXPciy+IQvDDNz3W9FoLGIDTLXr89V21FwiQHq9jTBieJbrWJ2OPkrm/Nto Bj40416/TJOjETL1W9VQ4n2/5YiCgIsf8vHFPmfW5yPlvp9bogsGrS9pLugVplANS1di i8JB3VVQPMckJnxRRV6aLZpUW7EihvK7cHrdcITy+cNX2+qBR5fPkK2CByBjd9qXU5ih hYKCFfGFbQl6Y/ZgMiw4ZbRQwstzMVfLuAFplLVyfmWiOiiCVbBTahXIQ07X/nw5FMb2 77WsAzoJBQIMuZpMEOf7/KlI0dPtcigYrAbEZYG1dI4BmhOjyTgAlYlifZBnQQ90Zy/l O6+w== X-Gm-Message-State: AOAM533/r3+57baQwUIXw3tXwiJjc5k5d4HDvczYuAGStoumbQ8GLAn6 /TK38AQ5D6iJVGfDtKNlU59NdQ== X-Received: by 2002:a05:6870:61c4:: with SMTP id b4mr3648778oah.322.1644816903115; Sun, 13 Feb 2022 21:35:03 -0800 (PST) Received: from ripple.attlocal.net (172-10-233-147.lightspeed.sntcca.sbcglobal.net. [172.10.233.147]) by smtp.gmail.com with ESMTPSA id y15sm12091337oof.37.2022.02.13.21.34.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Feb 2022 21:35:01 -0800 (PST) Date: Sun, 13 Feb 2022 21:34:48 -0800 (PST) From: Hugh Dickins X-X-Sender: hugh@ripple.anvils To: Vlastimil Babka cc: Hugh Dickins , Andrew Morton , 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 Subject: Re: [PATCH 11/13] mm/munlock: page migration needs mlock pagevec drained In-Reply-To: Message-ID: References: <8e4356d-9622-a7f0-b2c-f116b5f2efea@google.com> <90c8962-d188-8687-dc70-628293316343@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL 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 Fri, 11 Feb 2022, Vlastimil Babka wrote: > On 2/6/22 22:49, Hugh Dickins wrote: > > > > Any new pagevec runs the risk of adding a new way of stranding, and we > > might discover other corners where mlock_page_drain() or lru_add_drain() > > would now help. If the mlock pagevec raises doubts, we can easily add a > > sysctl to tune its length to 1, which reverts to synchronous operation. > > Not a fan of adding new sysctls like those as that just pushes the failure > of kernel devs to poor admins :) > The old pagevec usage deleted by patch 1 was limited to the naturally larger > munlock_vma_pages_range() operation. The new per-cpu based one is more > general, which obviously has its advantages, but then it might bring new > corner cases. > So if this turns out to be an big problem, I would rather go back to the > limited scenario pagevec than a sysctl? Okay, I'll delete that comment proposing a sysctl, which was more as a possible safety measure for our internal experimentation than for general use. I just thought it was an easy way to force synchronous. I don't expect a big problem. The flush in this commit deals, I think, with the only way it was treading on its own toes, using a pagevec at a level which relied on the unlikelihood of a pagevec reference. But I can imagine that such-and-such a test will expect Mlocked or Unevictable to be exact, and this pagevec now delay it becoming exact. I've not seen any example so far, but it does seem possible. Maybe we shall fix the test, maybe we shall add a drain. I hadn't thought of limiting the use of pagevec to the mass operation (if a significant problem emerges). Yes, that might be a better idea, thanks. Anyway, we don't need to worry in advance. A change I also had in this patch, orginally, was for /proc/sys/vm/stat_refresh to lru_add_drain_all() first. I'm surprised that tests see good numbers without it doing so; but since I've not actually seen the need for it yet, dropped that - we can always add it later if need emerges. Hugh