Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp213975iob; Mon, 2 May 2022 17:25:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJykwxMbRi9UV8s2J6pvylnWws3CExZmMdVYJUiwAYtq9kD7hKgzcfVParh2IAj2AgxYC8MQ X-Received: by 2002:a17:903:1206:b0:151:7d67:2924 with SMTP id l6-20020a170903120600b001517d672924mr14177162plh.45.1651537524816; Mon, 02 May 2022 17:25:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651537524; cv=none; d=google.com; s=arc-20160816; b=FJ8BrLyPaiXOMdwecbC2HEcxjeXXj60c2H3OVpmG1IAcZMxU0k9W6UVeqg/VJhEMuH gv4JdgvyLn0JJ1WKJoDjZJmbO+TevDIjzxezcfsU28LGvK4WJiUKMNjQzlqnXzUH0IuZ Ff0QS+Y0JPZMgpbRlMnvUacSAeMSq+mrZS0uvxFW7YNaYbUFyZNdQgRqpCYcAlgn4fpU h4xpo/NFaCUJqA8srkuzTh9VsaWS5BF6zWaVBFYv0You2JxuLgiC18+fwVS7bI+Vsg+l Q5XR/jqHnn3Hoxf8v4Mz7tWie7MpoaX0GvbboEukVSzOuQBsQd4/fPSRAXRLifERBtRZ tN1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=BV3tGIJv7cFXsfQYEsVnmGBSG8UYA5OrP4bIavH19vc=; b=HKpV01HVpjWC+3BcjdpocZGr6ocDawoAhS34xjZ6whFfsChgnh/Yii59iGMxql1Vss Nff0ZKtBQJulkd+Ze5cPoRdJLW5YZHxjikIkM8KH1zG5/8xRIol8T8Wm3cQnAmn/o2Fd 1YxRBiW5vxXcjL6awPOgGOIWLy3EtWTiJL3LP99hnuQbhv41LzGguyXKcYhAV5LosIfv tHTONu1kTleaImU1GQLlKqSVGLsCcCD1O4GZ/XwmttJO+Yu6cAWyf84LC8bscYme3nY0 iz9AK2y3yE5ioPUkQ0/75lqu8SKb2Hk0xeuge/XBhoWRLOnFJLumDsavntPzJX1hkE3u xhlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@openvz-org.20210112.gappssmtp.com header.s=20210112 header.b=5C9vsM9J; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=openvz.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id u17-20020a631411000000b00398a0c7fdfbsi15281574pgl.790.2022.05.02.17.25.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 May 2022 17:25:24 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@openvz-org.20210112.gappssmtp.com header.s=20210112 header.b=5C9vsM9J; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=openvz.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id AFA563A1A7; Mon, 2 May 2022 17:20:50 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347553AbiEANr6 (ORCPT + 99 others); Sun, 1 May 2022 09:47:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47126 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346783AbiEANrz (ORCPT ); Sun, 1 May 2022 09:47:55 -0400 Received: from mail-lj1-x22a.google.com (mail-lj1-x22a.google.com [IPv6:2a00:1450:4864:20::22a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9DDB35DA53 for ; Sun, 1 May 2022 06:44:29 -0700 (PDT) Received: by mail-lj1-x22a.google.com with SMTP id c15so15675612ljr.9 for ; Sun, 01 May 2022 06:44:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvz-org.20210112.gappssmtp.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=BV3tGIJv7cFXsfQYEsVnmGBSG8UYA5OrP4bIavH19vc=; b=5C9vsM9JO0foLVFVwJQY+KCxjm5dt4gLiPBDX6BnoNNpHVRiQkEzJIa/51wfrSRbQy zImlHIe4w97QCzLHQnZHKqs80dxh3Fr7WRTQif3OsfAwLgxMGjL2+TfT4ZFhJd/8WXCY mZYhAi9H4JF9aWNw9AkV1WsPThXQjbqr0xP1x7K42o5UGAFFrObxDVBAu+er2DHAVZYJ cSemtxMIU52D3NZiVwjNzkmb+yMqiWRGUzNLj6QMK57z5Q0pwk8JG6Oou0H+jo7PraJH ql1XCa+FKj7YhCfHy5WoKK8blBlojg4hJ4CN6JXmYcrE5g5Soaelo6wlUm7Ux+9CaR8D pV9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=BV3tGIJv7cFXsfQYEsVnmGBSG8UYA5OrP4bIavH19vc=; b=Eb5wwVbIGxWD8mqnCe0qirjtQPI/9TXTLgKqjmxCgt2xBQBL+DeiotiGXRii0MhV/X MnGvk9cfGoUNBw4JP2C3kWzOlhT4jvL12vlAP+xssxpWrOxd/otYDUtcuLXaNhhZIwZx f7o70XaRRJb+1NIkwLDTRgstXYsBPYHj3Y6pJVPGdLC8q20wjP3TNpUbPPwTxA7cMjlm +BHcNJA1UyV/BxAyCvauFBmynLXKMWaazVQyVyn2bvR07MHWWK0YJo2PCPuNcolE5c1L wmplD915OTQrTLn/eMXAjKZE0ZK3PybXpu6bpaUQj2z82q6i1k0Ll8Vzf12Ozp9J5eVK Nezw== X-Gm-Message-State: AOAM532/oXmX/18q+fJhkoagfCAZmRtdWcnAQOcQkWr4WIo86r8mAQ3Q Gt+J7gvCjFUj3LX2jD44hV/RJQ== X-Received: by 2002:a2e:8245:0:b0:24b:48b1:a1ab with SMTP id j5-20020a2e8245000000b0024b48b1a1abmr5456361ljh.152.1651412667957; Sun, 01 May 2022 06:44:27 -0700 (PDT) Received: from [192.168.1.65] ([46.188.121.177]) by smtp.gmail.com with ESMTPSA id z26-20020ac25dfa000000b0047255d211e2sm446882lfq.273.2022.05.01.06.44.26 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 01 May 2022 06:44:27 -0700 (PDT) Message-ID: <78b556f9-e57b-325d-89ce-7a482ef4ea21@openvz.org> Date: Sun, 1 May 2022 16:44:26 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH memcg v4] net: set proper memcg for net_init hooks allocations Content-Language: en-US To: Shakeel Butt , Roman Gushchin Cc: =?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 References: <33085523-a8b9-1bf6-2726-f456f59015ef@openvz.org> <20220427122232.GA9823@blackbody.suse.cz> <6b18f82d-1950-b38e-f3f5-94f6c23f0edb@openvz.org> From: Vasily Averin In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 4/28/22 01:47, Shakeel Butt wrote: > On Wed, Apr 27, 2022 at 3:43 PM Vasily Averin wrote: >> >> On 4/27/22 18:06, Shakeel Butt wrote: >>> On Wed, Apr 27, 2022 at 5:22 AM Michal Koutný wrote: >>>> >>>> On Tue, Apr 26, 2022 at 10:23:32PM -0700, Shakeel Butt wrote: >>>>> [...] >>>>>> >>>>>> +static inline struct mem_cgroup *get_mem_cgroup_from_obj(void *p) >>>>>> +{ >>>>>> + struct mem_cgroup *memcg; >>>>>> + >>>>> >>>>> 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=nokmem" boot >>>>> param. >> >> 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 investigate >> this question later. >> > > Patch is good as is. Just add the documentation to the functions in > the next version and you can keep the ACKs. 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_obj(). Maybe it's better to rename my function to get_mem_cgroup_from_ptr()? Thank you, Vasily Averin