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 CE0C0C05027 for ; Thu, 26 Jan 2023 18:37:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 371966B0073; Thu, 26 Jan 2023 13:37:21 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 2FA256B0074; Thu, 26 Jan 2023 13:37:21 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 199EE6B0075; Thu, 26 Jan 2023 13:37:21 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 0856C6B0073 for ; Thu, 26 Jan 2023 13:37:21 -0500 (EST) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id C7E49C08D5 for ; Thu, 26 Jan 2023 18:37:20 +0000 (UTC) X-FDA: 80397807840.02.34CD9DD Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf22.hostedemail.com (Postfix) with ESMTP id 03C01C0004 for ; Thu, 26 Jan 2023 18:37:18 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Zoh75AFu; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf22.hostedemail.com: domain of mtosatti@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=mtosatti@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1674758239; 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=gGHM4HTnlAbJdDikf/52fslq7b3KLZl+rEC55qRtjz8=; b=jMqb2coS0XSmrvMpgl1ZE3Ls8K07EnsWb8gB+mn8yQdJFx27k62nlfFV33G1ctZ7ejKxjP 0J8s1fHoqiFHJDq5VLzQi8iP4bsOoWjcKULVyBqzljrveWUivZl5K/QtK5Fi0289ZWEYVV aArRPPT8tag4qjZB89hwjRD6sdJ6GOI= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Zoh75AFu; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf22.hostedemail.com: domain of mtosatti@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=mtosatti@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1674758239; a=rsa-sha256; cv=none; b=lx0mqgR1GzKykUsd+UTrLE8LVf7bBKqy6c1Y0UDaSk7tkWSKM+7UPHhb5rZ7GVDIbUAetS 4oSF6fJI/tjm8j3sRl9XkdHAgh+5dMSWwIKWaOKvHWFoN575262X/iMy3Y+O47RdsIGThZ vzqt06p+KiKVPDyYZh44PiXVPJ8p3dQ= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1674758238; h=from:from:reply-to:subject:subject: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=gGHM4HTnlAbJdDikf/52fslq7b3KLZl+rEC55qRtjz8=; b=Zoh75AFukjZDgRIex9Yyf4NX2ihSBcMJS1zvkouykGDbzdNk1tYIXL0dP6EKZ4nEScmphh oRFE7ULxFDowjOYj1K8VEas8Y/pG3iL2jEGevfbqoBbluUdn14lgzTsOnjy81k75RbgOki Iq0lIf4/7yqlFImcU5oH+eGvnAjn1cA= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-288-eUNj429XPXSI6cDdVbl3kA-1; Thu, 26 Jan 2023 13:37:13 -0500 X-MC-Unique: eUNj429XPXSI6cDdVbl3kA-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 90999101A521; Thu, 26 Jan 2023 18:37:12 +0000 (UTC) Received: from tpad.localdomain (ovpn-112-3.gru2.redhat.com [10.97.112.3]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5AAE21121330; Thu, 26 Jan 2023 18:37:12 +0000 (UTC) Received: by tpad.localdomain (Postfix, from userid 1000) id 68E82403D52A8; Thu, 26 Jan 2023 15:14:25 -0300 (-03) Date: Thu, 26 Jan 2023 15:14:25 -0300 From: Marcelo Tosatti To: Michal Hocko 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-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 03C01C0004 X-Stat-Signature: ex7sbczwp8m1kkfgyuwbmt8yz4fe3pt8 X-HE-Tag: 1674758238-631537 X-HE-Meta: U2FsdGVkX1+b98aKNgJMtLCKcoGiGDZRDc6C65kHe1mWS491H6io0Khf/E/+LiNPuLoS+M5ev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iOZ1so1JgfXUBS2ZWKiWN6wuj/WqJ5WfUfaJW6c9bx+berXIcu404YGao3g+OiJNaH2QZUH0V23Szjo0FUhKblvB/3o6I0ZOx08b1ItoY6SyhcbFDNdqTWsgyGlqZg== 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, 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. "Minchan Kim tested this independently and reported; My workload is not NOHZ CPUs but run apps under heavy memory pressure so they goes to direct reclaim and be stuck on drain_all_pages until work on workqueue run." Therefore using a workqueue to drain memcg pcps also depends on the remote CPU executing that work item in time (which can stall the following). No? === 7 3141 mm/memory.c <> if (mem_cgroup_charge(page_folio(new_page), mm, GFP_KERNEL)) 8 4118 mm/memory.c <> if (mem_cgroup_charge(page_folio(page), vma->vm_mm, GFP_KERNEL)) 9 4577 mm/memory.c <> if (mem_cgroup_charge(page_folio(vmf->cow_page), vma->vm_mm, 10 621 mm/migrate_device.c <> if (mem_cgroup_charge(page_folio(page), vma->vm_mm, GFP_KERNEL)) 11 710 mm/shmem.c <> error = mem_cgroup_charge(folio, charge_mm, gfp);