Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp2610451lqb; Tue, 28 May 2024 05:35:05 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXpuem+jxCJawMCq9V8SoUSX5phJ4oeXq7BhAcYYB2ZLnQZL88MBnP/wL52J/nhwcJzD4eZYO9p+KFvH89bVH77au6fVm1qCgJ74CfB6g== X-Google-Smtp-Source: AGHT+IEpSVL45QmqRbeSUShUoB+unnpp5Zuhrdh3Izzawt3D63Oo77Myl5hgYewh3U03JwsO5Xf+ X-Received: by 2002:a17:90a:ff15:b0:2bd:e076:8798 with SMTP id 98e67ed59e1d1-2bf5e6600d3mr9695275a91.24.1716899705198; Tue, 28 May 2024 05:35:05 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716899705; cv=pass; d=google.com; s=arc-20160816; b=mWSJGoLzsxj11QDA2MQuY0MjWVHlVUJirAODskwvAIfTrVUEwGp1qRyMw2i9olhmfq iUTqADSOApuH9dmpGWIEaYBO65gO5wjSwiqa96p5KM77r4jieqENAH2wJbIvTtbHepfs 8n7pDUooL6A51nx7M844S9xAHXjs7OiJOaU7+0NNHgsyGieorGmyRKZSpNL3OLyJ/Kkf Zqdxfn2i7/BNaEzCSy6Qzo+iKYzJ4G54oHX15n+P0o2xeulXSb+UXPQePjH6JajDNcUB /i7uVX4W/kBhUc84gbdfsrNRxzjUr6ctvZvVH9+pLvuSoO30B5ykDpjZfs+GKseku8lO Ic7g== 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=svrr+2nvc+J6CjsWXCj4zmWtCebDkdfy2H7kPuQqAp0=; fh=2ff9D3Ne91B3wVn+sUe7GV2e+bcL38oL+5GAqfNhaPI=; b=UF+iEit7ydtk1D7aje2m3YHDxtp1G0a8WIAMDIYDQvG0cezi8I6trgiuuMFUR6WBEO aERR+QLwSJTlMUgZcvlLBIukheeWYtrcYEs6/5USIPvl8LzZlB/jHvdZRX/HipaFw0oz QLzG91yKp7oAb3DRe20gCrTz1kB3e2GFT0fs6cxwsBfPFnbo3CEsCi02TY3lBpWdxhst MpgOPYXgqPeC1eaJKGA62SzdkFDLQcwmn8WTfqV0Cf5hHCGSGc2doOclra4Cpkv7DdvU /A1GDA/h8XmEJpWiHahDc2RgvAJja3jUFjfTLfrduy9Bs7NekqXarEX8srg/qiD9XiMt SkHw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jXS7Cjui; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-192309-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-192309-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 98e67ed59e1d1-2bf5fe347d7si7929597a91.125.2024.05.28.05.35.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 May 2024 05:35:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-192309-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jXS7Cjui; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-192309-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-192309-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id D0A3B282B15 for ; Tue, 28 May 2024 12:35:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D8F7316D4E6; Tue, 28 May 2024 12:34:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="jXS7Cjui" 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 0FBAE502B9 for ; Tue, 28 May 2024 12:34:58 +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=1716899699; cv=none; b=ejn78LP6CJ+wbFuB2VNzO5VDEkAiYoeEJ/C4PlObYkU3j6tvx864W5oRHbKoh/2+yVvLttoQI9HpoSmupJY5NQYVLdlO/yiKAdSzFB7FVfkVvbuw7CpQ9dI35HRqpVCU4oLPuMtai6u14IwWe4iekBy+zBI4AmvYdoAZ5PgUm9A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716899699; c=relaxed/simple; bh=OXBNq2DCVe/9Ba++zAGJfyl/7AkqAaG5L7+KqLyGUg0=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=HTQgJRq4knTVl2jzUD7CeBx/FoHqeQsXFnUZN3XOad6NEMyJoeikdYhIgGWunmrfVosb98v/HDYoqYZ2fJurAVP6NGXOJ/990GdSh/IPVXisutUK0wf209Rkr5s0kutoOCTpsUUv0rLzKuPeHTNbV7P5mH4WHMZ5RcRWooA2COo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=jXS7Cjui; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id AF36BC32782; Tue, 28 May 2024 12:34:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1716899698; bh=OXBNq2DCVe/9Ba++zAGJfyl/7AkqAaG5L7+KqLyGUg0=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=jXS7CjuiItpMTYwxbpCNT2T9U4jeXg6Nigw3MpWl2GCOzDcC+P5bmvFidqN7rd7fF tUzK72Sw+2BhK2ThJasAza1QNi2JajeF0EImZPL8ds97rhduxllbhXyaGASZHoqvqV CrOLPM2lFdlqHa9BAb8xQ3onsrrRk5q75asNGfZ1S8XgxxVoS/UlUI62C3anLsFfKv dRKlBhxycNSqr2blAkod13P1ZZZ71ilWmHSgCcf6cgoREjfOSz4WaOI9ps/8KG158E zac0/LVA1162X+fKZVdzFWo8BgrAqsolwJ5vq6HUWOs+jMpO4Yd20ja7Fw44GaQfzV diYTktnv3rBgg== Message-ID: <09e085bb-f09e-4901-a2dd-a0b789bb8a4d@kernel.org> Date: Tue, 28 May 2024 14:34:55 +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] 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> From: "Vlastimil Babka (SUSE)" In-Reply-To: <20240528121928.i-Gu7Jvg@linutronix.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 5/28/24 2:19 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 memcg_stats_lock() and does > not require yet another check. I think here it's __mod_memcg_lruvec_state() doing the VM_WARN_ON_ as we don't go through memcg_stats_lock()? > Remove the lockdep assert from __mod_objcg_mlstate(). > > Fixes: 91882c1617c15 ("memcg: simple cleanup of stats update functions") > Signed-off-by: Sebastian Andrzej Siewior Acked-by: Vlastimil Babka mm-hotfixes as it's a rc1 regression > --- > 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);