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 86B21C433F5 for ; Tue, 19 Apr 2022 23:54:58 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9C84C6B0071; Tue, 19 Apr 2022 19:54:57 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 977CD6B0072; Tue, 19 Apr 2022 19:54:57 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7F03C6B0074; Tue, 19 Apr 2022 19:54:57 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.a.hostedemail.com [64.99.140.24]) by kanga.kvack.org (Postfix) with ESMTP id 6D1696B0071 for ; Tue, 19 Apr 2022 19:54:57 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 346912291F for ; Tue, 19 Apr 2022 23:54:57 +0000 (UTC) X-FDA: 79375286634.10.902AAC2 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf24.hostedemail.com (Postfix) with ESMTP id 07DAC18001B for ; Tue, 19 Apr 2022 23:54:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650412495; 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=/CtOAsqipYaegNyqlf3dMB9JRSjBcThm9Deq+uceP3g=; b=bKpYa6VXbpvOvlDgUHO/SLEe2ERStKMqDe4jCKB1TtS/dhHa4qInQBoDmV0fJ0PsG/nI4u Jih/gHz4SBsd3CT3SZndf4AXjyd8raRn5REhSkpT2a1uVAwnUi7rsPh3hFEVXlee/+yGxB fyCMTk3N+EbIRpE7W3BIdsIwDO2ifHc= Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-325-aMe-95UpOTGIn4bjj7W_Ug-1; Tue, 19 Apr 2022 19:54:54 -0400 X-MC-Unique: aMe-95UpOTGIn4bjj7W_Ug-1 Received: by mail-qk1-f198.google.com with SMTP id u7-20020ae9d807000000b00680a8111ef6so95071qkf.17 for ; Tue, 19 Apr 2022 16:54:54 -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:in-reply-to :content-transfer-encoding; bh=/CtOAsqipYaegNyqlf3dMB9JRSjBcThm9Deq+uceP3g=; b=XzKamSkjXGzdR6zlN2d9re3Pj/Jnhx3ZnIxQdhat74qjuBMmMF+hC7C3p9brBPMO9L Y8S/qqhGDRk65PH5oj6LvNESZTx2ZeCRmIj6Uh+dYqjMHXkJmDO/DldnkkEuxM2rk9Io SE9sD0mDEig/OsqNJgv4fMKmyIZ1KQwI6tX4C0ohdq0CQkMEA2CTMR+8vm4EpO8XCLHV 4N3m0BGzN7s+PTloR4SWN3ghxYZ7a/oT4Uf+liJ2Z14jGO1dITyK0GR3Jr8SazEKNgep K7aBBYliQ+pby8vMIVccWWjlPVcxke78QcYySuhE1zgxVtGV40AmfFFDT/ze4q1cjgL8 IHeg== X-Gm-Message-State: AOAM532E97sWcNukhZqcJpxCUfYbHe5cDYb/8zOsCgMa5GYuXf4/JeC4 zD/lQ10NjDCZCvNIaaLRXWb0xn3U/DzyVKnoazhYYnMTrrQeXgcv712tAy1PLgmZ+snyYaC/nmM K9uHxVgkSMLY= X-Received: by 2002:ac8:5fcb:0:b0:2e1:ebd9:3e29 with SMTP id k11-20020ac85fcb000000b002e1ebd93e29mr12370792qta.147.1650412493889; Tue, 19 Apr 2022 16:54:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy8+Xtf6UIY4XpCfjOMG4fYln4lyceOvwkt9e587mNGkPBqDDjg/sMiZKacJgzU7+vMgZf0wg== X-Received: by 2002:ac8:5fcb:0:b0:2e1:ebd9:3e29 with SMTP id k11-20020ac85fcb000000b002e1ebd93e29mr12370780qta.147.1650412493674; Tue, 19 Apr 2022 16:54:53 -0700 (PDT) Received: from [192.168.0.188] ([24.48.139.231]) by smtp.gmail.com with ESMTPSA id p14-20020a05622a13ce00b002f20a695972sm890439qtk.14.2022.04.19.16.54.52 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 19 Apr 2022 16:54:53 -0700 (PDT) Message-ID: Date: Tue, 19 Apr 2022 19:54:52 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH v3] vm_swappiness=0 should still try to avoid swapping anon memory To: Johannes Weiner Cc: linux-mm@kvack.org, akpm@linux-foundation.org, linux-kernel@vger.kernel.org, aquini@redhat.com, shakeelb@google.com, llong@redhat.com, mhocko@suse.com, hakavlad@inbox.lv References: <20210809223740.59009-1-npache@redhat.com> From: Nico Pache 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-Server: rspam10 X-Rspamd-Queue-Id: 07DAC18001B X-Stat-Signature: 13d3dpzfznwgdqj8mkbu5qe9u9t56qwe Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=bKpYa6VX; spf=none (imf24.hostedemail.com: domain of npache@redhat.com has no SPF policy when checking 170.10.129.124) smtp.mailfrom=npache@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Rspam-User: X-HE-Tag: 1650412494-69211 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 4/19/22 14:46, Johannes Weiner wrote: > Hi Nico, > > On Tue, Apr 19, 2022 at 02:11:53PM -0400, Nico Pache wrote: >> I think its is important to note the issue we are seeing has greatly improved >> since the initial posting. However we have noticed that the issue is still >> present (and significantly worse) when cgroupV1 is set. >> >> We were initially testing with CgroupV1 and later found that the issue was not >> as bad in CgroupV2 (but was still an noticeable issue). This is also resulting >> in the splitting of THPs in the host kernel. > > When swappiness is 0, cgroup limit reclaim has a fixed SCAN_FILE > branch, so it shouldn't ever look at anon. I'm assuming you're getting > global reclaim mixed in. Indeed, I think we can try harder not to swap > for global reclaim if the user asks for that. > > Can you try the below patch? Sadly this did not fix the V1 case. I will have to go back through my notes and over the code again to find what difference between the two may be causing this issue. Im just starting to focus on this issue again so my memory needs some refreshing of where I was last at. The good news is that with the current state of upstream the issue of swap storms tearing down THPs seems to be minimized to sane amount with V2. My swappiness=0 solution was a minimal approach to regaining the 'avoid swapping ANON' behavior that was previously there, but as Shakeel pointed out, there may be something larger at play. Cheers, -- Nico