Received: by 2002:a05:6500:1b8f:b0:1fa:5c73:8e2d with SMTP id df15csp83510lqb; Tue, 28 May 2024 09:24:18 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXMiGcpws60yKMDWfH6cdvtgti/aBhkoFODaIARTXGroZib9JAWnCccuL78sOXSgZA0gU+pllD5WvRkhiudIKLZAP1FTHi6YmoNQgzE/w== X-Google-Smtp-Source: AGHT+IE7Vy+n9QjgCusqAa74E9fMVZR8tGFkTcPey3OMfElQGJ+ySiZaJ6iFk1HtBLX0XgNV0HCp X-Received: by 2002:a17:90a:f411:b0:2bd:ed6d:de9 with SMTP id 98e67ed59e1d1-2bf5e1680demr11084261a91.24.1716913458065; Tue, 28 May 2024 09:24:18 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716913458; cv=pass; d=google.com; s=arc-20160816; b=Hcyi2oeuJNMRjliCPO0aBtbluCXn8HTUofrZV1vranocQilNcI84R2Oy/hpvhfq6wj rse8oSjUfGqL3XbIFH9RQDW3MaO1a3adrlcT8734SnsXQE6e9sgtsb4dAV5wZTOLxKC0 eqkjFe+u+4AhUKwobBNv+pNv8CIaIC06AOOKbhK9O4Cyn8fOx1GtPNqiMuJHPtVmwdbn fEDkZf9onWgKBxhZEfK6zDECc6oFSJakxEyW/bBCa9vWId8+cIiUYqjvBP3InfMEG/nP jbAQlfE0a1eopFZbWz1P46Y3YbhvziEeBC/WgMKm8WUq2KOyrwsUOsp3uZW0G1EuZ5BO r7qA== 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:date:dkim-signature; bh=RwbKJL0aOzLIgnsN1ukvH4Q5U1NY/tSAejcb89Pd2BU=; fh=UTwFoNoRPs5fVM5t32PDjtFy+0Je/E62EGomTFLzp10=; b=C6xw8yg4mXe9yFF2kjYVkgwMcWQE4JPQ5vaC+HSS+S2SycoTV6Y3AOU4N6KCK010v/ OPpM5QYaadXiwwhg1xcFsyDbONcsBbxws+r5nUoi7XpbYXJeHi+WmxS+XTUPFSeEw6yB qcXxLgbAXR0OAMvRYUNhWvJpEv2aeQ6jDp9mhQIv1XHFzW6CwT8OuOyX4frlwJcoHtwi GOkfjlTORUOMwsrcZS8DPR+XU/zqHLkGAqjm1FF1letq7VLpGpiNP9o8tcROxvXsYWKt 6+FHTsFIOPojazRdqeYJGJXUoz5K1D53Rrq2P+8JsM0unIxtCdo5SxUxXWEr/G3Wmf84 lDxA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=YlEPXBNI; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-192743-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-192743-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id 98e67ed59e1d1-2c00d53d5a7si1474052a91.82.2024.05.28.09.24.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 May 2024 09:24:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-192743-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=YlEPXBNI; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-192743-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-192743-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 9648CB23A38 for ; Tue, 28 May 2024 16:22:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id ABDC2172BB9; Tue, 28 May 2024 16:22:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="YlEPXBNI" Received: from out-183.mta0.migadu.com (out-183.mta0.migadu.com [91.218.175.183]) (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 472CD172786 for ; Tue, 28 May 2024 16:22:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.183 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716913327; cv=none; b=NnOYiOC7urKNBELJ416WtlxcOK5lYS4ixBZtX0Jhf97T0jNSfXGOSZue5MCqrXUbxdHlvRmTXj5xJpD63QPRA58soFRudbUcDS9RPINKAghNT3DZatIDiCf+lTgTc87UVp1LNlGYs6c0NVSs6KwHzt8PhLWNGnX2cv8TpsuaTVo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716913327; c=relaxed/simple; bh=MqiyZfkT6eQztX+ybnjyMbWGfzL4Yyk8SQs61OHL58k=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=GApbXi9XmydfOEgWyPmA1NrHLgmrvc1AZyKOvkHZAIBA/hcewmvsOtHmO8ocPyzIv07xF81tEHPNzWvz9hdh2wirt2KuYkKRsTHx7dBmOT0rS2q59+W3hQvlwqTlwJpRZVB7l6yQEOg3MkFSRGT7zA/C6sT/O0Y4F4aV/sRHOls= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=YlEPXBNI; arc=none smtp.client-ip=91.218.175.183 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev X-Envelope-To: bigeasy@linutronix.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1716913324; 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=RwbKJL0aOzLIgnsN1ukvH4Q5U1NY/tSAejcb89Pd2BU=; b=YlEPXBNI4uitoGzQZGYWohMfIMssJg6G2jr6MVlz5/2JXLPXCYVfko+Kn82+jrfB7zPItT yKS4Ie6U7oKbccuFs5clsnPuLLiL0r+YYghOiPDOOmAX7cJ0bii07/BOuZmreN6672dF/7 jD0hlvQbLW0JZmZ004lBch9ZqmETEcM= X-Envelope-To: vbabka@kernel.org X-Envelope-To: akpm@linux-foundation.org X-Envelope-To: hannes@cmpxchg.org X-Envelope-To: mhocko@kernel.org X-Envelope-To: roman.gushchin@linux.dev X-Envelope-To: muchun.song@linux.dev X-Envelope-To: linux-mm@kvack.org X-Envelope-To: linux-kernel@vger.kernel.org X-Envelope-To: tglx@linutronix.de Date: Tue, 28 May 2024 09:21:59 -0700 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Shakeel Butt To: Sebastian Andrzej Siewior Cc: "Vlastimil Babka (SUSE)" , 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: Remove the lockdep assert from __mod_objcg_mlstate(). Message-ID: References: <20240528121928.i-Gu7Jvg@linutronix.de> <09e085bb-f09e-4901-a2dd-a0b789bb8a4d@kernel.org> <20240528134027.OxDASsS3@linutronix.de> <20240528141341.rz_rytN_@linutronix.de> 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=us-ascii Content-Disposition: inline In-Reply-To: <20240528141341.rz_rytN_@linutronix.de> X-Migadu-Flow: FLOW_OUT On Tue, May 28, 2024 at 04:13:41PM GMT, Sebastian Andrzej Siewior wrote: > The assert was introduced in the commit cited below as an insurance that > the semantic is the same after the local_irq_save() has been removed and > the function has been made static. > > The original requirement to disable interrupt was due the modification > of per-CPU counters which require interrupts to be disabled because the > counter update operation is not atomic and some of the counters are > updated from interrupt context. > > All callers of __mod_objcg_mlstate() acquire a lock > (memcg_stock.stock_lock) which disables interrupts on !PREEMPT_RT and > the lockdep assert is satisfied. On PREEMPT_RT the interrupts are not > disabled and the assert triggers. > > The safety of the counter update is already ensured by > VM_WARN_ON_IRQS_ENABLED() which is part of __mod_memcg_lruvec_state() and > does not require yet another check. > > Remove the lockdep assert from __mod_objcg_mlstate(). > > Fixes: 91882c1617c15 ("memcg: simple cleanup of stats update functions") > Link: https://lore.kernel.org/r/20240528121928.i-Gu7Jvg@linutronix.de > Signed-off-by: Sebastian Andrzej Siewior Acked-by: Shakeel Butt