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 2AB23C54E94 for ; Wed, 25 Jan 2023 08:33:54 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8086E6B0073; Wed, 25 Jan 2023 03:33:53 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7B8556B0075; Wed, 25 Jan 2023 03:33:53 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6A6DA6B007B; Wed, 25 Jan 2023 03:33:53 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 5DBD76B0073 for ; Wed, 25 Jan 2023 03:33:53 -0500 (EST) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 1F799160884 for ; Wed, 25 Jan 2023 08:33:53 +0000 (UTC) X-FDA: 80392658346.27.A7F6AF9 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by imf09.hostedemail.com (Postfix) with ESMTP id 49545140003 for ; Wed, 25 Jan 2023 08:33:51 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b="nXei/ipL"; spf=pass (imf09.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.28 as permitted sender) smtp.mailfrom=mhocko@suse.com; dmarc=pass (policy=quarantine) header.from=suse.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1674635631; a=rsa-sha256; cv=none; b=tKr4x0dD9LY+N2Larzea7RJQPm7mNu75MpJbK9Og4DO47PINtHAH+TB/Byr/G+1+gaPSqw Vd+Qy/3PwCkM6QsTicCY4rOhDL/t1nuLbRKIu7fp1Z322cP8TonpvlcguNgDUgmlIEEXsC gd9dm14aGETPgOxP8PoD/zA2QuJAGuc= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b="nXei/ipL"; spf=pass (imf09.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.28 as permitted sender) smtp.mailfrom=mhocko@suse.com; dmarc=pass (policy=quarantine) header.from=suse.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1674635631; 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=E4rgGfWEon8mTJ3xQufUQx0PpIsnYpjp+SuGeR3ihNs=; b=w+yXa0cDItYi0gEdHRZqL8FipDcVByoeJFSW+GAJJyvxo/a5Mh3WaouDCsWeCre2n1iNpm tt6bsup103Py9WUk0reOam3y5NzeiavBOQ5IiHWno3SEgEKf8hm16K+kdTsOITRbLIz4YU AEfveNzvGe3FHdGOGHVTtZ85hYVQpFg= 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 F26DF21F43; Wed, 25 Jan 2023 08:33:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1674635630; 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=E4rgGfWEon8mTJ3xQufUQx0PpIsnYpjp+SuGeR3ihNs=; b=nXei/ipLqEit9F4UME6bDn4D9KuCh4bbgFHAmK08auHOmzF/T17spkqIBC1wJ6MQznsFRL 7WyZHH6mvlTVh5118YdfhDMWoJhUcbSuL3NzuyhsAcudR18NhCbfuhGq+kn4f1vPn6+fFi 8cTLmCn9i8Gk0LpdQIuK4T1g8O8fC4U= 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 D49711339E; Wed, 25 Jan 2023 08:33:49 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id v0DWMG3p0GPYegAAMHmgww (envelope-from ); Wed, 25 Jan 2023 08:33:49 +0000 Date: Wed, 25 Jan 2023 09:33:49 +0100 From: Michal Hocko To: Leonardo Bras Cc: Johannes Weiner , Roman Gushchin , Shakeel Butt , Muchun Song , Andrew Morton , Marcelo Tosatti , 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230125073502.743446-1-leobras@redhat.com> X-Rspam-User: X-Rspamd-Queue-Id: 49545140003 X-Rspamd-Server: rspam01 X-Stat-Signature: g8thxsojufws9e69qcmq77forht357k4 X-HE-Tag: 1674635631-818031 X-HE-Meta: U2FsdGVkX1+OzeBN6UYEpfijJhZ0actG3LjYhgzEkCZMgOK7uvsi0VQ3Ou7qhbHrbSQeQREnYV51VB1wRb3qRCqDl0RnWsBqMyHQfEN4skDMjmnZcSiC7BKX/XSw2eFWFw8qQJ1wYn4Ntj98Of+zlpNF7v3RxD5iaEVJnXtLmRtPYi8GvInYplvhsrIiNdwA2mu4w728VW3Yq3ghqSQFsmxrRVrH0TKlsgo0djnFPBn2A+bM+K5mxBIX634ETPKJnJo0/sH0pkXCnjbup5knj8Xq+7XenT5BrT0VV1P2c5hoxWHfl65iInGTfo8diAeu28mNXj2RRPUyvJak5DMEnhq+tMH8W01iCt+c1LD8A1WG5Zq/4Nlh79sUrhM1lCL3EWtotWFdF268jZr4l4cIU6KbmAGVb+b3eVsXpAD7KDxHOD0tDMR3AqVMOVAh/IPRV+NgAfRPKLq3a12KLWrlINtvrgCygol35Sr/FN6df8AIFSG5hxSFLppnt0gIPBdUBsDwwBS22aT9TYiZCD+Bn2+psBOaNDS0um2DwX5FlbW1d8YXtRHt8y4nbg0Ron3XJdQbigTojbdOf1JONbW5Im5rz/8wGG/mRS33iFoDJHMXPhC6V8jgUISxSsvi6fXzmTi2/TgGqyp5GHwDsF8ZbsOIIqf/SW1DbE/DVx2KqzdIpzkjEwiWpyxNNYd/t6CevhxjpYNrmCFrIquf2gBWe2DLYkC2WYQ4q8AeKX9IKnX+JD7VCq+E4vZqGrqLepKdEnIR0ENNp/34xcXzghBa9X6AQbfTrQRKUO+uYwfLtiqXYnK1cmmvvpbnaQVzitnqBMrPEE/gjL34MqFYffMNxnCk/K9fdVG4SOpbzHsgvuYpuPPqRJAnflTVPdPJ6SfbfViDtYgRc9Ju2oC5k874CflSDuNwu4IAolB8UMsN6YxkfKEbMVKFk8xhCwGOeP5kGN9Fibqr1wpwvU5bwZM nS2ZYO/V wTUGmQ+DhHkXrVbLrrLnCSuNes8QwHwzipQRf3tJHrWaxAw+Q0UTgsc7Qt1n9WmSBcXekX3WacaeHUf6JTjtuntIfn1fs6KIj7ul7Cs4dvZzxq2f5dFE0PDVxrNAudwBJbgP7bvXeT0ZH64UqBWvz2WYVIrBKAwPeXs+sWYkHLNU6Ip2kEd3hZimUgbmCVci26325H+7IyKT7h6wBy6d9c+g9Dg== X-Bogosity: Ham, tests=bogofilter, spamicity=0.026384, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed 25-01-23 04:34:57, Leonardo Bras wrote: > Disclaimer: > a - The cover letter got bigger than expected, so I had to split it in > sections to better organize myself. I am not very confortable with it. > b - Performance numbers below did not include patch 5/5 (Remove flags > from memcg_stock_pcp), which could further improve performance for > drain_all_stock(), but I could only notice the optimization at the > last minute. > > > 0 - Motivation: > On current codebase, when drain_all_stock() is ran, it will schedule a > drain_local_stock() for each cpu that has a percpu stock associated with a > descendant of a given root_memcg. > > This happens even on 'isolated cpus', a feature commonly used on workloads that > are sensitive to interruption and context switching such as vRAN and Industrial > Control Systems. > > Since this scheduling behavior is a problem to those workloads, the proposal is > to replace the current local_lock + schedule_work_on() solution with a per-cpu > spinlock. If IIRC we have also discussed that isolated CPUs can simply opt out from the pcp caching and therefore the problem would be avoided altogether without changes to the locking scheme. I do not see anything regarding that in this submission. Could you elaborate why you have abandoned this option? -- Michal Hocko SUSE Labs