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 6ED87C433F5 for ; Fri, 21 Jan 2022 03:11:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9FE606B007D; Thu, 20 Jan 2022 22:11:55 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 9AC736B007E; Thu, 20 Jan 2022 22:11:55 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 874476B0080; Thu, 20 Jan 2022 22:11:55 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0127.hostedemail.com [216.40.44.127]) by kanga.kvack.org (Postfix) with ESMTP id 73CF76B007D for ; Thu, 20 Jan 2022 22:11:55 -0500 (EST) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 2091681904FD for ; Fri, 21 Jan 2022 03:11:55 +0000 (UTC) X-FDA: 79052819790.18.F697105 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf10.hostedemail.com (Postfix) with ESMTP id A1FA2C0002 for ; Fri, 21 Jan 2022 03:11:54 +0000 (UTC) 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-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-492-Bq4hdTbROqGoKk7ru3-Cdg-1; Thu, 20 Jan 2022 22:11:53 -0500 X-MC-Unique: Bq4hdTbROqGoKk7ru3-Cdg-1 Received: by mail-pf1-f200.google.com with SMTP id m13-20020a056a00080d00b004be40ef1fd9so5131240pfk.22 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=OzIQRpkiPNV7BWEzIjKmK0N4DK4oIDGVPBMeIjN3WrTEyFbvFdp0zrcUV8QET6z+QT VJpTAwTRB1bCua7fXT4e/wlPwaFBAGMqGm4PDQSxWII7+GB4lCQg5YfXYb4Juz9qF7Yd XfR+Z2/l3MPDTakMCx6frNM4JwXf84kK7mGZxqkvJ8YsL6Z1yaFR4TnB0zJPDR0irM8f gctxh+AumGVw4tgzzsq78RFHj1bBkUSPEKK+g/1GgdZ21m/5Vf1FmrlcEJjcKh2qwlWQ ScnKLdiYG/nQCvfobWBgRMdknk3FpiIcnK53WtC/wzqPNZomQtzxJq0D5SEdGBh9nqpD mdQw== X-Gm-Message-State: AOAM532g2LvqCiryfncVQevqh35FnhJ/pL4NeaEi1JDSXYEXC+OLrAGc C6MmUDg8ZnJASN1OmElB9qkftpqXqsv5+9WXG56uQeQJ196wiMiNFEsOLuWPlS3LqsE1iNLJR3t f5bVlQ4QJGjw= X-Received: by 2002:a63:83c1:: with SMTP id h184mr1463446pge.325.1642734711554; Thu, 20 Jan 2022 19:11:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJyZU2m8S9bDzSKL6be7T2AZvadR6Ba9axEaxLP5tgbOZuA4YXVrxj+0/ilH0RiVL5y/ZarW8A== 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 In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline X-Rspamd-Queue-Id: A1FA2C0002 X-Stat-Signature: jwyk9ymgb4t1ioza1ftzmwa19s5b963x Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=C1x0T2SQ; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf10.hostedemail.com: domain of peterx@redhat.com has no SPF policy when checking 170.10.133.124) smtp.mailfrom=peterx@redhat.com X-Rspamd-Server: rspam06 X-HE-Tag: 1642734714-931099 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, 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