Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp3535595pxu; Mon, 19 Oct 2020 14:46:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy9Bvtp1LPMFq+Lie5SjfiLijJTMuAAK9jSL7JJX0hk6HguXMcsHJTi2m4hCAwUQ78CH8vM X-Received: by 2002:a17:906:e103:: with SMTP id gj3mr1900995ejb.442.1603144009943; Mon, 19 Oct 2020 14:46:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603144009; cv=none; d=google.com; s=arc-20160816; b=ybCjGAjYwLubukIsCqECkI3iEKIoc5UhIsQ+N1Rx3V41FtvYnYQ/VU5YfgVvJpsrnL jeaCekvz0oG+AnE4L4yUShcYMHsdKIjTGePzfCmuPhKHqSCWGGiA2F4KDooGlfCjImYN sDOLQnGiuVQQb9PN8PUhHlpC2EL02nBT0q40IYhI5PYJtf/bzWABJx8b00edbTkGdn2A CQDPgxbuYTFKeJT/JX0UD6E0Ljq6ED0igny+ukv8H30obOLtOU6IJG8ipcT0qYvItA/v eJrYBS/YERnLAbgj2PFxxCg1uM4OBUxacWb60Bkh5wgJ/v4SOkDN/9s8pB1/GSSrqHnw +0kA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:in-reply-to:reply-to:subject:cc:to:from:user-agent :references; bh=UYFExcljuYQC+kP/tieGi9cLPnOvovCCh3N866AZXIQ=; b=w/33aPYreVikhcoy5pAfeX2BvJ+0dcz59V6K8eKjocBqG4MLQYpBZT/pZmgpBun2Sd Rz0wzvqyd7R1KS3uRzXCB14PVKLe0EgU2SRbGFegnxOeNKBeBfaqext+0JYse0W5WRkF fBlfgVPLmnjle2VHw2jgYLUDHj9UyexuDdB5zJrXs9jOIkeDLwrx+ZgRbbAXEudjDRh+ l1nRihwd9H6rOvY5z/HC/JnYg9gQxWTkloy9jXluYntoK8Hzqk9LRL64MKiPU13en+it WMnvUjE3SoFtRY0phNuVrp5QOnrtdXxUmvoCzGAE1lITudbkHIZfgbqN+4b+RZIYLU00 HIpQ== 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 v8si932721ejg.101.2020.10.19.14.46.20; Mon, 19 Oct 2020 14:46:49 -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 S1729466AbgJSIpf convert rfc822-to-8bit (ORCPT + 99 others); Mon, 19 Oct 2020 04:45:35 -0400 Received: from mx2.suse.de ([195.135.220.15]:56498 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729121AbgJSIpf (ORCPT ); Mon, 19 Oct 2020 04:45:35 -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 111FFAC8C; Mon, 19 Oct 2020 08:45:34 +0000 (UTC) References: <20201014190749.24607-1-rpalethorpe@suse.com> <20201016094702.GA95052@blackbook> <20201016145308.GA312010@cmpxchg.org> <20201016171502.GA102311@blackbook> User-agent: mu4e 1.4.13; emacs 27.1 From: Richard Palethorpe To: Michal =?utf-8?Q?Koutn=C3=BD?= Cc: Johannes Weiner , Roman Gushchin , ltp@lists.linux.it, Andrew Morton , Shakeel Butt , Christoph Lameter , Michal Hocko , Tejun Heo , Vlastimil Babka , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH] mm: memcg/slab: Stop reparented obj_cgroups from charging root Reply-To: rpalethorpe@suse.de In-reply-to: <20201016171502.GA102311@blackbook> Date: Mon, 19 Oct 2020 09:45:32 +0100 Message-ID: <87lfg2ob83.fsf@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, Michal Koutný writes: > On Fri, Oct 16, 2020 at 10:53:08AM -0400, Johannes Weiner wrote: >> The central try_charge() function charges recursively all the way up >> to and including the root. > Except for use_hiearchy=0 (which is the case here as Richard > wrote). The reparenting is hence somewhat incompatible with > new_parent.use_hiearchy=0 :-/ > Yes and it also seems new_parent.use_hierarch=0 -> new_child.use_hierarchy=0 and new_parent.use_hierarch=0 -> new_child.use_hierarchy=1 are considered valid on cgroupsV1. The kernel will also allow more descendants on new_child.use_hierarchy=0, but sets broken_hierarchy=1. However this will not stop the stack trace occuring (AFAICT) when the reparenting happens between two descendants. >> We should clean this up one way or another: either charge the root or >> don't, but do it consistently. > I agree this'd be good to unify. One upside of excluding root memcg from > charging is that users are spared from the charging overhead when memcg > tree is not created. (Actually, I thought that was the reason for this > exception.) > > Michal -- Thank you, Richard.