Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E8A2FC61D97 for ; Fri, 27 Jan 2023 07:20:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232313AbjA0HUx (ORCPT ); Fri, 27 Jan 2023 02:20:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42082 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231648AbjA0HUv (ORCPT ); Fri, 27 Jan 2023 02:20:51 -0500 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 68021113F8; Thu, 26 Jan 2023 23:20:50 -0800 (PST) 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-out1.suse.de (Postfix) with ESMTPS id 158D621DA1; Fri, 27 Jan 2023 07:20:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1674804049; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=J1b282C081iblMIexq22+0/YOFRCsX9BkcK/Nyqy0So=; b=JMW3EofPMuJ2RfjKSleTooHn6JwOp8Aj+7pQcj73S3EoOVFbIy3N8lOq8a5hiKXj9BaSBV oX4l1jcsimsbQfka8Gp3SOjtMk9ndSR+AhMEkipWR4Jbpmjg4vKYsJpexZNCPN2NBievBB tbgBkCPmBFSmSp+InsONX5T/WMDxLQE= 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 E81571336F; Fri, 27 Jan 2023 07:20:48 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id tsphNlB702OgWgAAMHmgww (envelope-from ); Fri, 27 Jan 2023 07:20:48 +0000 Date: Fri, 27 Jan 2023 08:20:48 +0100 From: Michal Hocko To: Leonardo =?iso-8859-1?Q?Br=E1s?= Cc: Roman Gushchin , Marcelo Tosatti , Johannes Weiner , Shakeel Butt , Muchun Song , Andrew Morton , cgroups@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 0/5] Introduce memcg_stock_pcp remote draining Message-ID: References: <20230125073502.743446-1-leobras@redhat.com> <9e61ab53e1419a144f774b95230b789244895424.camel@redhat.com> <55ac6e3cbb97c7d13c49c3125c1455d8a2c785c3.camel@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <55ac6e3cbb97c7d13c49c3125c1455d8a2c785c3.camel@redhat.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri 27-01-23 04:14:19, Leonardo Br?s wrote: > On Thu, 2023-01-26 at 15:12 -0800, Roman Gushchin wrote: [...] > > I'd rather opt out of stock draining for isolated cpus: it might slightly reduce > > the accuracy of memory limits and slightly increase the memory footprint (all > > those dying memcgs...), but the impact will be limited. Actually it is limited > > by the number of cpus. > > I was discussing this same idea with Marcelo yesterday morning. > > The questions had in the topic were: > a - About how many pages the pcp cache will hold before draining them itself?? MEMCG_CHARGE_BATCH (64 currently). And one more clarification. The cache doesn't really hold any pages. It is a mere counter of how many charges have been accounted for the memcg page counter. So it is not really consuming proportional amount of resources. It just pins the corresponding memcg. Have a look at consume_stock and refill_stock > b - Would it cache any kind of bigger page, or huge page in this same aspect? The above should answer this as well as those following up I hope. If not let me know. -- Michal Hocko SUSE Labs