Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp174215iob; Mon, 2 May 2022 16:17:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwkHkXqL5lYYOsq4DoIHWoNifcGnEad0kr6ZbNTfp2+RSP92qrrKGE6C2T7q7RI0MgcDmIZ X-Received: by 2002:a17:902:b189:b0:14d:6f87:7c25 with SMTP id s9-20020a170902b18900b0014d6f877c25mr14169123plr.31.1651533435089; Mon, 02 May 2022 16:17:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651533435; cv=none; d=google.com; s=arc-20160816; b=j2WDTEMdFErL3ttBPBVR+UEUhUkZvVCxqfwQHuVb6fQsHghDc9jcvQO5sdt7rWcWe9 w8QT7ggro5vDpauHxTvLU4PuVrGr5yMyt3TsWGJooRDtQfwJpcXI8lBq/EREz3Ufz199 UCV2meDit9A4w9dIL0kkG0Wk4raoGLNVWIfW8mYUZ89fqFbEjyu/9uPdiZuOnLmIakg8 ICyC6CrBzrD5bitIZVF9I16kkJ5fHEnyn5GGl/OzxfgEYtkcM4fspBpQEADvUb2cr3Fn CmqHv7lmIZ6OVrA4jfnXj7cwiZUP5JIM2umSnXUPrEntWMiE2xNGP4OcjotqxTA4YDaW 8+FA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:references:message-id:cc:date:in-reply-to :from:subject:mime-version:content-transfer-encoding:dkim-signature; bh=WKDIQf5YU17uxh4rrGWr9X3eU/7EjCb3dKHQ+RI13NM=; b=mid8Io59knHb0Z+hktiFfYOFmHur9HifK/kZdeoxllq0FQHFcpY7TQo8HdEqAf4VR9 Gu3ZCLD8eJyGWK4T7Yjn4M7g0dpwJtJGxnbh2dFAoc2izcwl+Eg24S4Mp6LROCrlzmCk iYH5rbc8fvY5QR0AgtV0JO6dPgc8BLba2iXSax6AbvJ24Mtf3VqeSHWLkouSZMimtmXf ivDvD1l4mMr84/Vd1HxVaDfJG5KEtr2T7Rq4OXxj49rJnknugXEwDtDGTmRWcKoiIvAA iGJYwTDE8QglLMpxlJVkKo2+FtxHGFbjthTg1lP90HxzO9Ei3wjlVetD4TPwBelKzJtb tYOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=ErAYkoy8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id o5-20020a056a0015c500b005061e548749si16461288pfu.364.2022.05.02.16.17.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 May 2022 16:17:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=ErAYkoy8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7F4252FFC7; Mon, 2 May 2022 16:17:03 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355018AbiEAVN2 (ORCPT + 99 others); Sun, 1 May 2022 17:13:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46450 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354953AbiEAVN0 (ORCPT ); Sun, 1 May 2022 17:13:26 -0400 Received: from out0.migadu.com (out0.migadu.com [IPv6:2001:41d0:2:267::]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 02D30FD34; Sun, 1 May 2022 14:09:59 -0700 (PDT) Content-Type: text/plain; charset=utf-8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1651439396; 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=WKDIQf5YU17uxh4rrGWr9X3eU/7EjCb3dKHQ+RI13NM=; b=ErAYkoy8SGeqig6yJdiYyw7Ot9Lryj1rEO8aAlGEhY/qHTXfpBSqY8LsRp7fqFiv6FkmER wff03KP5AxxltMOkRtZmEz9t9u7gmdBgFvOhjJ0ubJH80rA3q3H6f6bAfURXExHlsRS3vz CEA3rbbu0cJncAwfrI4SHmiUjFU5DQ0= Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [PATCH memcg v4] net: set proper memcg for net_init hooks allocations X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Roman Gushchin In-Reply-To: <78b556f9-e57b-325d-89ce-7a482ef4ea21@openvz.org> Date: Sun, 1 May 2022 14:09:49 -0700 Cc: Shakeel Butt , =?utf-8?Q?Michal_Koutn=C3=BD?= , Vlastimil Babka , kernel@openvz.org, Florian Westphal , LKML , Michal Hocko , Cgroups , netdev , "David S. Miller" , Jakub Kicinski , Paolo Abeni Message-Id: <092476D2-C2C4-496C-A92C-EC0B331990ED@linux.dev> References: <78b556f9-e57b-325d-89ce-7a482ef4ea21@openvz.org> To: Vasily Averin X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: linux.dev X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On May 1, 2022, at 6:44 AM, Vasily Averin wrote: >=20 > =EF=BB=BFOn 4/28/22 01:47, Shakeel Butt wrote: >>> On Wed, Apr 27, 2022 at 3:43 PM Vasily Averin wrote: >>>=20 >>> On 4/27/22 18:06, Shakeel Butt wrote: >>>> On Wed, Apr 27, 2022 at 5:22 AM Michal Koutn=C3=BD w= rote: >>>>>=20 >>>>> On Tue, Apr 26, 2022 at 10:23:32PM -0700, Shakeel Butt wrote: >>>>>> [...] >>>>>>>=20 >>>>>>> +static inline struct mem_cgroup *get_mem_cgroup_from_obj(void *p) >>>>>>> +{ >>>>>>> + struct mem_cgroup *memcg; >>>>>>> + >>>>>>=20 >>>>>> Do we need memcg_kmem_enabled() check here or maybe >>>>>> mem_cgroup_from_obj() should be doing memcg_kmem_enabled() instead of= >>>>>> mem_cgroup_disabled() as we can have "cgroup.memory=3Dnokmem" boot >>>>>> param. >>>=20 >>> Shakeel, unfortunately I'm not ready to answer this question right now. >>> I even did not noticed that memcg_kmem_enabled() and mem_cgroup_disabled= () >>> have a different nature. >>> If you have no objections I'm going to keep this place as is and investi= gate >>> this question later. >>>=20 >>=20 >> Patch is good as is. Just add the documentation to the functions in >> the next version and you can keep the ACKs. >=20 > I noticed that the kernel already has a function get_mem_cgroup_from_objcg= (), > the name of which is very similar to my new function get_mem_cgroup_from_o= bj(). > Maybe it's better to rename my function to get_mem_cgroup_from_ptr()? I don=E2=80=99t think it=E2=80=99s a problem: objcg is a widely used abbrevi= ation and in my opinion is different enough from obj. I=E2=80=99d keep it fo= r the consistency with the mem_cgroup_from_obj(). Thanks!=