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 X-Spam-Level: X-Spam-Status: No, score=-6.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 36A09C433F5 for ; Wed, 8 Sep 2021 00:35:16 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B0AD861131 for ; Wed, 8 Sep 2021 00:35:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org B0AD861131 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id C53AD6B006C; Tue, 7 Sep 2021 20:35:14 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C03696B0071; Tue, 7 Sep 2021 20:35:14 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A7E016B0072; Tue, 7 Sep 2021 20:35:14 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0033.hostedemail.com [216.40.44.33]) by kanga.kvack.org (Postfix) with ESMTP id 98CBF6B006C for ; Tue, 7 Sep 2021 20:35:14 -0400 (EDT) Received: from smtpin02.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 5214B18121F97 for ; Wed, 8 Sep 2021 00:35:14 +0000 (UTC) X-FDA: 78562536948.02.ADA09F1 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by imf16.hostedemail.com (Postfix) with ESMTP id DECF6F00008E for ; Wed, 8 Sep 2021 00:35:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631061313; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=fZWZZr44GH/3iutnQw+25r6IM2aag3PM2R58Hrhuans=; b=PVtKmcHKOOyQgHNrqq3nWVDXeZjeUiMh0utWLgz+H6DdpYRlJXwZC0VohTBgShvJCTeOUR hKaUiqRFaBR2jS/0glKMvFHjNvB9ss5QsX3JLghhn2xc/RTU6ghbJxG6RzTyyA1atKs80b UaaglcSNE2n54n9srkBnu06JDK6w7Cg= Received: from mail-qt1-f199.google.com (mail-qt1-f199.google.com [209.85.160.199]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-547-JJ-KIx_bP9q2TNzzLWLPoA-1; Tue, 07 Sep 2021 20:35:12 -0400 X-MC-Unique: JJ-KIx_bP9q2TNzzLWLPoA-1 Received: by mail-qt1-f199.google.com with SMTP id o22-20020ac872d60000b029029817302575so851312qtp.10 for ; Tue, 07 Sep 2021 17:35:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=fZWZZr44GH/3iutnQw+25r6IM2aag3PM2R58Hrhuans=; b=D5MjYb2tbQK9iDzGxVqkW0UAVwNri1oyLxlTBghgFnln1yW7SNg2M6FNIhl9unK/nj v1ADlytXuL0E2i1HyBQbd7/G5D4vCvrRm1QEU4g2R4Kia0KLRj10ZCABqkeQ8HQboISm rxRHDFaCuXgmNMKaDhIvZm0zrZmj140HyQTEWNt7+ohJCsGTmGgeTKU/PVlorOL4LtC4 Mn3nB0qaLtDFJfDyxJTzLstX+kfC4oFwU0yXpcpN9tpdhf5e6XgaHNJV80k1Szv+klGG mbaXHZiXA9Tfe75r2kMixK9KvxZTJS1Dcrx6AXlJ/8rgu2n94R+sUgfnO9D4WfufaO97 71nQ== X-Gm-Message-State: AOAM530apV8BYfUK6Oe3i+2gSvC8a/uqfWCQN0ztVRhpkyr5RBjn3hme fE3RM/LvrYOUssaEY/jnT/es0GWA8NsncG9D4lOwSZMPsDkqRZcz+XL4gpLq95y//zgCbVJBG3Y EZzeMwNw/6ss= X-Received: by 2002:ac8:7194:: with SMTP id w20mr1173280qto.217.1631061311491; Tue, 07 Sep 2021 17:35:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxK7EAe+v1xcoVx0IGHKJI1Q/uNSOUvI9M0WpH70+Y9fErFaqUKyfL5O/cUYs2gyf92dD7LyA== X-Received: by 2002:ac8:7194:: with SMTP id w20mr1173257qto.217.1631061311219; Tue, 07 Sep 2021 17:35:11 -0700 (PDT) Received: from t490s ([2607:fea8:56a3:500::ad7f]) by smtp.gmail.com with ESMTPSA id d9sm489713qkn.124.2021.09.07.17.35.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Sep 2021 17:35:10 -0700 (PDT) Date: Tue, 7 Sep 2021 20:35:08 -0400 From: Peter Xu To: linux-kernel@vger.kernel.org, Andrew Morton , Hugh Dickins , linux-mm@kvack.org Cc: Andrea Arcangeli , Yang Shi , Matthew Wilcox , Jerome Glisse , Mike Rapoport , "Kirill A . Shutemov" , Miaohe Lin , David Hildenbrand , Alistair Popple Subject: Re: [PATCH v2 0/5] mm: A few cleanup patches around zap, shmem and uffd Message-ID: References: <20210902201721.52796-1-peterx@redhat.com> MIME-Version: 1.0 In-Reply-To: <20210902201721.52796-1-peterx@redhat.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=PVtKmcHK; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf16.hostedemail.com: domain of peterx@redhat.com has no SPF policy when checking 216.205.24.124) smtp.mailfrom=peterx@redhat.com X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: DECF6F00008E X-Stat-Signature: a4udh3xcnmwf3w851khs95ekfmonzhkj X-HE-Tag: 1631061313-3909 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 Thu, Sep 02, 2021 at 04:17:16PM -0400, Peter Xu wrote: > [Based on tag v5.14, but it should still apply to -mm too. If not, I can > repost anytime] > > Hugh, > > So I found one thing that I feel like a bug of commit 22061a1ffabdb9c3, but I'm > not sure. If that's the case, patch 5 of this series may be the fix for it. > > The problem is unmap_mapping_page() in current tree is calling > unmap_mapping_range_tree() with a details pointer, while by default when detail > pointer is specified, it means "we want to skip zapping swap entries". > > I didn't mention this in v1 simply because I thought it was fine, e.g., swap > entry won't be kept in shmem ptes so skipped is okay (it is never okay with > shmem uffd-wp but uffd-wp code is not landed yet). However I just remembered > there could also be e.g. shmem migration entries if I'm not wrong. From that > pov, skipping swap entries for unmap_mapping_page() seems wrong. Would you > please help check? I figured this seems to have no problem: firstly commit 22061a1ffabdb9c3 didn't really change the behavior of the code because previously it was using unmap_mapping_range(), which will always pass in a "details" pointer anyway. Meanwhile there won't be migration entry for this page because the new helper unmap_mapping_page() has page lock held, while migration requires that too during moving the pages. Anyway, sorry for the noise. I'll respin but drop these paragraphs, also in the last patch's commit message. -- Peter Xu