Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2454496pxk; Mon, 14 Sep 2020 13:56:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyL7/SWlYf/32PWVGH305pAELBIRdbf1zIsCiATCX3h4ZkokJyvIcYJSdyo6tR4N9caRFf5 X-Received: by 2002:a05:6402:1d0f:: with SMTP id dg15mr19777571edb.342.1600116964973; Mon, 14 Sep 2020 13:56:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600116964; cv=none; d=google.com; s=arc-20160816; b=tiRt1pgteI8dlmJtzN+la75px3N3KExcNyC4BAgTbdKZJv/BrQLmkHNfRTh+68Ea1S ZFJ6bd9BX7Y00i8+Zd1Idw0Rn0nc5yRG6NNTO3Ruyt5ffZpZFxbEZWmFgPZeSWKuS1qh +idr9HgNTxQHOBYIlWIiwe2kYU1fozFxd4Ou6iRSKVADyZ/H/ZGak4aM+s5809CNvUZc MISkjWGqV8hRsS7/3B58kShFOxxcE80FRA7KN/iPh3CY6BFMy3paoGLDVxKsoLO0ORLX XhJnIV6WW3qZvFUDxme0aLCeHARv6jUGZpnk7bEVVAVrLg6Hk5qLHGb50F2U/a72jaJu aT9g== 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=yHgI+Sr9jwoe9TRfWW90cuxRyTn1tAIe+oD9RF6J39I=; b=xkTwUFd2uer5/8gF47q36Do3wQpfO0ezqzB6Fu8FQ7nlOyXK//bMuH2K7KhVquIKxg 4rTSMX0X4Eqwbn3wBAJZZ0X9rqcyM28R9IJCeGO3ayoSpYTNnkB+e2ELCWbKA1PXxN0v Kp94g92qGfn5vcIR4XFZJamxPMgxdcoeqwu4dc8OPqBs3mbZC0wyFKoMTm+Ex1WMJArP uP2WOWSZ62OXaAqjRQ+4+tNuG0exyNUbttFnprKm/JkCDslacxISMw9M7z8kK255OOfE +DZC/wB1UVzkgX/PMbTBNDNTGVxexFY44atYvAGVt+YSCoNnOeEkX5HyJqsFS5CcmTXx 4RfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=BiwqpdTY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r24si8340603edc.149.2020.09.14.13.55.42; Mon, 14 Sep 2020 13:56:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=BiwqpdTY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726195AbgINUwj (ORCPT + 99 others); Mon, 14 Sep 2020 16:52:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:52618 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726062AbgINUwi (ORCPT ); Mon, 14 Sep 2020 16:52:38 -0400 Received: from mail-lj1-f179.google.com (mail-lj1-f179.google.com [209.85.208.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 60BF4218AC; Mon, 14 Sep 2020 20:52:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600116757; bh=yHgI+Sr9jwoe9TRfWW90cuxRyTn1tAIe+oD9RF6J39I=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=BiwqpdTYQOBtWTC2wBZqEgxqKSuqHFfEX20AViyi4dkm/ognyC4pTDIR5V9HPZFNQ E6jQkxi15JO6Q+AdtrI1gS84y6312OMwYBRReQAC0EZmHQqtJmGqN1Ihkb4FAPY2TD 3eV87Pi7f//JQQHWareSEAHe67Bys8Tz8IBSJOi8= Received: by mail-lj1-f179.google.com with SMTP id u21so871808ljl.6; Mon, 14 Sep 2020 13:52:37 -0700 (PDT) X-Gm-Message-State: AOAM533J7+yZi7jAuOPxJbOvoaOLPUyMX7Cl1hXpTFayzYR6t8jC4GbL 0f185ZOSwAITv2YOk3PQC1gAcj6Zk/UaisvoN3Y= X-Received: by 2002:a2e:9c8d:: with SMTP id x13mr5290616lji.392.1600116755650; Mon, 14 Sep 2020 13:52:35 -0700 (PDT) MIME-Version: 1.0 References: <20200911143022.414783-1-nicolas.rybowski@tessares.net> <20200911143022.414783-2-nicolas.rybowski@tessares.net> In-Reply-To: <20200911143022.414783-2-nicolas.rybowski@tessares.net> From: Song Liu Date: Mon, 14 Sep 2020 13:52:24 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH bpf-next v2 2/5] mptcp: attach subflow socket to parent cgroup To: Nicolas Rybowski Cc: Mat Martineau , Matthieu Baerts , "David S. Miller" , Jakub Kicinski , Alexei Starovoitov , Daniel Borkmann , Martin KaFai Lau , Song Liu , Yonghong Song , Andrii Nakryiko , John Fastabend , KP Singh , Paolo Abeni , Networking , mptcp@lists.01.org, open list , bpf 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, Sep 11, 2020 at 9:43 AM Nicolas Rybowski wrote: > > It has been observed that the kernel sockets created for the subflows > (except the first one) are not in the same cgroup as their parents. > That's because the additional subflows are created by kernel workers. > > This is a problem with eBPF programs attached to the parent's > cgroup won't be executed for the children. But also with any other features > of CGroup linked to a sk. > > This patch fixes this behaviour. > > As the subflow sockets are created by the kernel, we can't use > 'mem_cgroup_sk_alloc' because of the current context being the one of the > kworker. This is why we have to do low level memcg manipulation, if > required. > > Suggested-by: Matthieu Baerts > Suggested-by: Paolo Abeni > Acked-by: Matthieu Baerts > Reviewed-by: Mat Martineau > Signed-off-by: Nicolas Rybowski Acked-by: Song Liu [...]