Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp2712245pxt; Mon, 9 Aug 2021 07:13:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxbKtCRBZKnolEe1Nc0mSHgu6dZtklfHm32hCSHQxJh+Dle69y4C6b/IsElWQ5GTqKX9TSu X-Received: by 2002:a05:6402:10d6:: with SMTP id p22mr15929917edu.168.1628518400232; Mon, 09 Aug 2021 07:13:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628518400; cv=none; d=google.com; s=arc-20160816; b=NEG/8cHxA4YcXqLDVuzlmpq6d7C/4jiHesHjleexSwW6/dHfyctk/C9aW4XwKFsUyk YRXfh37UuBerSArPzhKgpivWTpwh0mBV2pAjixN0P3EkxDuaBpyblsqyZfDQ/PlOdPC3 eJjE8QltbR2U74s0ZyCzCjDIAVUvwsM25QjHwFdoKCOVt5i/l0NwGfmTw7iH0kJpI0MT zSrJJuiDTBc5EBDd1GYmw6P6Q4xq0MCb9QapSFsyRmjaq1Y5wCP8EG6IbcR8BXc/mlLq nP+gpmn9etK+iCKbTvccItYovsWTzrOeQarNR0F7lc9e8w/N6LcuaIJbkY5vWjB8ONpU JHhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=PTbs/oAWdsEgUa8fNGlTSzW9u7qIXvDedRy0yP7NhHs=; b=FD+PDYBAzjE1/kdD+5PsR5CKXbZhfXESYFiNFdSbNPbFpA3Azz4LWr5/k7o2CmKqY6 5ssQKay4zDRcojKELoAgPhhRwEt3xeDochBrDojFu6ByGWdg1oAGBxQzoCDFBa2jrn2I zBAHzqDPcpsPa7DgUWFX+VoDQjh2nJQVgDUnk1LjzMagi/V/z9kOGlZm+EqgQGcXP7QG +JVNvr007la0WFuNDFBhugKW8rM3RzH6vlVBnXBhaPf8qnYKdCVUOqvBnYBA6IY00jMC sFQNbBgGAgaTcCOxNe+mDYsVens98R43b/AOF54DhorCA24qXsxIiPmRuT8x/gdWZLY9 JDGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b="iKDi+/fu"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g9si16802733ejk.6.2021.08.09.07.12.52; Mon, 09 Aug 2021 07:13:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b="iKDi+/fu"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234191AbhHILtl (ORCPT + 99 others); Mon, 9 Aug 2021 07:49:41 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:38948 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233512AbhHILtl (ORCPT ); Mon, 9 Aug 2021 07:49:41 -0400 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id EE3361FDCB; Mon, 9 Aug 2021 11:49:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1628509759; h=from:from:reply-to: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=PTbs/oAWdsEgUa8fNGlTSzW9u7qIXvDedRy0yP7NhHs=; b=iKDi+/fu4Gd8GxCi3jrRjW3J0vrQwJwVllhFySyBgCyikeLsyuwZuzHer6hzEfVM3ERyRy h8GScA/lbnan9QBPXttTNxHehkaMYkYlE4QwL+LwebbBM33kTIHSZBBb6Gow8B6s0Hthsz 8mgsqHHmk/q5Eg6ksB8Y+o9+5q4tXqo= Received: from suse.cz (unknown [10.100.201.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id BEC5FA3B89; Mon, 9 Aug 2021 11:49:19 +0000 (UTC) Date: Mon, 9 Aug 2021 13:49:19 +0200 From: Michal Hocko To: Shakeel Butt Cc: Nico Pache , Linux MM , Andrew Morton , LKML , Johannes Weiner , Rafael Aquini , Waiman Long Subject: Re: [PATCH] vm_swappiness=0 should still try to avoid swapping anon memory Message-ID: References: <20210806231701.106980-1-npache@redhat.com> <91605888-e343-2712-c097-bcade4cb389d@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri 06-08-21 22:23:48, Shakeel Butt wrote: > On Fri, Aug 6, 2021 at 6:37 PM Nico Pache wrote: > > > > > > On 8/6/21 9:00 PM, Shakeel Butt wrote: > [...] > > > If you are really seeing the said behavior then why will this fix it. > > > This is just about deactivating active anon LRU. I would rather look > > > at get_scan_count() to check why swappiness = 0 is still letting the > > > kernel to scan anon LRU. BTW in cgroup v1, the memcg can overwrite > > > their swappiness which will be preferred over system vm_swappiness. > > > Did you set system level swappiness or memcg one? > > > > This fixes the issue because shrink_list() uses the may_deactivate field > > to determine if it should shrink the active list. > > First, the shrink_list() will not be called for anon LRU if get_scan_count() > has decided to not scan the anon LRU. > > Second, I would like to get your attention to the following comment in > get_scan_count(): > > "Global reclaim will swap to prevent OOM even with no swappiness" > > It seems like the behavior you are seeing is actually working as intended. > You may decide to change that behavior but you will need to motivate the > change. Yes this is true. Only the memcg has a strict no swapping behavior historically. I do agree that the patch should go into much more details about the existing problem though. In this context it would be really good to explain why trashing over page cache is a better outcome than swapping out some pages. -- Michal Hocko SUSE Labs