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 13927C4338F for ; Mon, 9 Aug 2021 21:19:38 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7EBE660EB9 for ; Mon, 9 Aug 2021 21:19:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 7EBE660EB9 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 B7F846B0071; Mon, 9 Aug 2021 17:19:36 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B2F7C6B0072; Mon, 9 Aug 2021 17:19:36 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A1E188D0001; Mon, 9 Aug 2021 17:19:36 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0084.hostedemail.com [216.40.44.84]) by kanga.kvack.org (Postfix) with ESMTP id 8A1686B0071 for ; Mon, 9 Aug 2021 17:19:36 -0400 (EDT) Received: from smtpin02.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 2D36B8249980 for ; Mon, 9 Aug 2021 21:19:36 +0000 (UTC) X-FDA: 78456808752.02.9511879 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by imf02.hostedemail.com (Postfix) with ESMTP id AE41B7001738 for ; Mon, 9 Aug 2021 21:19:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1628543975; 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=f5YVhdAcO6l+JL131v6pp68KDpwBPXY9dHoGr3Aj3qU=; b=aoQnqdOXoOnlMwy6uJZSCZ1zV2vm95tmUIh1/U6eyf+tPXJxLP8aRyZmYCR4yzoQ+1FB8P MVZGK6Da5CPSA7kfuqIrdkX1fnCXW2kuUOxmf4NpTs6JABlv/h2EKrnJiyBWokPmRk7A90 qEpD6DJSW5AOLX7N6ReCY+EimSzgxo8= Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-127-4EnaumG9MuKn6xqMUFMhaQ-1; Mon, 09 Aug 2021 17:19:33 -0400 X-MC-Unique: 4EnaumG9MuKn6xqMUFMhaQ-1 Received: by mail-qk1-f199.google.com with SMTP id o6-20020a05620a0546b02903d22e7d9864so2490072qko.16 for ; Mon, 09 Aug 2021 14:19:33 -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-transfer-encoding :content-language; bh=f5YVhdAcO6l+JL131v6pp68KDpwBPXY9dHoGr3Aj3qU=; b=Cxqj1AdGZoGpK0vl7GKUvoHCKhHukbPsUFHBqOhJrYNBFJfWFy4zUFz0Jkzp0vrq3/ k0Lo+JqXqf0LpH+wFOJoY/OfJUSX0FRQWQpMOzEzp/VOzdfH0JTIlxp2BNBiSVJ+2mJ3 KZZLzmuVoGLLAh4SuxXbqhJvm5io3mCETKdbVDqJMZpL57ylV6uFZdJnLkhBHKbmqhuY 4SEsgxskgd12k1j9zCWNjkMQgnY53rWEIqemYqJHz4/swwWN5O5BnxqrHAAmKA9QLLJq 6GbTEZn+AVbEbxEoElbWGE+unnkT/ibnkdMzwHZYcmlutBmHhoGxN5CIxZGND0D+iMuB Yzcw== X-Gm-Message-State: AOAM5306jpZ1w9bb1osJIO2ID487ISfCdbBnkVeZUUIN+4SFrfzyQPtm SsMtRWDF1fk+doZ9/RfULpfHFStUar8uBGtrwsdnq/biCZcYIVjlJiWFIu6iQEuQZGVJ7GarBz5 cr2u/VdEoSS8= X-Received: by 2002:ac8:4743:: with SMTP id k3mr21805511qtp.124.1628543973576; Mon, 09 Aug 2021 14:19:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwMv6D5mkTgs9VqqyMzS/viI7LG43ru1BwIUMuzxkPVULikVpRvSTJFN9CYAqWG9biHqErsLg== X-Received: by 2002:ac8:4743:: with SMTP id k3mr21805502qtp.124.1628543973395; Mon, 09 Aug 2021 14:19:33 -0700 (PDT) Received: from localhost.localdomain ([2601:184:4180:af10::540e]) by smtp.gmail.com with ESMTPSA id j2sm7245809qtn.46.2021.08.09.14.19.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 09 Aug 2021 14:19:32 -0700 (PDT) Subject: Re: [PATCH v2] vm_swappiness=0 should still try to avoid swapping anon memory To: Alexey Avramov Cc: linux-mm@kvack.org, akpm@linux-foundation.org, linux-kernel@vger.kernel.org, hannes@cmpxchg.org, aquini@redhat.com, shakeelb@google.com, llong@redhat.com, mhocko@suse.com References: <20210807022129.8842-1-npache@redhat.com> <20210807151424.76b4ee3a@mail.inbox.lv> From: Nico Pache Message-ID: Date: Mon, 9 Aug 2021 17:19:31 -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: <20210807151424.76b4ee3a@mail.inbox.lv> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: AE41B7001738 Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=aoQnqdOX; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf02.hostedemail.com: domain of npache@redhat.com has no SPF policy when checking 216.205.24.124) smtp.mailfrom=npache@redhat.com X-Stat-Signature: 9df88kh5a37u3zrkpxtzm1fgoa8pi9a7 X-HE-Tag: 1628543975-588878 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/7/21 2:14 AM, Alexey Avramov wrote: >> vm_swappiness=0 should still try to avoid swapping anon memory > Swapping with swappiness=0 depends on vm.watermark_scale_factor. > Decrease vm.watermark_scale_factor to avoid swapping and get OOM, > and increase vm.watermark_scale_factor to get successful swapping > even with swappiness=0. > > Maybe I misunderstood you and you are solving some new problem? The problem is new; however, the two workloads that are now running into this issue are not new (one is as old as RHEL5). Sorry the issue was attributed to the wrong commit in my V1/V2 posting. This may have caused some confusion. The actual commit to blame is 170b04b7ae49 ("mm/workingset: prepare the workingset detection infrastructure for anon LRU"). I will be posting my V3 soon. It has a much better commit log and fixes a issue that was present in my V2. This new change allows for challenging the anon memory at a much greater rate. I believe this is ok since it will cause less trashing; however, it may also be the case that the user wants to avoid paying the cost of writing the anon to swap, and would rather throttle the page reads (like has been the case since at least rhel5). Hopefully my V3 clears up a lot of the questions asked, and my motivations for these changes is more clear. Cheers! -- Nico