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=-5.4 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 D325FC433E2 for ; Mon, 7 Sep 2020 11:47:50 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 1E93E207C3 for ; Mon, 7 Sep 2020 11:47:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chrisdown.name header.i=@chrisdown.name header.b="cuAJnS9c" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1E93E207C3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chrisdown.name Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 525296B0003; Mon, 7 Sep 2020 07:47:49 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4AEA86B0037; Mon, 7 Sep 2020 07:47:49 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 39E7D6B0055; Mon, 7 Sep 2020 07:47:49 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0041.hostedemail.com [216.40.44.41]) by kanga.kvack.org (Postfix) with ESMTP id 21D7E6B0003 for ; Mon, 7 Sep 2020 07:47:49 -0400 (EDT) Received: from smtpin29.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id D2BB182499A8 for ; Mon, 7 Sep 2020 11:47:48 +0000 (UTC) X-FDA: 77236091016.29.party44_3412bfe270cb Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin29.hostedemail.com (Postfix) with ESMTP id 8B80F180868E5 for ; Mon, 7 Sep 2020 11:47:48 +0000 (UTC) X-HE-Tag: party44_3412bfe270cb X-Filterd-Recvd-Size: 4811 Received: from mail-ed1-f67.google.com (mail-ed1-f67.google.com [209.85.208.67]) by imf01.hostedemail.com (Postfix) with ESMTP for ; Mon, 7 Sep 2020 11:47:47 +0000 (UTC) Received: by mail-ed1-f67.google.com with SMTP id ay8so12486378edb.8 for ; Mon, 07 Sep 2020 04:47:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chrisdown.name; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=395Y0lUxtoxk+N6Xwo36+dBOIhVjSE/2+oZvPClU7KM=; b=cuAJnS9cKwag10JrR5XWKLTSDpsVij2RIxygdpxgcJAAdzqC0pGMP0broEdFrjuV2u YK1YpzjfS7JWBVBZPRmTUcfnAukLTXmsLJ2XSzMOmdbEBvGaIW/6SMoesJ2yxCpA/WG2 m8QnLvvHNNu3zgtJUbsMfzQakaNE4sxXw5yG0= 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=395Y0lUxtoxk+N6Xwo36+dBOIhVjSE/2+oZvPClU7KM=; b=JmcyPy3xF5ajlwDQElmQXaMuz5w+vU1ZwLUMEg6C6KQ6/cYfpoBysCGwHXLiW5xIJe Dz/ZEWfOTfsPsAr06iYQ+TPgeNIA6Hr9EjIloT52acarNxN3jQBEXK0arl27iVVcdvPD CJTkBEvjnDsW1DS8NhfRAvNwEcvm1IWDHsEJMWAkZrRoqrojiWQdGOFLDwS9zTnRvMyK XlGEbZYI+z19FxKJlPdHd1no2qfGigFjDyoh+uNmS+5Ijbvpc6htPfaTSqYQuRhep0K6 CRt/oDh84MP14AhrE+RR7yF4xTgt0o0Bwp7V63Eu5LTbfcWFY2jxwB2cMCvV6b2FwA7W Gveg== X-Gm-Message-State: AOAM531csnI8Nx57udfwuI0phLq81Noxz0HdKmf4JPgHgNL8rtP6/Y7j fnAyqKTo+MNbVVIfdtPEUgbenA== X-Google-Smtp-Source: ABdhPJyILtFsw8r3H1RpyzxLgjhS4fpPrmJqOehWQUoj7NYN8ViFHh3BGjy7PTSONASUxNPG0HBqNg== X-Received: by 2002:a05:6402:1151:: with SMTP id g17mr21705446edw.227.1599479266759; Mon, 07 Sep 2020 04:47:46 -0700 (PDT) Received: from localhost ([2620:10d:c093:400::5:80b]) by smtp.gmail.com with ESMTPSA id q14sm14733379edv.54.2020.09.07.04.47.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Sep 2020 04:47:45 -0700 (PDT) Date: Mon, 7 Sep 2020 12:47:45 +0100 From: Chris Down To: Johannes Weiner Cc: Peter Zijlstra , Michal Hocko , Waiman Long , Andrew Morton , Vladimir Davydov , Jonathan Corbet , Alexey Dobriyan , Ingo Molnar , Juri Lelli , Vincent Guittot , linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-fsdevel@vger.kernel.org, cgroups@vger.kernel.org, linux-mm@kvack.org Subject: Re: [RFC PATCH 0/8] memcg: Enable fine-grained per process memory control Message-ID: <20200907114745.GA1076657@chrisdown.name> References: <20200817140831.30260-1-longman@redhat.com> <20200818091453.GL2674@hirez.programming.kicks-ass.net> <20200818092617.GN28270@dhcp22.suse.cz> <20200818095910.GM2674@hirez.programming.kicks-ass.net> <20200818100516.GO28270@dhcp22.suse.cz> <20200818101844.GO2674@hirez.programming.kicks-ass.net> <20200818134900.GA829964@cmpxchg.org> <20200821193716.GU3982@worktop.programming.kicks-ass.net> <20200824165850.GA932571@cmpxchg.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20200824165850.GA932571@cmpxchg.org> User-Agent: Mutt/1.14.6 (2020-07-11) X-Rspamd-Queue-Id: 8B80F180868E5 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam03 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: Johannes Weiner writes: >That all being said, the semantics of the new 'high' limit in cgroup2 >have allowed us to move reclaim/limit enforcement out of the >allocation context and into the userspace return path. > >See the call to mem_cgroup_handle_over_high() from >tracehook_notify_resume(), and the comments in try_charge() around >set_notify_resume(). > >This already solves the free->alloc ordering problem by allowing the >allocation to exceed the limit temporarily until at least all locks >are dropped, we know we can sleep etc., before performing enforcement. > >That means we may not need the timed sleeps anymore for that purpose, >and could bring back directed waits for freeing-events again. > >What do you think? Any hazards around indefinite sleeps in that resume >path? It's called before __rseq_handle_notify_resume and the >arch-specific resume callback (which appears to be a no-op currently). > >Chris, Michal, what are your thoughts? It would certainly be simpler >conceptually on the memcg side. I'm not against that, although I personally don't feel very strongly about it either way, since the current behaviour clearly works in practice.