From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 00230C433F5 for ; Sun, 1 May 2022 13:44:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347558AbiEANr6 (ORCPT ); Sun, 1 May 2022 09:47:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47130 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234564AbiEANr4 (ORCPT ); Sun, 1 May 2022 09:47:56 -0400 Received: from mail-lj1-x232.google.com (mail-lj1-x232.google.com [IPv6:2a00:1450:4864:20::232]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8CD045B3D4 for ; Sun, 1 May 2022 06:44:29 -0700 (PDT) Received: by mail-lj1-x232.google.com with SMTP id 16so15656703lju.13 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=OVBNY38LrNYxcMYdRp5c/NUmggAIrwAivOlVGjcIN4SROF96XvpeGjBYuJtjcbAvrQ m4mDdDwnY2OYMDgNdqvEra/JKowpYzE1sjIMlGYHZjwYqcOrgmdt54DyDLq1LeDylis0 xGzPXsDalGiK3uSV+/w6LZGisKj/MMRAH0pPG+z3+pHL9k4Y3GvgZ0f/HtauDYr/MgDP 9gAssL92BpFI6ktcPbYEi5NNaBn88PgNtphm4ueF6pV1LTQduYSZCdadRzKxuZNk3hT6 7uU59vaw4jv91Zibn1C7aChI91yCX58yJg8TJd8k1YeQvDKljtEoD0RzPU9ITSNCKy4E PG9Q== X-Gm-Message-State: AOAM530as8N5aj3FQ5yeBVI4StN2B4eCsdLfktfP3fzcuogu3NejuuU8 EE7PkUMTCmaapX5Nje5NvjWUOQ== X-Google-Smtp-Source: ABdhPJwQnPuRQH4MgxkUAQ1R3/AsrnCFOu5iCQnh9aYdtBeHwFaZqbXF9rRtGGSdjAhsG0zRM4Ik8g== 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 Precedence: bulk List-ID: X-Mailing-List: netdev@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