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=-1.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 D7C5EC433DF for ; Mon, 18 May 2020 19:42:15 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 940E8207F5 for ; Mon, 18 May 2020 19:42:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="eghQgmRQ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 940E8207F5 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 1142D900003; Mon, 18 May 2020 15:42:15 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0C514900002; Mon, 18 May 2020 15:42:15 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F1C1C900003; Mon, 18 May 2020 15:42:14 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0057.hostedemail.com [216.40.44.57]) by kanga.kvack.org (Postfix) with ESMTP id D98AF900002 for ; Mon, 18 May 2020 15:42:14 -0400 (EDT) Received: from smtpin20.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 912D54427 for ; Mon, 18 May 2020 19:42:14 +0000 (UTC) X-FDA: 76830860988.20.dirt13_87f2f3ce72d16 X-HE-Tag: dirt13_87f2f3ce72d16 X-Filterd-Recvd-Size: 3403 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf50.hostedemail.com (Postfix) with ESMTP for ; Mon, 18 May 2020 19:42:14 +0000 (UTC) Received: from kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com (unknown [163.114.132.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A440920643; Mon, 18 May 2020 19:42:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1589830933; bh=oF7IhR6sg52j1XJLokffl+JRh2aq7CdtTjmwU6+Sth8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=eghQgmRQbj64PWGWC2pjySV1CgaF5LBoo2DwG+QKNJR+6L9j06rjcK8oXnRZ6qiZU toNZcgfIkOgrPlK0oZWXub6dm+a/FUHrHCiHaLV1sY9ZEJO3LM5D9CeGpqqojJgyDL zeGq1BHOialio2xxosyUgzHzopcxsiRzvQNyxhcs= Date: Mon, 18 May 2020 12:42:10 -0700 From: Jakub Kicinski To: Shakeel Butt Cc: Andrew Morton , Linux MM , Kernel Team , Tejun Heo , Johannes Weiner , Chris Down , Cgroups , Michal Hocko Subject: Re: [PATCH mm v3 3/3] mm: automatically penalize tasks with high swap use Message-ID: <20200518124210.37335d0b@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> In-Reply-To: References: <20200515202027.3217470-1-kuba@kernel.org> <20200515202027.3217470-4-kuba@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 Sun, 17 May 2020 06:44:52 -0700 Shakeel Butt wrote: > > Use one counter for number of pages allocated under pressure > > to save struct task space and avoid two separate hierarchy > > walks on the hot path. > > The above para seems out of place. It took some time to realize you > are talking about current->memcg_nr_pages_over_high. IMO instead of > this para, a comment in code would be much better. Where would you like to see the comment? In struct task or where counter is bumped? > > Take the new high limit into account when determining if swap > > is "full". Borrowing the explanation from Johannes: > > > > The idea behind "swap full" is that as long as the workload has plenty > > of swap space available and it's not changing its memory contents, it > > makes sense to generously hold on to copies of data in the swap > > device, even after the swapin. A later reclaim cycle can drop the page > > without any IO. Trading disk space for IO. > > > > But the only two ways to reclaim a swap slot is when they're faulted > > in and the references go away, or by scanning the virtual address space > > like swapoff does - which is very expensive (one could argue it's too > > expensive even for swapoff, it's often more practical to just reboot). > > > > So at some point in the fill level, we have to start freeing up swap > > slots on fault/swapin. > > swap.high allows the user to force the kernel to start freeing swap > slots before half-full heuristic, right? I'd say that the definition of full is extended to include swap.high.