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=-18.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL autolearn=ham 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 49BC1C433E0 for ; Tue, 12 Jan 2021 20:28:19 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D37C62311B for ; Tue, 12 Jan 2021 20:28:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D37C62311B Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 2FCCC6B00CB; Tue, 12 Jan 2021 15:28:18 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 2860E6B00CC; Tue, 12 Jan 2021 15:28:18 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 14F006B00CD; Tue, 12 Jan 2021 15:28:18 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0114.hostedemail.com [216.40.44.114]) by kanga.kvack.org (Postfix) with ESMTP id EC6E06B00CB for ; Tue, 12 Jan 2021 15:28:17 -0500 (EST) Received: from smtpin05.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id AEFD91EE6 for ; Tue, 12 Jan 2021 20:28:17 +0000 (UTC) X-FDA: 77698260234.05.tiger00_5c0f65b27518 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin05.hostedemail.com (Postfix) with ESMTP id 90C1E1802EC10 for ; Tue, 12 Jan 2021 20:28:17 +0000 (UTC) X-HE-Tag: tiger00_5c0f65b27518 X-Filterd-Recvd-Size: 4328 Received: from mail-lf1-f48.google.com (mail-lf1-f48.google.com [209.85.167.48]) by imf39.hostedemail.com (Postfix) with ESMTP for ; Tue, 12 Jan 2021 20:28:17 +0000 (UTC) Received: by mail-lf1-f48.google.com with SMTP id m12so5321414lfo.7 for ; Tue, 12 Jan 2021 12:28:16 -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=iGm9rOjxsSk+BSGUt8b3a/v3ycTlmSY2yT626/K+ApsJIqu4k3htoA6svVv5+IhOUt Wk5mSxf0/UtwvK1h6VJwv9t43iXclizRHcvMoSDUtH7icDuxfuio3Q2Qs4zIJ/8Kl6m6 Z4D25wi+Z6qkpXeX34ZAuwuzBjQFlfYQ3USZaUNjVa4ovBFPPEVwjNurIyNJdNxG5nlX GFOrlrKM7MBU++4SYAg4aflI7mVKQJkLIsBZHEXt/RCKHvEXixqIWsqK3Fv2zrzJgmDZ p0+7yA4M8rn8L02oaNvo1TxCTmjvTq/T6igdLilwKDGeTsxPHgpX35fdqZKOdAjsKrak 3Vzw== X-Gm-Message-State: AOAM5309RK453rl+e/Htm3btdDgP2uWzSJVPD7Cz3/C/5hL4T/w0vt0J f9Ea81A17zEqu6aFooE45VNgXS4d1ZI7IRVTuav5fw== X-Google-Smtp-Source: ABdhPJwCQ+KHw0YYH7t/aGGO4JPatl+HtEdaW2X4PZ4+wyKoFsnmqV8R9BIFSXKRLdy8xpSwOj4zzANfZ6KkElnR2Oc= 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" 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 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