Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1978418imm; Thu, 24 May 2018 03:57:13 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrfQuYYbH1YO93amytekaND+6zKRe8Jp/Ifx499CeknIHXElAINwC0dTD7mqWOSLYEeifbE X-Received: by 2002:a17:902:9344:: with SMTP id g4-v6mr6969653plp.10.1527159433870; Thu, 24 May 2018 03:57:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527159433; cv=none; d=google.com; s=arc-20160816; b=FCHb2FxOFImY5Nl00xhf5iQBbGTLjwnOlEoUXqpFZBP0dzHYoR5P4obmtwFxg4ZVbu GEBwg+E7XFyf9JIOxrbUWAxpOCLI1oL5kIRen2TQL9/MCGOQRywhw89as1qTu0YbyTxp uD7PAkNfps2mco/bwEMf18V1T3If79o+QtmaXCvIecGPEj+Def4/kWyxbPdpWHb4Uazx 2MPBF4yylv4YuTppph36JTISeO9HhDBH8rYsiaKkN1jVW1CJXtOMyXPP6lFx504B5Xas L/t5UPuuxd6wmsffVCSVWxJSsnKiBwFae+CLlgKBoMITyb5ZYAJQtDi4ZRpxEmao+OuA H+iA== 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:arc-authentication-results; bh=jAgB+ewoA1lIaVFFJPTdhDcXJyK6VuizSn/pkijudyM=; b=pV49adQaMy5CztoFyB1+4SuFpkpz/SCEMatS9zAe1vyBSsflsRf7KAFRDWQAsqOr7N 6/BBEeLSxj1hgUYNryoL3XQC0gfpF/PGXdNGi3RaO4VFBHsfY912wmHXDJBBtGE1hkyW O4TzNtRIn/2A+iHHuVAIZ4PJyrsAr9uI+QP6SBiL6misXTv+zu4vZ2X6LRBpdkrj02Az qd+DhVLsjZzAXuiE89X7wh95v7mT7OiffB51DDiSYOgoTIdR6ndP0lucemrlmrFO9mbJ 3vsV9Rd4M+RUoF/mdCaW+9gqICjRnk67L9e2VVRQcGHyLFd97FMAUtQju3TQDZZ5gGwC 3fVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@cmpxchg.org header.s=x header.b=JeI4mUa+; 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 u6-v6si20013423pfm.183.2018.05.24.03.56.58; Thu, 24 May 2018 03:57:13 -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=fail header.i=@cmpxchg.org header.s=x header.b=JeI4mUa+; 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 S1032605AbeEXK4M (ORCPT + 99 others); Thu, 24 May 2018 06:56:12 -0400 Received: from gum.cmpxchg.org ([85.214.110.215]:51940 "EHLO gum.cmpxchg.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030314AbeEXK4H (ORCPT ); Thu, 24 May 2018 06:56:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=cmpxchg.org ; s=x; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject: Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=jAgB+ewoA1lIaVFFJPTdhDcXJyK6VuizSn/pkijudyM=; b=JeI4mUa+IPwyxs4YdlbEK07w/U VrBOz0KZOQhE69MVpYvyGbolnNmX7/opV5QKkZNT4x20O5HpZ/XfztbYzn9dT0lI1qMbmeozNiJL9 WrFspP2yyCsQIdyep91WoldcVyeQ4YpoaqAl7q+lgrf5rrOsiGJD1POozV+UBwWaZAtc=; Date: Thu, 24 May 2018 06:58:07 -0400 From: Johannes Weiner To: Tejun Heo Cc: Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel-team@fb.com, Michal Hocko , Shaohua Li , Rik van Riel , cgroups@vger.kernel.org Subject: Re: [PATCH REPOST] mm: memcg: allow lowering memory.swap.max below the current usage Message-ID: <20180524105807.GA1362@cmpxchg.org> References: <20180523185041.GR1718769@devbig577.frc2.facebook.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180523185041.GR1718769@devbig577.frc2.facebook.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 23, 2018 at 11:50:41AM -0700, Tejun Heo wrote: > Currently an attempt to set swap.max into a value lower than the > actual swap usage fails, which causes configuration problems as > there's no way of lowering the configuration below the current usage > short of turning off swap entirely. This makes swap.max difficult to > use and allows delegatees to lock the delegator out of reducing swap > allocation. > > This patch updates swap_max_write() so that the limit can be lowered > below the current usage. It doesn't implement active reclaiming of > swap entries for the following reasons. > > * mem_cgroup_swap_full() already tells the swap machinary to > aggressively reclaim swap entries if the usage is above 50% of > limit, so simply lowering the limit automatically triggers gradual > reclaim. > > * Forcing back swapped out pages is likely to heavily impact the > workload and mess up the working set. Given that swap usually is a > lot less valuable and less scarce, letting the existing usage > dissipate over time through the above gradual reclaim and as they're > falted back in is likely the better behavior. > > Signed-off-by: Tejun Heo > Acked-by: Roman Gushchin > Acked-by: Rik van Riel > Cc: Johannes Weiner > Cc: Michal Hocko > Cc: Shaohua Li > Cc: linux-kernel@vger.kernel.org > Cc: linux-mm@kvack.org > Cc: cgroups@vger.kernel.org Acked-by: Johannes Weiner