From mboxrd@z Thu Jan 1 00:00:00 1970 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4F59CC54EAA for ; Fri, 27 Jan 2023 07:20:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AAA758E0001; Fri, 27 Jan 2023 02:20:52 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A59CB6B0072; Fri, 27 Jan 2023 02:20:52 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 921CA8E0001; Fri, 27 Jan 2023 02:20:52 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 839AC6B0071 for ; Fri, 27 Jan 2023 02:20:52 -0500 (EST) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 5B5871A0858 for ; Fri, 27 Jan 2023 07:20:52 +0000 (UTC) X-FDA: 80399731944.07.547DA6B Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by imf21.hostedemail.com (Postfix) with ESMTP id 6A4DC1C001B for ; Fri, 27 Jan 2023 07:20:50 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=JMW3EofP; dmarc=pass (policy=quarantine) header.from=suse.com; spf=pass (imf21.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.28 as permitted sender) smtp.mailfrom=mhocko@suse.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1674804050; h=from:from:sender:reply-to:subject:subject: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:dkim-signature; bh=J1b282C081iblMIexq22+0/YOFRCsX9BkcK/Nyqy0So=; b=31CzbCZNUPK+rfxJfWpR4fEOBEhr96YLR6pcVgi7DzTiM3sV8nDxLuHOaLy3R8UpRYKuIr owjk+8vGauG+fmvmAPMoJdxAzWUSVaf46fBbkFTnsnrQNmSH+Px35QpqdeAhmce8su9Si6 d+VKfad5zyvQaFSnvKSWGb4WGTSnkns= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=JMW3EofP; dmarc=pass (policy=quarantine) header.from=suse.com; spf=pass (imf21.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.28 as permitted sender) smtp.mailfrom=mhocko@suse.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1674804050; a=rsa-sha256; cv=none; b=y7B4iue6LVtBrYnsT48ofRcIlJ366aWO/+L6aKN73PpIWy8jFQba9upkmifFGp/pMqD7R2 ERaefnAupSXIrl37IBNtN83YnT5i9pgzUu5J1deoxn5KRl0M5zCeTASZ/OnuI6QB7uz0UE pK8uXk43tQ8n/BXJ7guoj2s4eeOZrJc= 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> X-Rspamd-Queue-Id: 6A4DC1C001B X-Rspamd-Server: rspam09 X-Rspam-User: X-Stat-Signature: 38k47854qh4pgx8o84s7rkqzq6uri7y6 X-HE-Tag: 1674804050-739789 X-HE-Meta: U2FsdGVkX197uhInPfEo8xWDfd3fC8ZZNjAeq7ff8uqnJsw/snQHRSGnkPXJhdMeA8swaB7M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vx/ASyxvFoVxUc0Iew5TETVn9Vma9fao5I3seUtqImfJ5GpqBTfRKg== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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