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 39D41C433F5 for ; Thu, 17 Feb 2022 04:22:27 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6FF3D6B0074; Wed, 16 Feb 2022 23:22:26 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 686B36B0075; Wed, 16 Feb 2022 23:22:26 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4DA786B0078; Wed, 16 Feb 2022 23:22:26 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0216.hostedemail.com [216.40.44.216]) by kanga.kvack.org (Postfix) with ESMTP id 36D296B0074 for ; Wed, 16 Feb 2022 23:22:26 -0500 (EST) Received: from smtpin21.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id C314F8249980 for ; Thu, 17 Feb 2022 04:22:25 +0000 (UTC) X-FDA: 79150975050.21.EDE5C85 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf22.hostedemail.com (Postfix) with ESMTP id 52A06C0004 for ; Thu, 17 Feb 2022 04:22:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645071744; 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=jsHNKqs8sMpQeIjeGlGIhSZmEPrsyGStco+1CJJy4J4=; b=c1zC2IWQ7R8qE2repG5mXTT+NjYaTQCQA2x0ILVNTzrcL8Dn6hpnLdNlK+bc44QeJKGCLA hUfXaKg8xdlB15BsRJJcg/dWCqPJO0Qp5VgCmkLcTH3B0XJbnSdzFiThzvFJ6/LhyctrY8 aekjaE58BprjqAwohwnlgaTSYhz57rE= Received: from mail-pf1-f200.google.com (mail-pf1-f200.google.com [209.85.210.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-655-EbaL0vK6OPu3vif7QDERnQ-1; Wed, 16 Feb 2022 23:22:23 -0500 X-MC-Unique: EbaL0vK6OPu3vif7QDERnQ-1 Received: by mail-pf1-f200.google.com with SMTP id f128-20020a623886000000b004e152a2c149so2556881pfa.5 for ; Wed, 16 Feb 2022 20:22:23 -0800 (PST) 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:message-id:references :mime-version:content-disposition:in-reply-to; bh=jsHNKqs8sMpQeIjeGlGIhSZmEPrsyGStco+1CJJy4J4=; b=BaYuyO15zCYP/U2e3nM+7JnA4WKYOAWJGO2H3TyMhlbDXstdRLgYeSlj5rm0dex5D+ QfqamiPV/sqWY35yADQoqi9V7vmi7puKeNrtnUMIlXvGeuXKlqBW3jm8A4hba45ePs2o DJ04BKv5kLxeGisBl0uiCIxF6tlzuAGlMopaAno8zovSsytkfUj+oaLWnZlW78D2dXX+ uOs+fid8XfGQsBa8Xitg+yEfr4ngwpU0jtwAR6avQUzs6s9k7mbc7H6tEnwQRZ6ZXNcT hkJjONIccObCrVZwgYGdcHXJb+vgUZLb/ktwFXWJ8btFAtHUu/jrEk/fJC4+taci7jSL y//Q== X-Gm-Message-State: AOAM533ujuQ54VGdZci7NWAuEEyQim/5e7CsVbF+HHKHjSWoetcgG2JB F3sgXxprGMiuYHS+oBrcTAicepf/0TJ/348YhAEH/dR8UXkitboa6SIEAi9ANyK+agRYho9jVG6 7y+CikIF3l58= X-Received: by 2002:a63:804:0:b0:365:62b2:28a1 with SMTP id 4-20020a630804000000b0036562b228a1mr1022793pgi.146.1645071742542; Wed, 16 Feb 2022 20:22:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJxzatQDtItguYKWvjxxzFVQb2Ee0fT6oE3lB9g4Q+BrL4UMsaB+mFy9vjGoARR5VAgfcBX20w== X-Received: by 2002:a63:804:0:b0:365:62b2:28a1 with SMTP id 4-20020a630804000000b0036562b228a1mr1022768pgi.146.1645071742188; Wed, 16 Feb 2022 20:22:22 -0800 (PST) Received: from xz-m1.local ([94.177.118.126]) by smtp.gmail.com with ESMTPSA id bf4sm605576pjb.10.2022.02.16.20.22.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Feb 2022 20:22:21 -0800 (PST) Date: Thu, 17 Feb 2022 12:22:14 +0800 From: Peter Xu To: Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, "Kirill A . Shutemov" , Matthew Wilcox , Yang Shi , Andrea Arcangeli , John Hubbard , Alistair Popple , David Hildenbrand , Vlastimil Babka , Hugh Dickins Subject: Re: [PATCH v4 1/4] mm: Don't skip swap entry even if zap_details specified Message-ID: References: <20220216094810.60572-1-peterx@redhat.com> <20220216094810.60572-2-peterx@redhat.com> <20220216185455.c5af4f44f90b103971f34e1f@linux-foundation.org> MIME-Version: 1.0 In-Reply-To: <20220216185455.c5af4f44f90b103971f34e1f@linux-foundation.org> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 52A06C0004 X-Rspam-User: Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=c1zC2IWQ; spf=none (imf22.hostedemail.com: domain of peterx@redhat.com has no SPF policy when checking 170.10.129.124) smtp.mailfrom=peterx@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Stat-Signature: idgq64sk1j6uped94jffoexw3z3y7txc X-HE-Tag: 1645071745-214795 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 Wed, Feb 16, 2022 at 06:54:55PM -0800, Andrew Morton wrote: > On Wed, 16 Feb 2022 17:48:07 +0800 Peter Xu wrote: > > > The "details" pointer shouldn't be the token to decide whether we should skip > > swap entries. For example, when the user specified details->zap_mapping==NULL, > > it means the user wants to zap all the pages (including COWed pages), then we > > need to look into swap entries because there can be private COWed pages that > > was swapped out. > > I assume "user" here means "caller". Right. > > > Skipping some swap entries when details is non-NULL may lead to wrongly leaving > > some of the swap entries while we should have zapped them. > > > > A reproducer of the problem: > > > > ... > > > > The issue seems to exist starting from the initial commit of git. > > I'll add cc:stable to this one, thanks. Yes, thanks. I didn't yet check the backports to stable yet, some of them might need some tweaks on the patch. I'll follow that up when it hits it. -- Peter Xu