Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1626564pxj; Fri, 4 Jun 2021 21:29:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzEh21UklpZdITx0iTIcr9ZF/IgyGwbPS1GLT99sJG+5OvW5S4Bk5zYNRItRPeOoF7nhyPJ X-Received: by 2002:a05:6402:5a:: with SMTP id f26mr8291984edu.306.1622867376534; Fri, 04 Jun 2021 21:29:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622867376; cv=none; d=google.com; s=arc-20160816; b=Czo4g/QOuVPGQ6mei2Ygkm6tBgiq8NXcMPl+s+KziWE4UcJBSydzMykI5fGYeNAymk /zw7gZH2vQSWzsrGrle7Nt7AvXiQfcXoGQcBK0WULg4juOECrxC+Xl2r2Y2ggLsJA+2a 9OViSYl8IYsFVGnZr+eArIHsTVd21mXClFHxeYLSWYM/QTsGpkMztanRUw6XP3qjAYmZ OvhbYpI7DLnVUJqDrzqlZHzu2EPpFdWowuhBRndjEu/e1PRRHD4C3jqupXLgjT84pJuu iMxZivJ1vBmL5l9W5M3FUqB59ckMsqPloZb7LAqGGbQ4aEE7/8uKch/EDOQEtWRflqKj FkcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=MHI92OzbTRuOfSGogKDicdkw31a8xsuWOtLJPqvNx58=; b=nr9C2Vj160QzIwxS1qQPvMNYlSH/FDdKrC89bdlPjA+uQNTJXB7MxVB9IZgXiT2D6t I8TGA7QPKhem0GpBKKZl3fgqCtz4GGn6XZ0PW9QmLdup7306Z6m+JYnq5emQ5Z/PNnxV jIBs4EYAMte3mERMKb2qUgcMs3wn43vAUrq5C/mlWMyENaUo3O0U+rm1Mm/aisDGmPD6 jmZsyWgcowTwMRaxGEm/RMg+/mKAX0QPujhgA+rK/bI3AjejS0JZMQfrykDebVarUAP2 /UZuF4hD1lGdRDiMMt25yNArWqnf2CQ5yh7U7w3TEzNtQO6xdGxwKRtRzJQrw8Z6zXPf osgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=hMgR5HN4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y18si6328270edr.488.2021.06.04.21.28.49; Fri, 04 Jun 2021 21:29:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=hMgR5HN4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S229726AbhFEEWN (ORCPT + 99 others); Sat, 5 Jun 2021 00:22:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59944 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229485AbhFEEWM (ORCPT ); Sat, 5 Jun 2021 00:22:12 -0400 Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CA7B3C061766 for ; Fri, 4 Jun 2021 21:20:08 -0700 (PDT) Received: by mail-lf1-x134.google.com with SMTP id v8so17063837lft.8 for ; Fri, 04 Jun 2021 21:20:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=MHI92OzbTRuOfSGogKDicdkw31a8xsuWOtLJPqvNx58=; b=hMgR5HN4yLicvtzTkSenR0cUmaDMZ2bwQfTgqhAeBKkYQcwNCoeTgDZnEobu//usT8 Ay/dOOX+J6E7bJRr1XvMPGgkoPiBmdX/2xqSg4Vo/W4VrAXO8PjhbgR9yQwpkcG6nlLc fbSbfa7bfIC6dmEr9rWwGKtkDi8RmjSZPBvphT0Cy+BprGCLoZauID7MlPnWzO2oeVnj W6ncU98HPZzq8jlGTu5Jn0PazLejKzS6xdoK7HomnNLR4CDiAtYCpS9t6mX+ejA6rgCS MiqK8pSbDacX5XdtYXY4wYvzqcnyf+9CXm5yqWHtv880W6cgl7d+qF4GLWNLYoWwX9z8 t2kg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=MHI92OzbTRuOfSGogKDicdkw31a8xsuWOtLJPqvNx58=; b=kJlGXi04Ab9SNn3KCKrTMGGFhMk8ZhHtvbGPUAMFfkQTrz//gD/P71lHrIJ7xq77xF ZlryQ6GFBBCPmsxqAnLEOOwlIlSdhrLnoadTv032ASyMO76XEk2zep2Yx1QfIn0tDBwE QeXtWaMLl7tqB6ZU/E2vkXo36J2DMmyWv8ZiV1s/TVt3/wI4Vw6izWVbv/S8VNdEKPDG CkDoYnQNEnNxbCMAI2EIZ4S+qCMcm0Md6HbW6XobugUZ7v/G4xweZtBDxNeGU3K2Qr4Z WQ1yiyKWhfDogrrxUh9XJd1S6Xxexki/y2+2KLJOYkOh+zYonFG00GD0e0X1ihvN35VX JBsQ== X-Gm-Message-State: AOAM530yCXKgBMDodLLz7MN49xcoKF7Tu+4gkS7y5wSDVgFiVlc53aUk LInIn9y+iqRNluXlNmMy/O0GK8vb+UfBFTcMRmNszw== X-Received: by 2002:a19:da12:: with SMTP id r18mr4769335lfg.549.1622866806719; Fri, 04 Jun 2021 21:20:06 -0700 (PDT) MIME-Version: 1.0 References: <20210524132725.12697-1-apopple@nvidia.com> <20210524132725.12697-4-apopple@nvidia.com> <20210525183710.fa2m2sbfixnhz7g5@revolver> <20210604204934.sbspsmwdqdtmz73d@revolver> <20210605033926.pkeq2saomieebrqa@revolver> In-Reply-To: <20210605033926.pkeq2saomieebrqa@revolver> From: Shakeel Butt Date: Fri, 4 Jun 2021 21:19:55 -0700 Message-ID: Subject: Re: [PATCH v9 03/10] mm/rmap: Split try_to_munlock from try_to_unmap To: Liam Howlett Cc: Alistair Popple , "linux-mm@kvack.org" , "akpm@linux-foundation.org" , "nouveau@lists.freedesktop.org" , "bskeggs@redhat.com" , "rcampbell@nvidia.com" , "linux-doc@vger.kernel.org" , "jhubbard@nvidia.com" , "bsingharora@gmail.com" , "linux-kernel@vger.kernel.org" , "dri-devel@lists.freedesktop.org" , "hch@infradead.org" , "jglisse@redhat.com" , "willy@infradead.org" , "jgg@nvidia.com" , "peterx@redhat.com" , "hughd@google.com" , Christoph Hellwig Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 4, 2021 at 8:39 PM Liam Howlett wrote: > > > Particularly the following paragraph: > > ... > > Vlastimil Babka points out another race which this patch protects against. > > try_to_unmap_one() might reach its mlock_vma_page() TestSetPageMlocked a > > moment after munlock_vma_pages_all() did its Phase 1 TestClearPageMlocked: > > leaving PageMlocked and unevictable when it should be evictable. mmap_sem > > is ineffective because exit_mmap() does not hold it; page lock ineffective > > because __munlock_pagevec() only takes it afterwards, in Phase 2; pte lock > > is effective because __munlock_pagevec_fill() takes it to get the page, > > after VM_LOCKED was cleared from vm_flags, so visible to try_to_unmap_one. > > ... > > So this is saying the race with exit_mmap() isn't benign after all? > Yes, not benign at all.