From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-185.mta0.migadu.com (out-185.mta0.migadu.com [91.218.175.185]) (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 E70317261B for ; Wed, 12 Nov 2025 02:11:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.185 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762913494; cv=none; b=i2p30l9GUvpzTX6cFVohxhuaB5ZjFl2HvHWyYlXeOtPxsUph9o68G6u0+fCOenjcGb5AE32sh9ELLt5VNUoWwpzkSBjyisLCnhQ7NFU6gUb5mwBqlz8cSX9R09NZKz8+Uv/bLNbPz3YbHQVlzUNx1H5aAaNNrEuNo4B0FKqcMfc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762913494; c=relaxed/simple; bh=5Vpj1bb3HpZ52iH36YEe53g0hvKmziXmTRxd5n1R3JM=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=FFIICSBiB51aDSb2FYZ/XzgAWDjRKlD9b8yEYOBzzfJWmjOc2/Cgnjv6mfB8XXM8QoiQ7IlFSW5AJl5XTpBY02F1j+cYqvqjmgPlXYOmvuPSn2fZQF1jzpZ/7aJhJKUevNxbeBbCaPmp6nFrlcufH7E9abi7o1/QmrBM6swurzE= 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=A7XRRi4j; arc=none smtp.client-ip=91.218.175.185 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="A7XRRi4j" Message-ID: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1762913480; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uriJ/UZtbFIWJHYtkqAM7/7gRRqxwaWIv7KjAJwxh2s=; b=A7XRRi4jm9+2dng+brC/ULaeX9wZNMw/VzLlf/tyUGMqCUfZ2beqnlyFDHJ5onqOe9qT/x +xVpymK38zhN1SdT+9T6nvNkJhJWwRUumKKTdfvjlk+gOa4GWGWTPF5Gmf3ZhCEuJaIj/S 4caHjsnL4DfoYVhD3xw/wxg9bXoNT3k= Date: Wed, 12 Nov 2025 10:11:11 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [PATCH 0/4] memcg: cleanup the memcg stats interfaces To: Shakeel Butt Cc: Johannes Weiner , Michal Hocko , Roman Gushchin , Muchun Song , Harry Yoo , Vlastimil Babka , linux-mm@kvack.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, Meta kernel team , Andrew Morton References: <20251110232008.1352063-1-shakeel.butt@linux.dev> <0618ea79-fed3-4d4d-9573-2be49de728cf@linux.dev> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Qi Zheng In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT On 11/12/25 12:45 AM, Shakeel Butt wrote: > On Tue, Nov 11, 2025 at 04:36:14PM +0800, Qi Zheng wrote: >> Hi Shakeel, >> >> On 11/11/25 7:20 AM, Shakeel Butt wrote: >>> The memcg stats are safe against irq (and nmi) context and thus does not >>> require disabling irqs. However for some stats which are also maintained >>> at node level, it is using irq unsafe interface and thus requiring the >>> users to still disables irqs or use interfaces which explicitly disables >>> irqs. Let's move memcg code to use irq safe node level stats function >>> which is already optimized for architectures with HAVE_CMPXCHG_LOCAL >>> (all major ones), so there will not be any performance penalty for its >>> usage. >> >> Generally, places that call __mod_lruvec_state() also call >> __mod_zone_page_state(), and it also has the corresponding optimized >> version (mod_zone_page_state()). It seems necessary to clean that up >> as well, so that those disabling-IRQs that are only used for updating >> vmstat can be removed. > > I agree, please take a stab at that. OK, will do.