Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp14939pxb; Tue, 12 Jan 2021 18:32:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJwltbprk95clHtvthCyWwBzs1ezLfnrWVu9yTUwHh5dpYqKxeQxbMVesP3pS3sxZo0kR8Ba X-Received: by 2002:a17:906:a015:: with SMTP id p21mr1296069ejy.49.1610505138714; Tue, 12 Jan 2021 18:32:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610505138; cv=none; d=google.com; s=arc-20160816; b=SR1sVzuwTMJG2ngQtWe7GDZ4Q5vXZe/KLj4Jj0j1AnPxsiBNoD5GEz7UnJvnwSzK+w 5lXBsQIaQUFC562obs5MFdL7+0moHIx6RvS45ULRIlbYIig8UuJcNUrh4787aVHB3C/t 0qY7o8txvVSkJdUAR5RNp2xVgl6gcXKaIoVAgC6B29to5ZTW+nrjfG8YuIsKHbkPsFhb w8K1KTCVNme4G76Q7H0PZ/MR05wkkreskoyuvIIcYZ192Zj0WqmJOTsP0V4SteALpHuy 8Ci1LlXfHbSbwaUDLsbsiUPXrUbuBUQzisiL/MRZEBy7hemRa1B/IhGxpvt01vH/Wvpt nrwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=5960geX9HCG16DZ39o4+2JHIAqK0nJMhnDxc5cpnSNU=; b=UJcm5z/ACS4Apyy8C63pl//Ji7eTyi2O2fvAm27nwCUKZ2JpQEe2a7IBh3SSlW4/N+ bC0EOx4V3EC4w6cfDYlnV+IICW+fOYleY5THfH4qX1+WezfK7THIu64QD3DQfrZcBp4o nlQqTxDaxAdrEQfCWiwgIFN3yQoSUriqK0Kueg21AuLQ3vUDxfqtZqRM7a6Amt0zPmMW FqImvINJp4299IqsZ4nA6wbc1DFkKxyqoDFYQ1+QyDqGneBCRiPzH0oTFqRhl2tyQvIz gKpElB3563VBcfukOzJsj3P53TT18kCFIrlt1oXBcoaFWAMhKbQS5bdOCGKIIlB+prSW IXPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=GkTjCKAT; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a14si288064eds.103.2021.01.12.18.31.55; Tue, 12 Jan 2021 18:32:18 -0800 (PST) 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=@google.com header.s=20161025 header.b=GkTjCKAT; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2437528AbhALVe3 (ORCPT + 99 others); Tue, 12 Jan 2021 16:34:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58354 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2436924AbhALU25 (ORCPT ); Tue, 12 Jan 2021 15:28:57 -0500 Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com [IPv6:2a00:1450:4864:20::12b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4DBA5C061794 for ; Tue, 12 Jan 2021 12:28:17 -0800 (PST) Received: by mail-lf1-x12b.google.com with SMTP id u25so5362317lfc.2 for ; Tue, 12 Jan 2021 12:28:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=5960geX9HCG16DZ39o4+2JHIAqK0nJMhnDxc5cpnSNU=; b=GkTjCKATdgwwzl5zWFKM/GZkJ8Ru5mD2K4+0F8dAgffuBUOVU+23PX0EQ32Blth15w JG7AF7Z66SHX+yZKqO4phDlR31DIpX/ncUdaDbhFLbNBCt8yLxNJ4dZS7u1rUVE6tpaH +HDiGZhynjjrtmmziGnzXsAsJ5iYJkxSXkDi1q7gwxJs9+p6ZKTagbX6o3TGF7DkFF+N 68trtXJdFXS/9iK8vcTYWckfat2CPb6DnRQ/pT2cX6VG/5Dh7iaiF44HAEPKNkdL90xT BXsKesBCDYzHOyFbbyEKIKnz4Jtp8aNIG2C6b3rUzc3TjWPq7dE55a+n0ogYYoHtyDj3 5p2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=5960geX9HCG16DZ39o4+2JHIAqK0nJMhnDxc5cpnSNU=; b=saGRObGAbShYqgfecYFTn/D3jN+NaygCSE6lEacwCMNpJy1ttN2n2qrHjvMw0GxGlj KYwSrqG0Zjrsg0Yq0FE1wV/WFh5AkR6QKG8ttEzpZ6qQWkme59lsDGC3c7yp0dzM+h+H uYGI4pkDtXZpKkxC4BXNF1u793t2+OFXQwTwAvYKbMhVBgos1rELurHHxzCK5w/dzWOY GOHQiQ9bir6ElX1+Fs1sovriUMlz56cV1P3SRPyFWB/ajcAcgdx4ICMOcGtfvIXLcyUQ WWdWRF0c43IsOqb88x/7bfjJGhtYCY+nKnHZRcNH8K2WQDMrIMjRfCagcI5d8aERASG7 KFIA== X-Gm-Message-State: AOAM533d1NtKh7j0XcAhQpYQuhpuhpA+TwXJcugoHgRNVhWYFI5eC5lS 88zPkkE7QHxthScxCqEsXPiTR2ePkFk64TZd0s97Xw== X-Received: by 2002:a05:6512:20c1:: with SMTP id u1mr258609lfr.549.1610483295372; Tue, 12 Jan 2021 12:28:15 -0800 (PST) MIME-Version: 1.0 References: <20210112163011.127833-1-hannes@cmpxchg.org> In-Reply-To: From: Shakeel Butt Date: Tue, 12 Jan 2021 12:28:04 -0800 Message-ID: Subject: Re: [PATCH] mm: memcontrol: prevent starvation when writing memory.high To: Johannes Weiner Cc: Andrew Morton , Tejun Heo , Roman Gushchin , Michal Hocko , Linux MM , Cgroups , LKML , Kernel Team Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 12, 2021 at 11:55 AM Johannes Weiner wrote: > > 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. > Good to add this in the commit message or at least mentioning that it happened in production. > > 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. Does it make sense to add this in the commit message as well? I am fine with either way. For the patch: Reviewed-by: Shakeel Butt