Received: by 2002:ab2:394c:0:b0:1fa:7d89:a951 with SMTP id v12csp955936lqe; Tue, 28 May 2024 07:19:29 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUw4Zace0iIq4YtBDZXCJuwhmjc28xINCZ/FmO8qbAHfXc9lp0aNc8dMkPrskYlL/GGcVMhIGKNHXmnoU1/ZgjxI4KHC5qVMEcckRPAKw== X-Google-Smtp-Source: AGHT+IG00ys2x7z+3/GC4EJ1jStJl94NyT0CL7EPN82lcwUb+JIezjNeIZNfv11Z2V6nV9fl1TjS X-Received: by 2002:a50:c359:0:b0:578:5ee4:921f with SMTP id 4fb4d7f45d1cf-5785ee495f6mr7878986a12.13.1716905969244; Tue, 28 May 2024 07:19:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716905969; cv=pass; d=google.com; s=arc-20160816; b=ipGwjkcp8YVC83AHef8Jti4v7gaLW3OJyfTKfnMRpG7GqiYdn/7RILBcv1cpPcTPxy YNxSiGQr20025ukgtZic4qIvMvNPm6DD1pEm1BAdEdqevpYnOeWjk47pp1hRIKUg1Oj8 nd/qCtvCPjW9N1JS0myupmEm7mJ477uEB+nGtYibdW6MYwD1xTDNDcPNXT6r++f67b8e pUUn691sbX8KYEIMIfyRGYq1PKF3sFT9nk35MsvwrxuNz6EEHtRijQPxv2cv8rrQwJp6 eOTCOnmmwy6oN5bNpWdDWkPyKBT4rt9A7DSsRneWK8GHoI3R5E6W8q6T5iCqsiDO7V+i hBmA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=cbtoR/HKXzOVrz9XYyOBHWbWRC57ot0BsCfKiasBa1Q=; fh=2ff9D3Ne91B3wVn+sUe7GV2e+bcL38oL+5GAqfNhaPI=; b=vV3cg17FFXJ6bfktNvT687UpQGcCknXL7fy8jllzrC2UPhkNsVwQe02H8qf0hMeh3S jwPQ8OrZkHLiIG9RgQmCEcLClD3rO04rEO2IVXvnEXmFLLzoUMnpuimhsoxkGzQpVDzy TzNeF46SW/Ra21ek7tNL8NO8ki0Ir1UlPxHh52IFvu1irYEQuka5GA0OAM3UtfCLCTvH cQWbPnnQAw1Ry8o6GVB6HvG4kbL7lPFY2FCcJBch4GY1plNeWZDqA/FlfZc7EWFld1jF giz7YcSRBJrRTPVW7Uq4ehwA4EnsDhvNZJfPNqX9zjsARMAifUrWffhVQCvfHroKMxTn 9nWQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="E7vgjl/V"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-192514-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-192514-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-579c4d7168esi3407952a12.212.2024.05.28.07.19.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 May 2024 07:19:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-192514-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=@kernel.org header.s=k20201202 header.b="E7vgjl/V"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-192514-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-192514-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 A28DE1F23202 for ; Tue, 28 May 2024 14:19:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7917416F84F; Tue, 28 May 2024 14:19:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="E7vgjl/V" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 A5D5F16E895 for ; Tue, 28 May 2024 14:19:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716905958; cv=none; b=r985iDd5Xg04D7ScRR6QRm28ICvuqYIxbSgGE899lCreyMdB6l31PBEX2oObadTF/oOasF7YPrMgdJ9r4OkQBwH/mSf4q2c1/Bp8S3ad87120han9IzT7ZxZ5kSoGA/wh9zD/8p79kW2kW+k6WLHQHRJLbxkkz7vNRiuMPiqtgE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716905958; c=relaxed/simple; bh=yuPDGgUn+VpqJiWJHL5pFexMSMO0h7DglLbUSyFNJ5Y=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=kNgTugJqAleSiPD/txaQhYMem040GMZbLAHAx/RBxRuDugDjl/Ytudhp8CMluCs69Mkd69Fb/iutLQylV3mSN8QXUNYTEMNRym666duUT6SPE+APg5ZGPDs7U2NTxnd0rLUx3dD3q/YmwNNLkfva2W0NPdQJhEYk0ROWfzpUC74= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=E7vgjl/V; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 415C7C3277B; Tue, 28 May 2024 14:19:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1716905958; bh=yuPDGgUn+VpqJiWJHL5pFexMSMO0h7DglLbUSyFNJ5Y=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=E7vgjl/Vztm2dNd7g3fcwJZSC9bQIl/dDnx7qD4i9yL3YYEYfUFzGVIb4T0QZLi7z Vx9xUR7HGlRrdvVzyMrEPer5QIPqvdkKi9dE301/IWlqSdpQnmW424JRVgM7kEMX8Y TNvyBdnw0f+nA7QbJ5SIf34APGwvIYDlCtwcHugeNe3sJlInHH6YTzvXKUeAdCwi/C igx906FH1Nkgt+wKfaYxXdCicVg3vkdjqYMA1t7ZZRU5dvZAuyBaprkmHLS5LKCZkL qFVRMmiVYo+BwZkDbq9dVHaUWRO5OJW5FWHKFB5Rd4ydnnFTBTzDLrbzKiauxIYqvR Nnv6nB3VpWq8Q== Message-ID: <3f4c0d70-8689-40a9-b051-13d013c4f09c@kernel.org> Date: Tue, 28 May 2024 16:19:14 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] memcg: Remove the lockdep assert from __mod_objcg_mlstate(). Content-Language: en-US To: Sebastian Andrzej Siewior Cc: Shakeel Butt , Andrew Morton , Johannes Weiner , Michal Hocko , Roman Gushchin , Muchun Song , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Thomas Gleixner References: <20240528121928.i-Gu7Jvg@linutronix.de> <09e085bb-f09e-4901-a2dd-a0b789bb8a4d@kernel.org> <20240528134027.OxDASsS3@linutronix.de> <20240528141341.rz_rytN_@linutronix.de> From: "Vlastimil Babka (SUSE)" In-Reply-To: <20240528141341.rz_rytN_@linutronix.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 5/28/24 4:13 PM, 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: Vlastimil Babka mm-hotfixes as it's a rc1 regression > --- > On 2024-05-28 15:44:51 [+0200], Vlastimil Babka (SUSE) wrote: >> I think just s/memcg_stats_lock()/__mod_memcg_lruvec_state()/ in your >> phrasing, since we are removing the lockdep assert from path that calls >> __mod_memcg_lruvec_state() and not memcg_stats_lock()? >> Or am I missing something? > > Yeah, makes sense. > > mm/memcontrol.c | 2 -- > 1 file changed, 2 deletions(-) > > --- a/mm/memcontrol.c > +++ b/mm/memcontrol.c > @@ -3147,8 +3147,6 @@ static inline void __mod_objcg_mlstate(s > struct mem_cgroup *memcg; > struct lruvec *lruvec; > > - lockdep_assert_irqs_disabled(); > - > rcu_read_lock(); > memcg = obj_cgroup_memcg(objcg); > lruvec = mem_cgroup_lruvec(memcg, pgdat);