Received: by 2002:a17:90a:8504:0:0:0:0 with SMTP id l4csp4864845pjn; Tue, 29 Oct 2019 08:48:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqxuZqvvtQp4aLaOkVMh5mTMaPRZwczP8t8SR1ImPluOfbxJdnCGOTWs4ObQpQQa0Rzj2tOi X-Received: by 2002:a05:6402:7cd:: with SMTP id u13mr26781569edy.245.1572364133618; Tue, 29 Oct 2019 08:48:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572364133; cv=none; d=google.com; s=arc-20160816; b=hf2SDP3L7Aag7XZGNO5/ZTpLMUN00gTJiKLrtdCZjfVoI9ltFnDyN70YJlcNweYtMc 20hep42+rRJgU6zHOvR6mkPbWwTnneWne+204EfqctLenUzJQTb/9rruLgqnIrFhx8uR lG3bcZHJtaiFv0N8DdSF3nILhqn2ZEHKUJnQMyDZw4v2mvJfVhczQJ6N331qW8g/+EhH qlAKiUjOJpCweb1ssy0XUB3TsWMcmJ8uG/kvRApQ7Hm6r0G+pvrUHDlML4O0AKZ2tm0a YEdZDSk1bVA4ZhDZJSAYvcpsXbowNMMOZiHMxya+IGgTf+bzQDDDsZGgHPabbF2OJ7Xm vHSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=jBEwENFPDiTI0Tv4ACPfDqixaIF+4KZzeWBvvR41YGk=; b=bVCfo/GgbXggipf/7trKoM1auk670nSZhF6ZVY7cKqDVx1Zpdm2KhbLuKTS1s+H6SN fLi8YjSr6aT0VILDVQEAKJvCr2aum7b5qPRsV6/z3ZkaSghNvEmD7I83yXdwl1i2nD+k KSA9LvY8MlYeSbun8/SYpZHkfZxrIiPqXkpIiKwq9KiaJws83vI/MbKYCOyZWkBM0lic gtuFJH0cQg2nMFmw+P+2GnzguA0UapeUWsL1n1WaHCjziiAwuKlp2YxaoejLhCjy4bU8 y6N2K3v77XA9MosT8BZHm/kW3r+YxYUwCQgqMjibCX+DlUGhr0zubX/nWxCMOwes0DcG ljbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cmpxchg-org.20150623.gappssmtp.com header.s=20150623 header.b=rvC5HmMF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w7si1748355edj.96.2019.10.29.08.48.29; Tue, 29 Oct 2019 08:48:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@cmpxchg-org.20150623.gappssmtp.com header.s=20150623 header.b=rvC5HmMF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390108AbfJ2Pq7 (ORCPT + 99 others); Tue, 29 Oct 2019 11:46:59 -0400 Received: from mail-qk1-f196.google.com ([209.85.222.196]:45218 "EHLO mail-qk1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389836AbfJ2Pq6 (ORCPT ); Tue, 29 Oct 2019 11:46:58 -0400 Received: by mail-qk1-f196.google.com with SMTP id q70so12668902qke.12 for ; Tue, 29 Oct 2019 08:46:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=jBEwENFPDiTI0Tv4ACPfDqixaIF+4KZzeWBvvR41YGk=; b=rvC5HmMFf5bwMJE3zaaRWuN/o3uk+Xf9Sjy9wlzUFKA2J57CaA/HJDOQtTEJHklqGf TxoDmUQOl3BAShSIht19b+SUSV8F+VZ6DArhKMDtJN5aF/otuMSa0xtQbPN1sW4de1E/ bn2xzKsyHDkKfPMwDNHCTu6PvHb32vdambEssrzMgw9ejfIDHxt+nHJsDsijQuu+9jIA bnFWEndUd6h3PulCgdjyhHQi5oWwxSP2bw7ijkRMjXQZZSuQJXRFQOqawN/b0d0YM0B+ RGMxbbFtGZTAnX5vo0pVCmn+eaMrfp4kefWYskSM1OV3OPzuc4sKvSzRxzH1Hdw62l2A S5og== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=jBEwENFPDiTI0Tv4ACPfDqixaIF+4KZzeWBvvR41YGk=; b=EuUsrWR1aVDSD4Qc0wNBvq739DAZtfxFLl+xa/r8PuaxhgQfMauuGhjDfbBFv1hQnW zYAM/i+l0jNWr9G7Up+vB0DaX+gHgqXGcWNOw6OKI0NLYv5GW9soS5/OUZC6wIYLIMHm JZK99Ov8k8L+FM9R16nwJ+hw3lm9fRqsu/uH4CALf3momatya6RlEfTLwKyPJtaiPqfV kmGSiSBTlYKQWjpCQsLeMmsag0JsMtCL9xuwuRBZYGEW6eZ6MVIX4m17zGZ4lwVqZEh9 sQ0yUMrPa3olKBTRM+syPej7UZPQpf7XvhqZXGvYBC6D7EExQ+ejL01+DBQK4nsXp1c0 GrFg== X-Gm-Message-State: APjAAAUX8IADhfB3zyP2ZWiBimewmqnpxxJ274OobbO4/whib2ROn5yV 8ZsSLsdMgcv94sP0R/FlIy6kNQ== X-Received: by 2002:a37:9d12:: with SMTP id g18mr13783697qke.157.1572364016081; Tue, 29 Oct 2019 08:46:56 -0700 (PDT) Received: from localhost ([2620:10d:c091:500::7081]) by smtp.gmail.com with ESMTPSA id v186sm8285216qkb.42.2019.10.29.08.46.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Oct 2019 08:46:55 -0700 (PDT) Date: Tue, 29 Oct 2019 11:46:54 -0400 From: Johannes Weiner To: Hillf Danton Cc: linux-mm , Andrew Morton , linux-kernel , Chris Down , Tejun Heo , Roman Gushchin , Michal Hocko , Shakeel Butt , Matthew Wilcox , Minchan Kim , Mel Gorman Subject: Re: [RFC v2] memcg: add memcg lru for page reclaiming Message-ID: <20191029154654.GC33522@cmpxchg.org> References: <20191026110745.12956-1-hdanton@sina.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191026110745.12956-1-hdanton@sina.com> User-Agent: Mutt/1.12.2 (2019-09-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Oct 26, 2019 at 07:07:45PM +0800, Hillf Danton wrote: > > Currently soft limit reclaim is frozen, see > Documentation/admin-guide/cgroup-v2.rst for reasons. > > This work adds memcg hook into kswapd's logic to bypass slr, > paving a brick for its cleanup later. > > After b23afb93d317 ("memcg: punt high overage reclaim to > return-to-userland path"), high limit breachers are reclaimed one > after another spiraling up through the memcg hierarchy before > returning to userspace. > > We can not add new hook yet if it is infeasible to defer that > reclaiming a bit further until kswapd becomes active. > > It can be defered however because high limit breach looks benign > in the absence of memory pressure, or we ensure it will be > reclaimed soon in the presence of kswapd. I have no idea what this patch is actually trying to do. But this premise here, as well as the implementation, are seriously flawed. memory.high needs to be enforced synchronously. Current users expect workloads to be strictly contained or throttled by memory.high in order to ensure consistent behavior regardless of the host environment, as well as prevent interference with other workloads whose startup time could be slowed down by this lack of containment. On the implementation side, it appears you patched out reclaim but left in the throttling that's supposed to make up for failing reclaim. That means that once a cgroup tree's cache footprint grows past its memory.high, instead of simply picking up the cold cache pages, it'll get throttled heavily and see extreme memory pressure. It could take ages for it to grow to the point where kswapd wakes up. Nacked-by: Johannes Weiner