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 B3609C54EAA for ; Thu, 26 Jan 2023 19:13:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E51A66B0074; Thu, 26 Jan 2023 14:13:52 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E00B36B0075; Thu, 26 Jan 2023 14:13:52 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CC8998E0001; Thu, 26 Jan 2023 14:13:52 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id BA6066B0074 for ; Thu, 26 Jan 2023 14:13:52 -0500 (EST) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 884704044C for ; Thu, 26 Jan 2023 19:13:52 +0000 (UTC) X-FDA: 80397899904.13.E6877F3 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf11.hostedemail.com (Postfix) with ESMTP id A9C4240003 for ; Thu, 26 Jan 2023 19:13:49 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=ei5CGv7o; dmarc=pass (policy=quarantine) header.from=suse.com; spf=pass (imf11.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.29 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=1674760429; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=YnzrMwJWnqV7xEolFqXRf8x90j0rKrmMDrv1KOIfhio=; b=ZGVRFutz2x3P6M7wwfeg4eclbqI6zYW3zPqF//B2QEKgAouA1ky/Au3C1K3glA/kH1s0l/ q7I4jYk4NxZLyA6SMxY2UzFVmpLzotZ4wr+6EQWzEdIhDZyqS6Av+Id4jflPwVerg4Ra9O rTqlFeWEsUEjyUDlct4fQEqA67Y9qpk= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=ei5CGv7o; dmarc=pass (policy=quarantine) header.from=suse.com; spf=pass (imf11.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.29 as permitted sender) smtp.mailfrom=mhocko@suse.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1674760429; a=rsa-sha256; cv=none; b=HZ2ptkDHQ7Pzq90qo8ReiWp5ncHVRh2iHDID5e/sihw3RO2iIZBLkRNCYpUnXNcpRWfmCz ItYdlnJk4ocPRMK/t9zWhIyR50Qk3Tzn35EY0nZGsdKPY4L1Iw3hnsWW7hmsSuLct3/UZl 6fJyqZYLLGqZLRTVJOWQv3tDEJeAIFI= 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 0C8AA1F8AA; Thu, 26 Jan 2023 19:13:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1674760428; 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=YnzrMwJWnqV7xEolFqXRf8x90j0rKrmMDrv1KOIfhio=; b=ei5CGv7oFwVoJj4dBnXnDv29lsXPo+m8Uh+bxtoV2rpzhI8Q3sewvDYNPeZ/J56Sf6OI/Q 5BPy50FL8QTq/BqhaG6lmuZRaASdcaPCCLxrr2JAro6T5byuInzzNprRAb2ILLPx0l12Cs 0UkqAkcvrZYEOQ0rOMzZlDb5OKXRfCA= 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 DC22D13A09; Thu, 26 Jan 2023 19:13:47 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id NRQpNOvQ0mO9FwAAMHmgww (envelope-from ); Thu, 26 Jan 2023 19:13:47 +0000 Date: Thu, 26 Jan 2023 20:13:47 +0100 From: Michal Hocko To: Marcelo Tosatti Cc: Leonardo =?iso-8859-1?Q?Br=E1s?= , Johannes Weiner , Roman Gushchin , 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: A9C4240003 X-Rspamd-Server: rspam09 X-Rspam-User: X-Stat-Signature: 9oyk5zaf3sxejjwpt6mucebwxdindayg X-HE-Tag: 1674760429-644124 X-HE-Meta: U2FsdGVkX18DzxWkO5Jm3nKybdynok7wN2c/Prk9eTIVGK7hn3jiwfwx+gf9UyrIpC7Njoc9pOTFupFArlwR0mTlbUKiCZngV6egOAFXHvF8Uc9An/vzIzqVzFBdL9tc1U7ffXnuc/u6dYxIdRcA4vnmlPfV328z+Z0wF4LD1BZ46jaCWo7O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k= 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 Thu 26-01-23 15:14:25, Marcelo Tosatti wrote: > On Thu, Jan 26, 2023 at 08:45:36AM +0100, Michal Hocko wrote: > > On Wed 25-01-23 15:22:00, Marcelo Tosatti wrote: > > [...] > > > Remote draining reduces interruptions whether CPU > > > is marked as isolated or not: > > > > > > - Allows isolated CPUs from benefiting of pcp caching. > > > - Removes the interruption to non isolated CPUs. See for example > > > > > > https://lkml.org/lkml/2022/6/13/2769 > > > > This is talking about page allocato per cpu caches, right? In this patch > > we are talking about memcg pcp caches. Are you sure the same applies > > here? > > Both can stall the users of the drain operation. Yes. But it is important to consider who those users are. We are draining when - we are charging and the limit is hit so that memory reclaim has to be triggered. - hard, high limits are set and require memory reclaim. - force_empty - full memory reclaim for a memcg - memcg offlining - cgroup removel - quite a heavy operation as well. all those could be really costly kernel operations and they affect isolated cpu only if the same memcg is used by both isolated and non-isolated cpus. In other words those costly operations would have to be triggered from non-isolated cpus and those are to be expected to be stalled. It is the side effect of the local cpu draining that is scheduled that affects the isolated cpu as well. Is that more clear? -- Michal Hocko SUSE Labs