Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp2273439ybv; Fri, 14 Feb 2020 15:13:28 -0800 (PST) X-Google-Smtp-Source: APXvYqz1OQaEKin/BSHtYhUhR1NfvVQcgs2rmqt49MTLPwXg7YvhP3hXSRrZRXnu+ktzXlQuXUF4 X-Received: by 2002:a9d:395:: with SMTP id f21mr4169338otf.67.1581722008577; Fri, 14 Feb 2020 15:13:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581722008; cv=none; d=google.com; s=arc-20160816; b=xxbbnef1F3xsq9JOp2epd5+0vzCNZbqIQ0XMfn48eVuq61CAanYWtKjfjpuVB4CHv4 0+ohaii5Dily8uxfEwnORPIwYl9TIeyyXKdX+vYqzTNHBz8rIxexHzF5taVTOMjp0aKk 27NDdyHP8rAOtqQQ93NBEZOXceMdlCqDR736TSgPHMg1ikHfGP0JwakndnXIlT+v7CQq twWdt95eq21C+8/PiNV9bOU5Ug+IFVDWSikhWjA+mMvTXad1qhY1kbn+cKk2tt8o2tED q0ZDO6GqcudIe7uG+PqGIweFiBPXNEhUZNcg2fiLZXkwSZwFBYehGyR142//rbKO18qv ft+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=uatDFsIT20Tr7lDZflfez2EhiRhyLK/asm5Si1dIGu0=; b=08ONDGotLG4uDJJ1mpnBhxBdwayImUwVUHMiVrVgFFPhlEXQqX9mkDxN3+LbF0JSgP lv3Q+kq/vwmLAm7XjvmXenVt0mqT4PD5WH6UwMmYWKkwNzU8FBvTQ8KnuF8K0rucFggu pE798zvmxwvyRMXcIMaUCHaTnh/5xrgDclZOlhRBXoEGScX2Jd4x7NcFZrdBej9Mnjy3 j/djOV1Ddi0oqfxx4skyeb2kAMsiKCzjvx2O+FhD0Khpw0CQ3LUTT83Xg8wM1JJQeUl3 9eaJ6vzSW8k9QRwPwHkEikALA1jVPgEFfZ+AdnhFvE2OQ/1G69sZIhA1GTD98qM3oaMZ dUAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=bcDSHQvv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t20si3467169otr.64.2020.02.14.15.13.15; Fri, 14 Feb 2020 15:13:28 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=bcDSHQvv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727787AbgBNXMl (ORCPT + 99 others); Fri, 14 Feb 2020 18:12:41 -0500 Received: from mail-yb1-f193.google.com ([209.85.219.193]:46239 "EHLO mail-yb1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725955AbgBNXMk (ORCPT ); Fri, 14 Feb 2020 18:12:40 -0500 Received: by mail-yb1-f193.google.com with SMTP id n131so2232300ybg.13 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=bjCEWPAqRUOX1cD6/k0q7FxU2Mm0qwLUwM1YlE/69qsY2yxqOzf3dVjhuq7b5kAeQ0 /K4x1kn6MytS8cYrCwa89T6tImrMuQ1RmZBYCMfEh1swZJw0WZA7rldD3oX0+1b6RsUW +Q9BnwRM8U+W7Bmye4dBdXcNttnHgmJnu/8SdYrDP4GYElAQJq3S4c7QmXS0PSpT/rm6 Ng3pUHZC4RQ5+ZH5ZfzcvaXN7PcrsYgfCEjM7W5k5Z9eCPNGxnLxVjR1eNEeLP4tJvjT 7XWSw9aIT1l6AiQFVzlC78jfLGCgo3M3dzyHkKdjtvGLlvoIfWJBENfKBbCM+1Btioib /TKg== X-Gm-Message-State: APjAAAXSWn6BxORJOCfPHBDUP6TRghDpfcGDthy9QGSzpvK7ueC+M2sb OuefRkAVJqo8toun7XxfFFz6zJJTGxQplN3Urv4Q9A== 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" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.