Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3151465pxk; Mon, 7 Sep 2020 04:53:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzicP5sC5Ki/ND1+609Rzp4l7LWgDsclsW/V1vYTUq4yGeQ5wVVmZ0bOlxtGb++RVz71eMu X-Received: by 2002:aa7:da48:: with SMTP id w8mr20780835eds.165.1599479637542; Mon, 07 Sep 2020 04:53:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599479637; cv=none; d=google.com; s=arc-20160816; b=tMKNmc5OLnf9plCr03foHAmpdzhB+wgL55tZhnKEvXZ8h0Ixp1K/xUSmZSqrVhNWPJ nSjYICHdudNhSGt++AInCzNMg3XGxSnFV69THpd57CKI+miMx7EzTbarL7vEP1b+nWGV DaUvepq8B5deYKwut+e7iI3S78j6N2TvjQ0LJXzKeEY5W0YAcmwj/LldNXlkpPLwpxxw mONy3TM0wJBG/M87Ql5qaGaCsu0xkO1rbAREpvuE7jbkNSlV5XRu4LD5nywYIFWNKpOz vUVWeN7Jldff+xI8kq7aF63Gx0+FWfgr35beog+tT5JQzshAJ0zEpGeCkotAiMjDNYdN zPeQ== 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; bh=395Y0lUxtoxk+N6Xwo36+dBOIhVjSE/2+oZvPClU7KM=; b=jdDdAL2OZt5jeI86Jzuyw5o88UtCU5kE6Zm6S/fVbXk9jucAZVUGwZWqO6IBkgBqAg R47+zL4LnQj2lvqpBj4ej/Is8DHpmlgsFUQ5OvTKA/jjWNrRLpiyp64R9jrhfd0yjr/o 1l0GFlBZI4edW2o6geBQVL7i0etvvmAadkgq9b6g3paliRaUhNSMPipaFkC5zwdVs/vZ YN6ojT2Jtfsz+ujZiHqxNKg+5BSMNy1nVYFP9dxp4E7vYYkbkxY8OOAAydBBX9f7Kpfl Y1X3j3N4AW4uiKabzfXTAM3F7cF4TP93qV6x26YQkeh1gR5HcjZD/+YhR9WcC850/O7h hYtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chrisdown.name header.s=google header.b=cuAJnS9c; 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=NONE sp=NONE dis=NONE) header.from=chrisdown.name Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n19si9178564edq.82.2020.09.07.04.53.34; Mon, 07 Sep 2020 04:53:57 -0700 (PDT) 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=@chrisdown.name header.s=google header.b=cuAJnS9c; 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=NONE sp=NONE dis=NONE) header.from=chrisdown.name Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728973AbgIGLw2 (ORCPT + 99 others); Mon, 7 Sep 2020 07:52:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46488 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729140AbgIGLrt (ORCPT ); Mon, 7 Sep 2020 07:47:49 -0400 Received: from mail-ed1-x544.google.com (mail-ed1-x544.google.com [IPv6:2a00:1450:4864:20::544]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 472E0C061755 for ; Mon, 7 Sep 2020 04:47:48 -0700 (PDT) Received: by mail-ed1-x544.google.com with SMTP id b12so12465282edz.11 for ; Mon, 07 Sep 2020 04:47:48 -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=ujya7eG3nTmZ4PPil2AO/7axHunVbZLEcbuMhJ7kjFb1/obdbrSLJrHQBiLmB8A09+ tOjXWEPEonXfcO2b2X6SWQHGJ66hDc9vp9Ms2iEFO7fuIoGAt3YBQ0aWOnnK3Wb1m2nd NxmolH/0h2PAdAjw5YoxpyEVb1T35dPowrs1NLZOXynQu0c0VFp74OJZtM54aKJP6RrC c9eISsExVRnY4q27BcKiqUy/C1wP+ARyFWcMfNvRfpWMk3xYpgFs3Gc328eQRQc4pD7G Ft897/8zi4sArmDURWYf6gxlVfGQrakSf3dw9uKTM+QrOhaR4YiK4L/+WoyDl5mEnNrl ZhOQ== X-Gm-Message-State: AOAM533DN7ATwZx1/SzS0YjeummVP0uVDx0/zoq0nAU2DbOetjxOjdYO fZwprj/BGDT7uxZqu9XMVG3uFQ== 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) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.