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=-3.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,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 EBCF1C433DB for ; Tue, 12 Jan 2021 19:55:34 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 4DC66206C3 for ; Tue, 12 Jan 2021 19:55:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4DC66206C3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=cmpxchg.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id AB4076B00B6; Tue, 12 Jan 2021 14:55:33 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A62FD6B00B8; Tue, 12 Jan 2021 14:55:33 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 952EF6B00B9; Tue, 12 Jan 2021 14:55:33 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0246.hostedemail.com [216.40.44.246]) by kanga.kvack.org (Postfix) with ESMTP id 7E7AE6B00B6 for ; Tue, 12 Jan 2021 14:55:33 -0500 (EST) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 37C63362E for ; Tue, 12 Jan 2021 19:55:33 +0000 (UTC) X-FDA: 77698177746.24.comb16_020a99727518 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin24.hostedemail.com (Postfix) with ESMTP id 1732A1A4AA for ; Tue, 12 Jan 2021 19:55:33 +0000 (UTC) X-HE-Tag: comb16_020a99727518 X-Filterd-Recvd-Size: 4279 Received: from mail-qk1-f171.google.com (mail-qk1-f171.google.com [209.85.222.171]) by imf47.hostedemail.com (Postfix) with ESMTP for ; Tue, 12 Jan 2021 19:55:32 +0000 (UTC) Received: by mail-qk1-f171.google.com with SMTP id n142so3058612qkn.2 for ; Tue, 12 Jan 2021 11:55:32 -0800 (PST) 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; bh=r3RcTfMe7SWAKR9ZPaILuwCLkjEw52kXwdvMKFbxE+Y=; b=xNb+jXyynOtMDGYrXvcjUcO1CyQWacGxvJvRvEKyedu3WJVOTOZbv25S2m8yr5PD/y esanXfysmROgybxXxP9XniQQQPP+U2ROGwezs7psAGDv45Xpm5aWrVI8oSxAVXF1XtCn j5i8fxDNcSlJlDnjAONEV3qx3q4PnJeW4KW1ON266+jtRWCH+DPrg2eRcpmlBAutB4/a zBURoO0FdYjVF4uJ1NUQ1lfOMejaHhbbPKJeIoEd394wvVxBNxnPBewf6fmWsbc25Qg+ SDeiRf0JkL/dhE75JqCf1XLpbdDd2fNM/edlnqtoxuKLhsbdAoz1qszvoTfX+R/IRXXI yQEg== 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; bh=r3RcTfMe7SWAKR9ZPaILuwCLkjEw52kXwdvMKFbxE+Y=; b=fhXQN+YIfFUewG617PQYzaX0KYEeYWw7df91t50I71Sz7Mwhjfy4l9y4OVYdGDjUjD Dcxkwk6CxM/9yRfjzSP7OpXFNXRogskCDpDXkIaunu7mWySOfPtnfUHw2rL3PinBLNrd NVLC7pcNRNrAYKoTiiqycLKvmoGnL9dd0xYXL43kl1kRtWxKpA2b/Ma/4yK7DjdLrWQJ 2H19Y0TmDuBNEFi87lsotszj8Da+n9rYo0RPqWCfzKgko3I5ybPFVMbIptgqnwi6mmaV 85A0qy1c+xiWbVdxmeWy9flNUFPpOC+YS6CD9TwMOHG/L87HNn+3brrFbobJ3nfwBafH 7EXQ== X-Gm-Message-State: AOAM5318sef84q95D12D9fBqU21lawB5NJonzmvqC4CmxFxCBEPkLYT1 U7wU0s8agDT+mwxwyZx5Vz2Wzw== X-Google-Smtp-Source: ABdhPJwdUOjZbwgAjqIx7Tyovg//RyInPzy5cdF3Vi8RfEjZFc9IuJzEagAhiIGiiOsn5iaIARk4kA== X-Received: by 2002:a37:6382:: with SMTP id x124mr1081695qkb.398.1610481331701; Tue, 12 Jan 2021 11:55:31 -0800 (PST) Received: from localhost ([2620:10d:c091:480::1:1fb4]) by smtp.gmail.com with ESMTPSA id 127sm1937307qkj.51.2021.01.12.11.55.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Jan 2021 11:55:31 -0800 (PST) Date: Tue, 12 Jan 2021 14:53:06 -0500 From: Johannes Weiner To: Shakeel Butt Cc: Andrew Morton , Tejun Heo , Roman Gushchin , Michal Hocko , Linux MM , Cgroups , LKML , Kernel Team Subject: Re: [PATCH] mm: memcontrol: prevent starvation when writing memory.high Message-ID: References: <20210112163011.127833-1-hannes@cmpxchg.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Tue, Jan 12, 2021 at 10:59:58AM -0800, Shakeel Butt wrote: > On Tue, Jan 12, 2021 at 9:12 AM Johannes Weiner wrote: > > > > When a value is written to a cgroup's memory.high control file, the > > write() context first tries to reclaim the cgroup to size before > > putting the limit in place for the workload. Concurrent charges from > > the workload can keep such a write() looping in reclaim indefinitely. > > > > Is this observed on real workload? Yes. On several production hosts running a particularly aggressive workload, we've observed writers to memory.high getting stuck for minutes while consuming significant amount of CPU. > Any particular reason to remove !reclaimed? It's purpose so far was to allow successful reclaim to continue indefinitely, while restricting no-progress loops to 'nr_retries'. Without the first part, it doesn't really matter whether reclaim is making progress or not: we do a maximum of 'nr_retries' loops until the cgroup size meets the new limit, then exit one way or another.