Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp1386704lqo; Sat, 18 May 2024 00:33:19 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX7qbof3mdjXmXqqpHerLO1FG1+d9oiVxqb6Lkl9LVfk/cj5wjLeXTJwIZchviT5UU/oifUoIpJzNahH4CbfcARx0UkymcZbX15lNl4zA== X-Google-Smtp-Source: AGHT+IHotFE2ICA9TeElBWcSAzaBFV2PXKmSBKAoLHPktfIdxbj0rNF+1OjIC6sKulaR7WuEMYS8 X-Received: by 2002:a05:6808:2a89:b0:3c9:933a:152 with SMTP id 5614622812f47-3c99707a035mr24432321b6e.35.1716017599650; Sat, 18 May 2024 00:33:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716017599; cv=pass; d=google.com; s=arc-20160816; b=KaCmzgcmL3lfoWtUoYM3DXdmxLnf/1rIx6ZjbUrWmI7EN+ac7lbLDqgeFT6FUWKMA0 ZTRGogy+1TekCXQH8k3F/FoqvYbKHIfemgVlOL518aAzNA0MfT+bY/mRgCnciQ1aTy6p +hS0xzw93eA+qSCNiNLM7xTDMGpoS1f8jNAx+7u2nn5d1LnJy7YJz10zeScB0Z4jg+gL 0j7ron/q3rjwue6Fc7SDMIlBTscXdocjex7BKpYEB4MxUpdZAWjZfu0XnEwXmdqUnJvx YdrPuVD9Vwd3pi0MAoVbjgaTjatrIV/uIKjWVpgA3IWKnntEP7LNm+nPYeQrGtAMS7Ue E2Uw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=qqPyvdWYTMHcHihrv+EK/h7p68sko7PuO9n/H1g00I0=; fh=hWbOPqbJL1ShPuqmxN1zGdutJiFsoj65iypqUNRJ7Jo=; b=E5Rdj4TWC8ReutVlUR6TBY9AAJWfCpS+PWfBGxvPoXDyZ1zWhNMuKaLqAfm6Oo+0qi nIyLDCH+GgNt4+cofxN3ZWiWM7wlFTiKf26TGVN2r/fz57cZrJN5NcE7QqNR+drDTaLr UggMlPhTb6qEmuRIssOtR352ce0SwSdc2NIt/11q0Vzz+Tm8Y96Q+t/nC7S9qS2QlbBl NtcCo8rTA5y2xh/q/SMdJ9ipIkqdWmAAffMVBnDQUpTQ6C25Q0rEXWb5ulYCqWYAIpoi bwrlpi0QkAY7vuAYiKRSHS+V7Sq2D2kRwj2LNh3q9UmVigbiQQCbKHzDC1DwPBwbT8Zv oYbQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=ulqVIej+; 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-182790-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-182790-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. [147.75.48.161]) by mx.google.com with ESMTPS id 41be03b00d2f7-65927ddb6d7si210292a12.463.2024.05.18.00.33.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 May 2024 00:33:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-182790-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=ulqVIej+; 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-182790-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-182790-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 0137FB21898 for ; Sat, 18 May 2024 07:33:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A3A04DDC1; Sat, 18 May 2024 07:33:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="ulqVIej+" 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 88B97D51C for ; Sat, 18 May 2024 07:33:02 +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=1716017587; cv=none; b=alzkp0VRjPakBwzXvqQfU3Jk3jo0bqMMMcyT6tgcF3AlPFiL1g1j7oHJX1nymeFVg6eotRP2ZEe+G4i6bj7ZV6PQvco9XIkdo56I6uWcZS6rGa5iWccNJleN2uW0AjynyXo05y/bFNalD9IQ3XIsStATZQmGuW9eBuDC+PUW+Yk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716017587; c=relaxed/simple; bh=2bvL15eNALwn6baM/WUVHgL0dyYkw1ubeeQnda7LtZk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=pn/pIq9dpEnZZjbtlPC1IqCvFGBXV2pLNsPVk4FPFnreWLuMEdpPa0kM2QJDRoaZTBYoU8aJsTjqb86odMBcxPuNHgQJZOxw6IbONhFflmf719cF97cGycXg2x5+NWWesa4jPsFROO0TPie2Q+wGRiBcLhKUaaC6MfruJhFoayQ= 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=ulqVIej+; 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 X-Envelope-To: laoar.shao@gmail.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1716017579; 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=qqPyvdWYTMHcHihrv+EK/h7p68sko7PuO9n/H1g00I0=; b=ulqVIej+JwhAAQkqV7OUeeEqnGOoh4rkXTdANOPQOyyoA+fW23umXjRuhWZ81N2O1RAarh i/7tc2pyx+R/X4runtP5kLsQhBj4+3JeXMJbGK3G3d3MWT8z15HheiFp2DcV1fIWLbRyWX UNRHz7L2KtPtUEd7abcQ7zVAk4XQ8wg= X-Envelope-To: yosryahmed@google.com X-Envelope-To: roman.gushchin@linux.dev X-Envelope-To: akpm@linux-foundation.org X-Envelope-To: muchun.song@linux.dev X-Envelope-To: hannes@cmpxchg.org X-Envelope-To: mhocko@kernel.org X-Envelope-To: willy@infradead.org X-Envelope-To: linux-mm@kvack.org X-Envelope-To: linux-kernel@vger.kernel.org X-Envelope-To: gthelen@google.com X-Envelope-To: rientjes@google.com X-Envelope-To: chrisl@kernel.org X-Envelope-To: ivan@cloudflare.com Date: Sat, 18 May 2024 00:32:53 -0700 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Shakeel Butt To: Yafang Shao Cc: Yosry Ahmed , Roman Gushchin , Andrew Morton , Muchun Song , Johannes Weiner , Michal Hocko , Matthew Wilcox , linux-mm@kvack.org, linux-kernel@vger.kernel.org, gthelen@google.com, rientjes@google.com, Chris Li , Ivan Babrou Subject: Re: [PATCH rfc 0/9] mm: memcg: separate legacy cgroup v1 code and put under config option Message-ID: References: <20240509034138.2207186-1-roman.gushchin@linux.dev> 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 Content-Transfer-Encoding: 8bit In-Reply-To: X-Migadu-Flow: FLOW_OUT On Thu, May 16, 2024 at 11:35:57AM +0800, Yafang Shao wrote: > On Thu, May 9, 2024 at 2:33 PM Shakeel Butt wrote: > > > [...] > Hi Shakeel, > > Hopefully I'm not too late. We are currently using memcg v1. > > One specific feature we rely on in v1 is skmem accounting. In v1, we > account for TCP memory usage without charging it to memcg v1, which is > useful for monitoring the TCP memory usage generated by tasks running > in a container. However, in memcg v2, monitoring TCP memory requires > charging it to the container, which can easily cause OOM issues. It > would be better if we could monitor skmem usage without charging it in > the memcg v2, allowing us to account for it without the risk of > triggering OOM conditions. > Hi Yafang, No worries. From what I understand, you are not really using skmem charging of v1 but just the network memory usage stats and you are worried that charging network memory to cgroup memory may cause OOMs. Is that correct? Have you tried charging network memory to cgroup memory before and saw OOMs? If yes then I would really like to see OOM reports. I have two examples where the v2's skmem charging is working fine in production namely Google and Meta. Google is still on v1 but for skmem charging, they have moved to v2 semantics. Actually I have another report from Cloudflare [0] where the tcp throttling mechanism for v2's tcp memory accounting is too much conservative for their production traffic. Anyways this just means that we need a more flexible way to provide and enforce semantics for tcp memory pressure with a decent default behavior. I will followup on this separately. [0] https://lore.kernel.org/lkml/CABWYdi0G7cyNFbndM-ELTDAR3x4Ngm0AehEp5aP0tfNkXUE+Uw@mail.gmail.com/ thanks, Shakeel