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=-8.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 70E41C4338F for ; Tue, 10 Aug 2021 22:28:41 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E319760EBD for ; Tue, 10 Aug 2021 22:28:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org E319760EBD 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 155F78D0001; Tue, 10 Aug 2021 18:28:40 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 105D76B0072; Tue, 10 Aug 2021 18:28:40 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F35F88D0001; Tue, 10 Aug 2021 18:28:39 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0024.hostedemail.com [216.40.44.24]) by kanga.kvack.org (Postfix) with ESMTP id D5F876B0071 for ; Tue, 10 Aug 2021 18:28:39 -0400 (EDT) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 7B1901DE8D for ; Tue, 10 Aug 2021 22:28:39 +0000 (UTC) X-FDA: 78460611558.27.78C9C74 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf29.hostedemail.com (Postfix) with ESMTP id 03813900800C for ; Tue, 10 Aug 2021 22:28:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1628634518; 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=VrRk7NCVii511LC/4CvFm5xJa8XwB6LLB3JAlYEY82g=; b=Qpe/H3r3hjrBbwrkLuEVXW76LhM1RJZIWFW79d2K/rocXVz/uuaoiapZCC04IIB3lguBhF bs8UI1fJV3IEtf1zTIIZgQuGdeCgq11F5+qnUD2RVUShHPzc0fJUXDV2YrxCk+OmRJJaCG dHPbdadM8ZTQk2TH81KfBnEZsbGqKRk= Received: from mail-qv1-f71.google.com (mail-qv1-f71.google.com [209.85.219.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-518-8Qo7x6r7P8yeBqpasvX2EQ-1; Tue, 10 Aug 2021 18:16:36 -0400 X-MC-Unique: 8Qo7x6r7P8yeBqpasvX2EQ-1 Received: by mail-qv1-f71.google.com with SMTP id n14-20020a0c9d4e0000b0290354a5f8c800so82450qvf.17 for ; Tue, 10 Aug 2021 15:16:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=VrRk7NCVii511LC/4CvFm5xJa8XwB6LLB3JAlYEY82g=; b=rTL9P6VyZPsLuPqtD6LVPMitIZIpuwgN1XUEgXGOPIS616xu8Zva5vevlTCA6o4WmP 1SMgei+wXmjwC9equnFMhEVccpymC7HrCw0Q6Vj17nREVqoFGvVm0jk2d0JVPITTNF0U UwPlooqwhfBT4D8IUzSuWzwO3oN48XrPuD1MFCNzRZQ9TJ+ik9eugU6B3YyLouxix5i2 S0HM0tmlBdjq20BtlOruhS9OpvlYZB72bV8AeZ0O/nimRJ64kHrDZqLvK0iooZYmW2RD 6fd0N7Nxe7EP5wSgcg0/MMV73iEyZnyQj9vvl4r0iMh1aIAXk9SB6W6tXaMGL1AGGqVC p06w== X-Gm-Message-State: AOAM531EVqf7Y9pD2m/GsCoAQvCgu2GhPtDXFZqokYZ8678c+n6chyTQ 4tGjNPHsK77EdgzIYngZqnPcKm2gSdvpVY8qHTExaYtXYddeFLRZE0MqDjWrIaf3Pcn16SpahSJ UCo874H5ntL4= X-Received: by 2002:a05:620a:c04:: with SMTP id l4mr30231780qki.86.1628633795647; Tue, 10 Aug 2021 15:16:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz8xd1Ugstiha5cp1gVzbEgYKr80s3xO9Xb9Zbynmxdxx5oVp5ZEnUtzXZQKhLUK3hpzjvifw== X-Received: by 2002:a05:620a:c04:: with SMTP id l4mr30231759qki.86.1628633795444; Tue, 10 Aug 2021 15:16:35 -0700 (PDT) Received: from ?IPv6:2601:184:4180:af10::540e? ([2601:184:4180:af10::540e]) by smtp.gmail.com with ESMTPSA id l145sm1619955qke.92.2021.08.10.15.16.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 10 Aug 2021 15:16:35 -0700 (PDT) Subject: Re: [PATCH v3] vm_swappiness=0 should still try to avoid swapping anon memory To: Shakeel Butt , Johannes Weiner Cc: Linux MM , Andrew Morton , LKML , Rafael Aquini , Waiman Long , Michal Hocko , hakavlad@inbox.lv References: <20210809223740.59009-1-npache@redhat.com> From: Nico Pache Message-ID: Date: Tue, 10 Aug 2021 18:16:33 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 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-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 03813900800C Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="Qpe/H3r3"; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf29.hostedemail.com: domain of npache@redhat.com has no SPF policy when checking 170.10.133.124) smtp.mailfrom=npache@redhat.com X-Stat-Signature: opnpa1cm7ckdwuroecyimgpu5twgss77 X-HE-Tag: 1628634518-517721 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 8/10/21 5:17 PM, Shakeel Butt wrote: > On Tue, Aug 10, 2021 at 12:24 PM Nico Pache wrote: >> >> > [...] >>> >>> I'm wondering how you're getting anon scans with swappiness=0. If you >>> look at get_scan_count(), SCAN_FRACT with swappines=0 should always >>> result in ap = fraction[0] = 0, which never yields any anon scan >>> targets. So I'm thinking you're running into sc->file_is_tiny >>> situations, meaning remaining file pages alone are not enough to >>> restore watermarks anymore. Is that possible? >> >> Yes DEACTIVATE_ANON is enabling the file_is_tiny case in shrink_node(). That is what im trying to prevent in the swappiness=0 case. >> > > Can you please explain how DEACTIVATE_ANON is enabling the file_is_tiny case? You're right. Just did a second pass... I misinterpreted the assignment to file_is_tiny. This is not the case that is causing the issue. So back to the SCAN_FRACT case. From my testing the refaulting still seems to be causing the issue; however, to your point in earlier discussions, if swappiness=0 then the get_scan_count *should* be 0. So my patch does solve the issue by preventing the shrink_list from deactivating the anon, but it may be hiding some other issue that is the ultimate cause. Thanks for pointing that out! -- Nico