Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp1361634pxb; Fri, 21 Jan 2022 16:31:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJxyPF5Ni0fkRMskmj/3hhmpV6H6EHTIDSAginuZMW8tFExVsvuJWsAQSooGZcYpHmXpJWul X-Received: by 2002:a17:902:7fc8:b0:14a:e403:2f18 with SMTP id t8-20020a1709027fc800b0014ae4032f18mr6007076plb.45.1642811510713; Fri, 21 Jan 2022 16:31:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642811510; cv=none; d=google.com; s=arc-20160816; b=ZBcddNCv8YuGd4sSon1ZvkF1PcKAqEYnCqviwzz1MpfPxzD8N+oqZuj/b7EIS5yjaf 7P/IpXlxLHxsHO4HYYTCFOUX5QUdk2JrQsxw2Ce3HfWpUI+G0F5wDMozwN5nKlH2m0hY CVrh/ciwcLlRVkb65UMgS0LgHCx+EfkB3YaM38jGsTYuTO/wak4+ECkgRusSHDjzbVo/ SJZS4HlfDiSK/UWidr2TQGBATssnGwXDtGjmy9oHl/55CBF1nMIHyp38YCENuFGycMPt I535lJ7TcSJDYVvpRhFZ8seMeUe/ImYtrY1G2aLpxiHZXIh2NaHSqO5YBfbHvVoYMjsq Ddjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=OkumvMwJLc9ntXGBArQpKYeUdQGjlXx/6VBxX3jutYo=; b=IrGU/GePsq+PsECzx+V2yhUsDkWasaQP3S/HzCQC1AClvYqIDqZjl/MKHY+idUQZiy 3sHzmX4QhyA4cMUtkMFlesUQk2t1hopDBKLWoYZ99g8Pv9ZN9rlzJAMzmfn4vHG3Wxkf aB9VpAPFBJrvBjlzKascs9yv943dwPv/rVHnAgSK8vyTD3ITSMxCUqreKtJp2gA/pTpr Ua9IfX9yaI8eHICj0nfArKMYymPeXEbWtWYfPDdQ21IHipLlRHUiBF7ssUTmb6nJDaYp W1uMtk8Jd8dP/HE4O6HWB2GQl8PIaE/TALtzT5ISb1z/ePQohbsnP1Btkm03BM5Eivol QC8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=C1x0T2SQ; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c5si8131498plg.443.2022.01.21.16.31.38; Fri, 21 Jan 2022 16:31:50 -0800 (PST) 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=@redhat.com header.s=mimecast20190719 header.b=C1x0T2SQ; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232532AbiAUDLz (ORCPT + 99 others); Thu, 20 Jan 2022 22:11:55 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:28119 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232495AbiAUDLy (ORCPT ); Thu, 20 Jan 2022 22:11:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1642734714; 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=OkumvMwJLc9ntXGBArQpKYeUdQGjlXx/6VBxX3jutYo=; b=C1x0T2SQtQy+wu8UFR5K7yQ9EIcrJW2pSwzMXz3gxZpeGcSYSNToI/VR+OhixG4LVtsoOH +9o2GDlAeV280uX3Ft0Kn7B90m7mE9KkciMCEHOtTFCsQrHUO2Ar1B2bNMxzu3DoloetXT wNsWDask0DdISq+7l37eZ1wnl+bmKEc= Received: from mail-pf1-f198.google.com (mail-pf1-f198.google.com [209.85.210.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-373-vxaC2xUbOg6N7Mr73ND-Tg-1; Thu, 20 Jan 2022 22:11:52 -0500 X-MC-Unique: vxaC2xUbOg6N7Mr73ND-Tg-1 Received: by mail-pf1-f198.google.com with SMTP id u6-20020a056a00098600b004c603957575so2979543pfg.11 for ; Thu, 20 Jan 2022 19:11:52 -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=OkumvMwJLc9ntXGBArQpKYeUdQGjlXx/6VBxX3jutYo=; b=RfZLq4uSi5+HbCfcwugbtSHECXe8uujGdBQVhirkz1g0S9YKkfGsh85octnWad1TnG 4LUS0MZh5dMMDUOE7DuW9Nhn9/JF5CORVdUf3mThX1D6QO+oqRNDVvdpuE1o/l98SCC4 kZIAmBzy1y9o6Dp0VFghGFZGp48YPTRvsRAykGbpUZ/q7JuwkhQufJcQti0sBJgxLZi/ 5Gk13A/CW3fOcu4ZVftCBqHA3gQa4GAomkK621q3iR/lcTtreUURrxOs75+7yDavhkNQ mP7uHZu3WwGwY/js/w423J1ddh8ZCt3ozEbHSzR+wAPjPhcn1lGHqfrwoc3VwkxfJ0h2 ko/g== X-Gm-Message-State: AOAM530YC7xaHxFjxed1JmXrHedFHi23KVZwTzBwYkGxChgrUUoCIReL i5nHgZox+3DMLJmThoURTsfxPQXIIAO7ZVqgpGpD56a76Wj69UslmNfaLwUbKHR7gitJ+6tt/FA gaTH1QMoXWyFiDgR1aZsfW715 X-Received: by 2002:a63:83c1:: with SMTP id h184mr1463445pge.325.1642734711554; Thu, 20 Jan 2022 19:11:51 -0800 (PST) X-Received: by 2002:a63:83c1:: with SMTP id h184mr1463433pge.325.1642734711273; Thu, 20 Jan 2022 19:11:51 -0800 (PST) Received: from xz-m1.local ([94.177.118.81]) by smtp.gmail.com with ESMTPSA id c26sm3280650pgb.53.2022.01.20.19.11.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Jan 2022 19:11:50 -0800 (PST) Date: Fri, 21 Jan 2022 11:11:42 +0800 From: Peter Xu To: Hugh Dickins Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, David Hildenbrand , Andrea Arcangeli , Yang Shi , Vlastimil Babka , Andrew Morton , Alistair Popple , "Kirill A . Shutemov" , Matthew Wilcox Subject: Re: [PATCH RFC v2 1/2] mm: Don't skip swap entry even if zap_details specified Message-ID: References: <20211115134951.85286-1-peterx@redhat.com> <20211115134951.85286-2-peterx@redhat.com> <9937aaa-d9ab-2839-b0b7-691d85c9141@google.com> <391aa58d-ce84-9d4-d68d-d98a9c533255@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 20, 2022 at 06:32:29PM +0800, Peter Xu wrote: > > Except that here we have no page to check, so it looks like you'll > > have to change should_zap_page() to deal with this case too, or just > > check details->check_mapping directly. > > Yeah I prefer this, as we don't have the page* pointer anyway. > > > Which raises the question again > > of why I did not just use a boolean flag there originally: aah, I think > > I've found why. In those days there was a horrible "optimization", for > > better performance on some benchmark I guess, which when you read from > > /dev/zero into a private mapping, would map the zero page there (look > > up read_zero_pagealigned() and zeromap_page_range() if you dare). So > > there was another category of page to be skipped along with the anon > > COWs, and I didn't want multiple tests in the zap loop, so checking > > check_mapping against page->mapping did both. I think nowadays you > > could do it by checking for PageAnon page (or genuine swap entry) > > instead. > > It must be PageAnon already, isn't it? I think I see what you meant now.. I assume the special case is gone, how about I switch zap_mappings back into a boolean altogether in this patchset? Thanks, -- Peter Xu