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 98ADEC433FE for ; Tue, 31 May 2022 12:58:28 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E62BC6B0072; Tue, 31 May 2022 08:58:27 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E11596B0073; Tue, 31 May 2022 08:58:27 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CB0A26B0074; Tue, 31 May 2022 08:58:27 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id B95246B0072 for ; Tue, 31 May 2022 08:58:27 -0400 (EDT) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 806BE2054B for ; Tue, 31 May 2022 12:58:27 +0000 (UTC) X-FDA: 79526041854.15.7513C9B Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf30.hostedemail.com (Postfix) with ESMTP id E74CB80055 for ; Tue, 31 May 2022 12:57:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654001906; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cJzRl/EAUUDSUoaXNS58+5bfHcPFBTMs+k9QJoMWfnM=; b=Te6ddr7wyeVbgAQki8hgiM9yTt22TQp95K9cClJoYWh+A5SLBMks+J0bOEn21HwFntxY5T nsE48vgfJYiO5wT7c4HAcMf8DJow9v4z0DYLjmpSDX+2sYjBSJHMsNavcBAW81wyO92PvN yd1cjEFhFuPbac0hD19kuXf6cd82isQ= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-263-lqiYzCZsOayRwKuGquxGwg-1; Tue, 31 May 2022 08:58:25 -0400 X-MC-Unique: lqiYzCZsOayRwKuGquxGwg-1 Received: by mail-wm1-f69.google.com with SMTP id l31-20020a05600c1d1f00b003974df9b91cso1416531wms.8 for ; Tue, 31 May 2022 05:58:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:organization:in-reply-to :content-transfer-encoding; bh=cJzRl/EAUUDSUoaXNS58+5bfHcPFBTMs+k9QJoMWfnM=; b=5iQgdWEvepNsRiQ2O7WXVVyT83yAPDp7qgYTRLLIPBDqZXOvufX0JD4WhESciGeaDw 89d475Lh9jcOEyxTgP3P0gEWd4Vd+eAoUzofGeyjgqbZ2E5L/oR66Rb/T3EgrMh7wvxE jx8YjA6gCrM1vWpPq0cBXr9AbVCqde6nEiOcWyfGdCGZzFvBD1TSAo0km9n8Ns9NSfl3 UkR8GnC0epMK+oasctPUFfW4Sfry6wja/xxT4vf3Jf42LQc08nXV2wI8Np5FXhhAc0pd TxcT6j+kharQUXdKLx3WdBfyxY8FYDjcyJRNa/IC87gUtN/Hgaa9erFHKXmfijP/7eAZ ZZig== X-Gm-Message-State: AOAM533Da0g0D3TLjHsPv0ZH7Y57NkSYT52OlNGAt1a309edy7BHmXo5 3xxiVMEsgk4Pb4ONaxUvCVuEUKFUcVXVftC2S6tuW1jKg2xN+dYdplU7ZNE5fadHCSQGq9eoomi em+KtfZTn1JQ= X-Received: by 2002:a5d:6dd1:0:b0:210:7a1:cda0 with SMTP id d17-20020a5d6dd1000000b0021007a1cda0mr22110700wrz.570.1654001904015; Tue, 31 May 2022 05:58:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz4lEZ2qYCcp+tZI59iZ53qvkpDUdPbWhwtv+KszQQJhbzbDUSUqZ4BFrX3BMLlZOcjJRvNkQ== X-Received: by 2002:a5d:6dd1:0:b0:210:7a1:cda0 with SMTP id d17-20020a5d6dd1000000b0021007a1cda0mr22110685wrz.570.1654001903796; Tue, 31 May 2022 05:58:23 -0700 (PDT) Received: from ?IPV6:2003:cb:c708:f100:8096:9368:ba52:a341? (p200300cbc708f10080969368ba52a341.dip0.t-ipconnect.de. [2003:cb:c708:f100:8096:9368:ba52:a341]) by smtp.gmail.com with ESMTPSA id s14-20020a7bc38e000000b003942a244ee7sm2053956wmj.44.2022.05.31.05.58.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 31 May 2022 05:58:22 -0700 (PDT) Message-ID: <33d6aec8-b4fc-aa37-27f4-f33984ea33d3@redhat.com> Date: Tue, 31 May 2022 14:58:21 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: [PATCH 2/3] mm/swapfile: avoid confusing swap cache statistics To: Miaohe Lin , Andrew Morton Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20220527092626.31883-1-linmiaohe@huawei.com> <20220527092626.31883-3-linmiaohe@huawei.com> <20220530160409.c9b17085adb6112d8580f37d@linux-foundation.org> From: David Hildenbrand Organization: Red Hat In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: E74CB80055 X-Rspam-User: Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Te6ddr7w; spf=none (imf30.hostedemail.com: domain of david@redhat.com has no SPF policy when checking 170.10.129.124) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Stat-Signature: 78dszded4c8ys61uqdbr8h7bpo3b13c6 X-Rspamd-Server: rspam05 X-HE-Tag: 1654001872-339743 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 31.05.22 04:55, Miaohe Lin wrote: > On 2022/5/31 7:04, Andrew Morton wrote: >> On Fri, 27 May 2022 17:26:25 +0800 Miaohe Lin wrote: >> >>> At swapoff time, we're going to swap in the pages continuously. So calling >>> lookup_swap_cache would confuse statistics. We should use find_get_page >>> directly here. >> >> Why is the existing behaviour wrong? swapoff() has to swap stuff in to >> be able to release the swap device. Why do you believe that this >> swapin activity should not be accounted? > > IMHO, statistics, e.g. swap_cache_info.find_success, are used to show the effectiveness > of the swap cache activity. So they should only reflect the memory accessing activity > of the user. I think swapoff can't reflect the effectiveness of the swap cache activity > because it just swaps in pages one by one. Or statistics should reflect all the activity > of the user including swapoff? I'm wondering who cares and why? -- Thanks, David / dhildenb