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 X-Spam-Level: X-Spam-Status: No, score=-8.4 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 01FCAC3F68F for ; Fri, 14 Feb 2020 23:12:42 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B8C93217F4 for ; Fri, 14 Feb 2020 23:12:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="bcDSHQvv" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B8C93217F4 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 5529B6B0006; Fri, 14 Feb 2020 18:12:41 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 4DF8B6B0007; Fri, 14 Feb 2020 18:12:41 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3A4A76B0008; Fri, 14 Feb 2020 18:12:41 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0060.hostedemail.com [216.40.44.60]) by kanga.kvack.org (Postfix) with ESMTP id 1CD456B0006 for ; Fri, 14 Feb 2020 18:12:41 -0500 (EST) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id BE52F4DB5 for ; Fri, 14 Feb 2020 23:12:40 +0000 (UTC) X-FDA: 76490284080.07.cloth52_8bc22c440a816 X-HE-Tag: cloth52_8bc22c440a816 X-Filterd-Recvd-Size: 3722 Received: from mail-yb1-f194.google.com (mail-yb1-f194.google.com [209.85.219.194]) by imf22.hostedemail.com (Postfix) with ESMTP for ; Fri, 14 Feb 2020 23:12:40 +0000 (UTC) Received: by mail-yb1-f194.google.com with SMTP id w17so5622303ybm.1 for ; Fri, 14 Feb 2020 15:12:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=uatDFsIT20Tr7lDZflfez2EhiRhyLK/asm5Si1dIGu0=; b=bcDSHQvvV96yGTTBRaB8x59yqMJOXsrLkX+6lOtHFWjjtjj7KqevWTBgWaz/71B+nt gtS9q14yDtUdDOH39hmoZZW763p287iNzMsFru3GOmmYq2LdEXOM0aqi4ENgnMQ84ygt xwdNGRAZShNjNgD7GoS6tiTM96AanEO1yfwvXXAH4zVUES/ITWy18m+kROoI/RoWkb0w uNxeQC845/tLmKRHSNwkR196QibBSJSyrX+6ZtKqUzvsHAg7nR2Z7Z0oPrSjCqhsQWAq xIRpoWrtAfrDtxulQYPXvT8z5ND6nMHvA66yZe02wBC2VyD2zrBerpKVt7XOolE8e0Fl ccKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=uatDFsIT20Tr7lDZflfez2EhiRhyLK/asm5Si1dIGu0=; b=TVpLoDU7mipbvxYCtW0xMwKxMfbe2q9JUeDYuDAbaPk8SyroEAkLby2dRHniR4VR+R K19mvhKBUZDXF3ZuH4HZ1nbQ7rf6Mjfiy5rHoqWLqPULZXkhcytG4Svoyi84i4XwoLGh AHCuOeiEaTr0UnAxC7DudEp5hF5aLr4rx1O3gdhCj4dxFmZGwH/7CokmXSN6r8DcgfYq qeTLngbqq1sMW9jySXSsbomzs1zF61/U9bVStZttipBEbn6L7AAli3a5K6iSUzudluM6 Iz1Pf/8rkGmoytU+RQ00L3iOYSDT/DS32ZgH0okkEqubV4Wm6h4dS2BHI/HORVfGciWa plIA== X-Gm-Message-State: APjAAAVxyK43yqg90YL6lpjcnafl2n98yqtYFqyXP/B6wi1bgEIf1hMy lTcvT9wDLBnDfgMcxQkETwBdIgsZfw6o30Mf7C8w+w== X-Google-Smtp-Source: APXvYqxkNZYzOofzcj/O8oXklWpy/AuGc965qcSeMb2Eklii3RnwyzikN+gAWkqbXYq0KMhnOa0jTnOmd7sm5bDO9Bg= X-Received: by 2002:a25:640e:: with SMTP id y14mr5021685ybb.380.1581721959525; Fri, 14 Feb 2020 15:12:39 -0800 (PST) MIME-Version: 1.0 References: <20200214222415.181467-1-shakeelb@google.com> In-Reply-To: From: Eric Dumazet Date: Fri, 14 Feb 2020 15:12:28 -0800 Message-ID: Subject: Re: [PATCH v2] cgroup: memcg: net: do not associate sock with unrelated cgroup To: Shakeel Butt Cc: Johannes Weiner , Tejun Heo , Greg Thelen , Michal Hocko , Vladimir Davydov , Andrew Morton , Cgroups , linux-mm , Roman Gushchin , LKML Content-Type: text/plain; charset="UTF-8" X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Fri, Feb 14, 2020 at 2:48 PM Shakeel Butt wrote: > > I think in the current code if the association is skipped at > allocation time then the sock will remain unassociated for its > lifetime. > > Maybe we can add the association in the later stages but it seems like > it is not a simple task i.e. edbe69ef2c90f ("Revert "defer call to > mem_cgroup_sk_alloc()""). Half TCP sockets are passive, so this means that 50% of TCP sockets won't be charged. (the socket cloning always happens from BH context) I think this deserves a comment in the changelog or documentation, otherwise some people might think using memcg will make them safe.