Message ID | 20250404013913.1663035-2-shakeel.butt@linux.dev (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 AE427C3600C for <linux-mm@archiver.kernel.org>; Fri, 4 Apr 2025 01:39:37 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 432796B0024; Thu, 3 Apr 2025 21:39:36 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3E0466B0025; Thu, 3 Apr 2025 21:39:36 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2CE4C6B0026; Thu, 3 Apr 2025 21:39:36 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 0D1066B0024 for <linux-mm@kvack.org>; Thu, 3 Apr 2025 21:39:36 -0400 (EDT) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id A03BEAD1A8 for <linux-mm@kvack.org>; Fri, 4 Apr 2025 01:39:36 +0000 (UTC) X-FDA: 83294654352.12.3D1B8C8 Received: from out-182.mta1.migadu.com (out-182.mta1.migadu.com [95.215.58.182]) by imf22.hostedemail.com (Postfix) with ESMTP id 05934C0005 for <linux-mm@kvack.org>; Fri, 4 Apr 2025 01:39:34 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b="Gtp/lT7A"; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf22.hostedemail.com: domain of shakeel.butt@linux.dev designates 95.215.58.182 as permitted sender) smtp.mailfrom=shakeel.butt@linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1743730775; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=Umv4btRy/nEoNx2OIY9ZLc4o2g+KibZrAp3iooZEy6Y=; b=7moiQ7Unu2ljAlR6x4hTxxe/3I4N2Czp2SO/6PxbycgEYof1VncmEFVAIJIq7txHSusWcJ 3oDYYySjaAFo6LDiSR2yH9DrJ2djXZgRKXBKo4WZedxHaQQK5QI+dN6zup1c2Xu7QfpgZR M0EL85cR447IZH6Iui3MqszTZRBUtc8= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1743730775; a=rsa-sha256; cv=none; b=CdCtLWUkFJ00DB84pMtvrX0ihskeLqz60GeXjeFMciIzaEh2CehQmjKXh3ipChZGYB6d2l gUddux29D0NPX5hXfjic5743NazHmFe8naGIcE04ElIh5vn6gV9jIc8UK2l7b9y9DpdDip AsPpT4rbDul4mJCH5WfgcSsMNGMkzWw= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b="Gtp/lT7A"; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf22.hostedemail.com: domain of shakeel.butt@linux.dev designates 95.215.58.182 as permitted sender) smtp.mailfrom=shakeel.butt@linux.dev X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1743730773; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Umv4btRy/nEoNx2OIY9ZLc4o2g+KibZrAp3iooZEy6Y=; b=Gtp/lT7ARKgjwmrfUuMxwEW+dvted/jx4y+oaBXV12gQbAtjbE8JtTP3C+4yGfOpV4rVeI zGYBza0gUb2vsRxmh6rV2dHte5ZmqbcQmI0Clp8KzTFduq0UEOnqRA/K9SlVURO2f6fy75 aLWZys/FK/LwV7mCWlcNJVI/EbRZjuk= From: Shakeel Butt <shakeel.butt@linux.dev> To: Andrew Morton <akpm@linux-foundation.org> Cc: Johannes Weiner <hannes@cmpxchg.org>, Michal Hocko <mhocko@kernel.org>, Roman Gushchin <roman.gushchin@linux.dev>, Muchun Song <muchun.song@linux.dev>, Vlastimil Babka <vbabka@suse.cz>, Sebastian Andrzej Siewior <bigeasy@linutronix.de>, linux-mm@kvack.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, Meta kernel team <kernel-team@meta.com> Subject: [PATCH v2 1/9] memcg: remove root memcg check from refill_stock Date: Thu, 3 Apr 2025 18:39:05 -0700 Message-ID: <20250404013913.1663035-2-shakeel.butt@linux.dev> In-Reply-To: <20250404013913.1663035-1-shakeel.butt@linux.dev> References: <20250404013913.1663035-1-shakeel.butt@linux.dev> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 05934C0005 X-Stat-Signature: 83mgwy3pdaxmqo5bazg7eb7fnqdhp1i8 X-Rspam-User: X-HE-Tag: 1743730774-519719 X-HE-Meta: U2FsdGVkX19O/QHscmm6tM4icQWPDPxxoW1g5MjggbFf6isAhzKqBUQVS1MAtDl05hw1BHf9pVbn1ncWg2dO6qykumS3FhgOKW/3dJTPhPozhLk2QngitVJxlYr2ulNw2snSwInGOmK4MfuzwxIQinJf7tzhVD9546ZVM5vjF9qKGfUyF2+J+ow+JK2XJxZ31RypuAjojCa2PcExahVHv/UvCcGm0ZHRkQRUxxIqTM+XVjPvJeYIoSXNBefPSQVIqSP9C0I8+vRzccqppQQaQmLPXaut/YAxSDr2s0FnWaDfu6US61uVKOpemryIcZEYedxQD7k09URfgTgRMkNncXV0cdGkP/6xiilaPxlx3KlLSca4vzdwrwxsZk6n81yN57iecu+GUqlBD09Oo9PMZgi0DbmbWSzOiUlEyooknKZ8BXq6olcn5NpG4lkr3ABcudQL7s7eYyhXc3Cyf9Qp1YJ752IiBIuT28q8W5b3IdSTluMMRRNJ86qOdhlIO4Cph3snlR8mXipmqkwN4n0DzMeF88ufj6zW7V4zdvbjdvFSn217AEnWEblD5lTYpekF8K8m03GtLvY7BYu9w54pUQcrOjdSX9mwhpP5Q6rWXUkjrx8hWmUFV9cKb0r6Pkr+kZZkF9Ra4te4HcEh67cE27K/pvZy5mcJxeCjTucQSzHeSGKRENoeuNHvbNuh1pBM4By9nFBwLoglyGr4TKfPUMnVJivVRT9ir+hg5cdw5OBVRG13noY4glXSUW79hCVleiRnH5jv3oYRg0gsT/DrA3w9SMBTD9mJXhsfngOyVwiSCbXIRd/YCZ7TBdsbysqgdl7LqHpnj1taiw55CW8HL1Zze/GJNT97nd/ZioCG/Xnct68Y9qkdpZB1732QsuaP1RtyM1UyhmqDUvsmVI2IHsxbQJkqN/nQc/hwyLUGYHpjiTh1Vz9V0JSEctULAjHvCbROiWzhoSHIifdiEOy 8I1Wd2OR JVIAO/pJb+Du+B4WN5QEmboNErveJOHP7K68B8Zkq9ORlRn7MAodrolGEc1Dpsk5V4SZzlb5mrEZIYLPweVtqta08auYqTwmYyo0Vk2WVc2A5MrGYbX5BZgMpqKd9jDC6xejyawvYvJ24ql01UBSDjFCx09iUyQyC41CfZFnlbEXlcaJpAGX8JFBJG7ssbmlHzDKrZFMVcuLLuiU21dyk6TsyEA== 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: <linux-mm.kvack.org> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
memcg: cleanup per-cpu stock
|
expand
|
diff --git a/mm/memcontrol.c b/mm/memcontrol.c index b16b5b807d7c..ae1e953cead7 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -1893,13 +1893,13 @@ static void refill_stock(struct mem_cgroup *memcg, unsigned int nr_pages) { unsigned long flags; + VM_WARN_ON_ONCE(mem_cgroup_is_root(memcg)); + if (!local_trylock_irqsave(&memcg_stock.stock_lock, flags)) { /* * In case of unlikely failure to lock percpu stock_lock * uncharge memcg directly. */ - if (mem_cgroup_is_root(memcg)) - return; page_counter_uncharge(&memcg->memory, nr_pages); if (do_memsw_account()) page_counter_uncharge(&memcg->memsw, nr_pages);