Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp2543124lqb; Tue, 28 May 2024 03:19:20 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUAHlGMr/gbzo3N7w33j9YjFsIuxoW86MNmSjvErVIkgbuaU8p6HvIFoZc/RoNPqiorvo6jxpw3aTTLteDV5uKILr0Hq0Z8z4Ug7LojEA== X-Google-Smtp-Source: AGHT+IEAoa2yEr/xnOu0pVFR1WGZ5qKLv6OcgLMbsAiuGJgF4BGztBLyI4Om/oljD9kGPWXUPOKx X-Received: by 2002:a50:f68d:0:b0:578:5f47:145a with SMTP id 4fb4d7f45d1cf-5785f4715e3mr9657673a12.4.1716891560211; Tue, 28 May 2024 03:19:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716891560; cv=pass; d=google.com; s=arc-20160816; b=NsOo2SgAQOWCjn2zZurARhvzzUULvxEcpzUE3n6uC0ZVe6AQXADRe08St6/sUuT7sf XwtwQQi80pCqYZEC9Y/1wdZg6FGcGtRHBXWRWjKV0ERBTlQpgZ5yNE02Bdyd/A9NgBSC Z7uOSXfvd79l0JLGwAGTtR11Krg7Jv+BPKcMQZiCiqJjqS3aYWOaXkSY1gQ/wBtRhSPH wgr1xyTLFe0dYp9Qw96dSJK0TFJM1jzluISw+Ucq2DhfdPkp1L9j408LfjopsfZxSa7h aoppOmRQ4fLkfq88mlyqhzg4lwbJohCMGJAhQelGr4gWjRBEq/VD6GnqwrryYcYPFQMJ JHWw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:dkim-signature:dkim-signature:date; bh=Oj4XdVUI9qLUqsuyCq3B3lu21WNFGQYe/dCkjjZ08E8=; fh=GmvVFmSVaaiEuQnyL4keyQ9LIblNua/mtQPfXZT4Mh4=; b=d40+HiE5pOqSnAAi3KplhQ6J4QwqnsL7s+DTY6xexN7CTTElfTDyotj1fOn5+izM4g sKtoEJ2KozBmP94Lz0m0Qcpcc1EXzyx2URSsPsus8IU6+JpImSWn7YHFJilAVLDZNSN5 DbS2VxiN5SZ86+U8NE5ZyYwDq0ZT2ZwKTAKrGL4avtzHIFTDBEivUCk0rv2G5IBl24CY hM/F56FbSb4xMNnYMacr8Yw0m4RMB6ZvgOoEz1VQoBfy9LFbRmduYX35oJvzqP26/BMd 0eFZ21tS4lAG6f6PSHd7w/3F99SvNSa5+jPD+RYfD1LcxKWKKenc4Nd5tVQEhjk9fXdz 7xtw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="c/OMErT6"; dkim=neutral (no key) header.i=@linutronix.de; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-192095-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-192095-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-579d302712csi2228253a12.232.2024.05.28.03.19.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 May 2024 03:19:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-192095-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="c/OMErT6"; dkim=neutral (no key) header.i=@linutronix.de; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-192095-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-192095-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id E886B1F2141C for ; Tue, 28 May 2024 10:19:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DCAD9169AC9; Tue, 28 May 2024 10:19:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="c/OMErT6"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="ANOcN4Q+" Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B18A715E96 for ; Tue, 28 May 2024 10:19:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716891553; cv=none; b=qI8P6+VLDB12Cdu1gwk2kGbirG4XoFqCslCsaQnY8ty54U2o7MGejQe2T1cjwAV7Jb5D/3eafpnmRTYnKzfjzHhiFfejFZfKGgHG/yyxKGsQo/GdbgQdubJn3pt5i7Y2KtGpPo0KBdlSSkXpNJEWMGttHf29R3QYLchM3MrOVfA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716891553; c=relaxed/simple; bh=Ya9VdVB0Xq6yIt8kP/OA7nigs6apnznopnU3bqowtAU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=UIQE3qPnli7+/V+Asugjir+HeS0xsJ00K7okJ614bHzPDczx+dmS9/IldHkFWlLZIyG8Y2NY0MTPZgak7UqgLxvJ/kQBL2SnW5Y36Taqa6AsM+CQWsEedXaQLEMFd1vO71Dj6KpLsYOQW97PXdnASCtltGP5vF9HlE0SwtvXetE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=c/OMErT6; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=ANOcN4Q+; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Date: Tue, 28 May 2024 12:19:06 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1716891548; 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=Oj4XdVUI9qLUqsuyCq3B3lu21WNFGQYe/dCkjjZ08E8=; b=c/OMErT65eQpDjOOuCoAlir2qD9xE0i98dbANpjAG9uVf4pNhkmV2AveVZgwomMwfsNI/6 h273vMV2rgx7Opv2JM9vUHs4i2+dytB4xZquvs89ZwpzCijRZ1kIJMt9EhFydA1HT2GeoF 1u3TqP3RBUKH5QS9o0emIPrVsVsylQ7SxRrUjq2afFoXcctdt92PRzWHmMQBVJvt7sgzde /a0Uc5oG+2/S6GEHcaeekjKlsqmeFvGfDNpDzy3Fgnhxz8bAyHuTWqwBaESiiQl4+2ndYm RfFrCujtsCBWBlklCPSfqtzbMRm2UmeQuE11eb8DTzNjihupGM+dz+PgUbJUbg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1716891548; 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=Oj4XdVUI9qLUqsuyCq3B3lu21WNFGQYe/dCkjjZ08E8=; b=ANOcN4Q+/n0ojmW/+nTv158Zi0sbQEPrSXevIiJYINPUmHcTVz9JU27KnrR29TSxkc5E8a aZwJdLmoLgqUNSCQ== From: Sebastian Andrzej Siewior To: "Vlastimil Babka (SUSE)" Cc: Shakeel Butt , Andrew Morton , Johannes Weiner , Michal Hocko , Roman Gushchin , Muchun Song , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Thomas Gleixner Subject: Re: [PATCH v2] memcg: simple cleanup of stats update functions Message-ID: <20240528101906.ts4NjHvU@linutronix.de> References: <20240420232505.2768428-1-shakeel.butt@linux.dev> <20240527152200.P1rU7FaG@linutronix.de> <86006806-4ffc-4330-ab4b-29215ab2c98c@kernel.org> <20240528075623.oFcU1JLj@linutronix.de> <69c0e008-ddde-4a38-b856-b765dc2b9745@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <69c0e008-ddde-4a38-b856-b765dc2b9745@kernel.org> On 2024-05-28 10:10:50 [+0200], Vlastimil Babka (SUSE) wrote: > > I don't mind sending a patch. I'm just not sure if the lock is the right > > thing to do. However it should ensure that interrupts are disabled on > > !RT for the sake of the counter update (if observed in IRQ context). > > Looks like some places there use VM_WARN_ON_IRQS_ENABLED() that's turned off > for PREEMPT_RT, so maybe that's what should replace the current > lockdep_assert, perhaps together with > lockdep_assert_held(this_cpu_ptr(&memcg_stock.stock_lock)); > > But also __mod_memcg_lruvec_state() already has that VM_WARN_ON. This "VM_WARN_ON_IRQS_ENABLED" is the initial assert for "interrupts must be disabled while change the counter". You want to replace it with lockdep? Part of its requirement was that it yells with lockdep disabled. Currently I am leaning towards removing the lockdep_assert_irqs_disabled() from __mod_objcg_mlstate(). Nothing but the counter need it and they have their own check. So? Sebastian