Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp2560741iob; Fri, 6 May 2022 05:48:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxKy/KVjpv8ZQ7SADO9ChjFHZsy8lFlypJje9gRIsnoKXLn5IDkT7G+ktHBVv0QwMnDVRdd X-Received: by 2002:a05:6402:50d1:b0:428:1473:d173 with SMTP id h17-20020a05640250d100b004281473d173mr3251477edb.37.1651841328514; Fri, 06 May 2022 05:48:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651841328; cv=none; d=google.com; s=arc-20160816; b=qldECTkeJAFAGNw+cHRpSzhul9TB4s5Cc9bBmfyFVjXeur5inCy/Qdl1H4ec6Eyd/X FA/SHynxWtufMnUb4wxrRd/2z49LmbAP7wFexccn/9HCC9sSVOcHY/mWj/Cn6DTvyKdl 84u37rT3KV8uzNME7S5dmyVLaKHqhoeIfAAAls8agC5+lNNddk1QJVeoUbNWi9H1NzQj RE/KTBcZFDFPhmlqzJ6/+7sO8ytMOZizJduk7QEuBV7TVAmMPWW/xOSHORRM7J1CKgFh VDfqmBi3ac+Hkf1X4uFUK7/MeewsmJdvMuXCsiOKIWTJknAzx88+zIZ+bf3miNoF38X8 wAeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=9UR1yAl5TuOKPXs8xewFpELkQ8J8mZZySCuXUINaiZ8=; b=XGQ2sdAFvUjjk5MO7icHzN7GjQt0wd81VUjrVUixaaE8MbYzT49V84leLJgQg0bz5s /u5zJ/vg38Gw98z9t3QredtSsLwADCAw967rNwTNELSpyaBTvgTjTgg5nwFxIBzwZ3yY N1ivUsirazd8fYlpYtD7u4JRCkgKcKbhEuEOsah193mtrPvaJMBgoe1JsbpZh8T2AVgE hN1N9M/WlAgMWqB/KvJI4xk8S+npbqY7tQvCvBNT8sevvaYgZqaarwgsvgCAfj+DXmjp MOh04pnOXVYeIoY4uCXIP+RxqdGPLbfXsGnZ8/3mJ/lTdLOPVrpQ4xgt7eDxLCl9ulbv SP1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=ohURCbNO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h7-20020a056402280700b0041d7b406027si5866385ede.175.2022.05.06.05.48.23; Fri, 06 May 2022 05:48:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=ohURCbNO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354109AbiEEJuv (ORCPT + 99 others); Thu, 5 May 2022 05:50:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34146 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346565AbiEEJup (ORCPT ); Thu, 5 May 2022 05:50:45 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0AB9631531; Thu, 5 May 2022 02:47:07 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id BD91E1F37E; Thu, 5 May 2022 09:47:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1651744025; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=9UR1yAl5TuOKPXs8xewFpELkQ8J8mZZySCuXUINaiZ8=; b=ohURCbNOo2RJ/iazwraZdarADgzIdXUJbgxG/iAU7mBk1yalYm6Z3rluGWxuPENvMTsqsE fHfJZm+HCTsJND5hEJKSEt6nrFOm3ZeJaME2+RjY7Q2tcYOXOVnIC/3RYVTEweETeKq1UT aC9V3D1cYBJ8i9avDe84kHWVKwG58Pk= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 8316113A65; Thu, 5 May 2022 09:47:05 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id aRcFHxmdc2J9MwAAMHmgww (envelope-from ); Thu, 05 May 2022 09:47:05 +0000 Date: Thu, 5 May 2022 11:47:04 +0200 From: Michal =?iso-8859-1?Q?Koutn=FD?= To: Vasily Averin Cc: Roman Gushchin , Vlastimil Babka , Shakeel Butt , kernel@openvz.org, Florian Westphal , linux-kernel@vger.kernel.org, Michal Hocko , cgroups@vger.kernel.org, Greg Kroah-Hartman , Tejun Heo Subject: Re: kernfs memcg accounting Message-ID: <20220505094704.GB10890@blackbody.suse.cz> References: <7e867cb0-89d6-402c-33d2-9b9ba0ba1523@openvz.org> <20220427140153.GC9823@blackbody.suse.cz> <7509fa9f-9d15-2f29-cb2f-ac0e8d99a948@openvz.org> <52a9f35b-458b-44c4-7fc8-d05c8db0c73f@openvz.org> <20220504141001.GA10890@blackbody.suse.cz> <65244222-02c5-6e8d-7f4b-83651f378ce2@openvz.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <65244222-02c5-6e8d-7f4b-83651f378ce2@openvz.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 05, 2022 at 12:16:12AM +0300, Vasily Averin wrote: > I think it should allocate at least 2 pages. After decoding kmalloc_type(), I agree this falls into a global (unaccouted) kmalloc_cache. > However if cgroup_mkdir() calls mem_cgroup_alloc() it correctly account huge percpu > allocations but ignores neighbour multipage allocation. So, the spillover is bound and proportional to memcg limit (same ration like these two sizes). But it may be better to account it properly, especially if it's contribution form an offlined mem_cgroup. Thanks, Michal