Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp613875pxa; Wed, 12 Aug 2020 09:30:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx5D5P/VxL00TeUEZZF3ZC/Am007xAwFEFXHLH9Lkw6zjKy0BC67x7+wbViObyquPhK6Fav X-Received: by 2002:a17:906:c2c8:: with SMTP id ch8mr566469ejb.161.1597249855570; Wed, 12 Aug 2020 09:30:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597249855; cv=none; d=google.com; s=arc-20160816; b=HyIn7PW1SE2IWPN1jl55WyPXLma/r91CokP/Z+i7d80xhqtOx1LVDtFwB4QvbbO/14 3nPqOKzs8OlegDh0jpThRh4HFpczcsgOemiF/S7MEigU7XEN+F8PmDMJsV4ldDfINEdO LRjvqydTEwqtM1YUnS06JUt5VR7zTk/MIpp+L/X997gQVwC+uY13Cl4K004VwC0DMBaP f/dq0yxI/Z0WwPwS5qxbMX7O+RFKlN1GhpQau+4kEg5S7bpJo3909RPQjKnoWdTv+AqT B76o440F7Jg7TixL1uU+zKXaQ4lFwGGprR04JbO0ufA/wNdVwXmMhxuwe5q0nAPeHL04 O1nA== 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; bh=h4fQbmiy8IuZ18XfvB4oa0i9l6NnvkmYvemdzXr55r4=; b=tVOXljqiWfxleiAN9rIzEp2ZE8NpaxplOLPZUOQ92qpys5z56diSj2sREEugkRorU4 FjQ24AdyCfHL+MLci0N2oEHcehzD+UL7Ay+Lgp9I/VvXwcJLi1mSYELa1ol68QjVawR/ KF2dYCmHgHyMZ9U6Fq3JJTtU9/mvg7EG/TlftddQjPbUzwcGOzPMJxrwRsB+z0J+Bw8/ PgmupDXMIj2ljXYaaSKgwMiX3fLzJ2f99bsUqSZQ26upo8mREIzoXp9CmyaTCnvpwxzp yeqWhQkb+u6oJq+famqWwxcuVjQgs0sNkMbnce5vlklqapO1yIigpObKDIwHTr4kSSoa rTFw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bd9si1558198edb.340.2020.08.12.09.30.31; Wed, 12 Aug 2020 09:30:55 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726678AbgHLQ3A (ORCPT + 99 others); Wed, 12 Aug 2020 12:29:00 -0400 Received: from mx2.suse.de ([195.135.220.15]:40962 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726515AbgHLQ3A (ORCPT ); Wed, 12 Aug 2020 12:29:00 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 03110AE07; Wed, 12 Aug 2020 16:29:20 +0000 (UTC) Date: Wed, 12 Aug 2020 18:28:54 +0200 From: Michal =?iso-8859-1?Q?Koutn=FD?= To: Roman Gushchin Cc: Andrew Morton , Dennis Zhou , Tejun Heo , Christoph Lameter , Johannes Weiner , Michal Hocko , Shakeel Butt , linux-mm@kvack.org, kernel-team@fb.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 4/5] mm: memcg: charge memcg percpu memory to the parent cgroup Message-ID: <20200812162854.GA19777@blackbody.suse.cz> References: <20200623184515.4132564-1-guro@fb.com> <20200623184515.4132564-5-guro@fb.com> <20200729171039.GA22229@blackbody.suse.cz> <20200806211603.195727c03995c3a25ffc6d76@linux-foundation.org> <20200807043717.GA1231562@carbon.DHCP.thefacebook.com> <20200811144754.GA45201@blackbook> <20200811165527.GA1507044@carbon.DHCP.thefacebook.com> <20200811183225.GA62582@blackbook> <20200811193228.GC1507044@carbon.DHCP.thefacebook.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="2oS5YaxWCcQjTEyO" Content-Disposition: inline In-Reply-To: <20200811193228.GC1507044@carbon.DHCP.thefacebook.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --2oS5YaxWCcQjTEyO Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Aug 11, 2020 at 12:32:28PM -0700, Roman Gushchin wrote: > If we'll limit init.slice (where systemd seems to reside), as you suggest, > we'll eventually create trashing in init.slice, followed by OOM. > I struggle to see how it makes the life of a user better? > [...] > The problem is that OOM-killing the accompanying manager won't release > resources and help to get rid of accumulated cgroups. I see your point now. I focused on the creator because of the live memcgs. When the issue are the dying memcgs (c), they were effectively released by their creator but are pinned by whatever remained after their life (LRU pages, slab->obj_cgroups). Since these pins were created _from within_ such a child (c), they're most readily removable by reclaiming (hierarchically) close to c. (It'd be achievable by limiting the lowest common ancestor of manager and its product (typically root) but that is more clumsy and less effective.) This is the reasoning that justifies the remote charge. Thanks! Michal --2oS5YaxWCcQjTEyO Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEEoQaUCWq8F2Id1tNia1+riC5qSgFAl80GMIACgkQia1+riC5 qSh2FQ/7BWPW4IIs0OxCwGkMzqA43de67xmmtP3YfCPgCsnei4a1kX60z7VKOaUq slHtmgKJ5XipIOW33ierySBV3WiYH7jW13cIfM5xneld+iJZ7TLYWfbB6KL8jmpy 4jkRqYXoYN1E/qAOMZ1Xw1wlNcrbM8yUy4seRF5ihXt5y2at/Vze4WGEkfMJ2c5Z hU0ECsZ/A22BO0DTYhXrziVzWvW5tKxYWHKiP7lk4jw/EQIQaVyeZY5kSoEYe9zi tJrEceVY0Ig693KkVCEl54tOJ9s+3QisKgTBKybbhf+7+TdRmy+qLGYOhFQE0bI2 R2zRYQPSEkLNsfShLzcqa/sD0KjXYxP3qetffouyVv49RkViaZ6NBsl0Fekg/Hx2 Caxc395K1Opo1gp+H3xwgMfBbeoboNZVnvPFqpigVsDu1XUddQeGL+PKF6c1FEHX Z3HnpRiTM6t5r0HHRtHzwIDkCnEfRXJxMNxezRvTPEorn9+6vC6w9JNxsvc+flUV tPDjn9tYvh8CfL0DoeUfu9HlynsS0JMZ2ASRxwATtE19Z05OS5Ij+o/yS5jMt4E2 nCWeJ8v8xujJEQG95WRoVajr9WfFf2DuxiHRRnDZ9fSDu1FT81SS4IRX/lbLwe1f xxw4SvlDzI53itdajr6khrV1BFAA/3rPceGue25c8uplLZEBx/w= =oKPI -----END PGP SIGNATURE----- --2oS5YaxWCcQjTEyO--