Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp950223ybm; Wed, 22 May 2019 14:31:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqyzOD6hhEPmYkBr3kSDePVwBJFa7cooP9eMlmFgijmllz9BuzPdApq5V9ZZDDvG42PFjl6g X-Received: by 2002:a17:902:b495:: with SMTP id y21mr27962500plr.243.1558560677549; Wed, 22 May 2019 14:31:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558560677; cv=none; d=google.com; s=arc-20160816; b=uzkJFVnWx6sEDBlLH5HGN3nbm4de2UFaqXMVlOVOYiJsShGlEOwe91eqsW0IvfL8Tc 3V0Yj7IOvhA79sFktNQ3a1t+H7/iWu0s10k/v7ejkej1Iqk477r9ZeNTX83SWuy3P6Zx XUnPvG3K7HEMIxqGVZeLuLHs2ZsjxEFQfxD1uhjL9ucbwSpoEg4xW4OfQBXXNyRW8ZRp PQU0QRL405oYSUfYlHvulnk+cCtbS7G9XDYvfwtqlqiOFHLLzYrAnhMfQc+DYN0adbhU b1cXKYHdQiaaA2P4iOrsUYS0BMkCSQ1lcVcJNrQMcd4tk8CJ5N0g65O9n4xxT9aPaf1d W/Gg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject :smtp-origin-cluster:cc:to:smtp-origin-hostname:from :smtp-origin-hostprefix:dkim-signature; bh=THkyaL46U42CuIQO/bUMHkqiVtg4R96gtH4e/2sSFSE=; b=mMk2hWtNV33sJm9LDnofZGMzN5lyOXLqHIsQf168IFfz6bw8fw8/QotiTYUzZkLIkG mkHlWK/sfSO8tQsBW0kMVKNzcS2lal1ZQ+A2mSZ/XqMI9SdXzEgwqnAuPZD3GtoQ8fVf bSOifDQN/IC3G6K8YxpOkNM7HUd+yIUTAfd9ZFaz0HS+pcfHg7VAY3Ss+f/DYA3jya0B i/2wYle2prGPogrX4CwChbUEpwponY5k8aaaAJQjbJ/7KuxAfhhpPjv0F/jh+cW5UYvT bFYlSKxHBcSvT7hxJlAoXGXcoK2HViMFDhE/yUd9zCQGqX9V/hpQOgUODhrWogAhQA8O 0EjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=qKxa6dRD; 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=NONE sp=NONE dis=NONE) header.from=fb.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f11si15534398pgs.335.2019.05.22.14.31.01; Wed, 22 May 2019 14:31:17 -0700 (PDT) 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=@fb.com header.s=facebook header.b=qKxa6dRD; 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=NONE sp=NONE dis=NONE) header.from=fb.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730466AbfEVV3u (ORCPT + 99 others); Wed, 22 May 2019 17:29:50 -0400 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:58230 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730424AbfEVV3s (ORCPT ); Wed, 22 May 2019 17:29:48 -0400 Received: from pps.filterd (m0044010.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x4MLLIJl026005 for ; Wed, 22 May 2019 14:29:47 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=from : to : cc : subject : date : message-id : mime-version : content-type; s=facebook; bh=THkyaL46U42CuIQO/bUMHkqiVtg4R96gtH4e/2sSFSE=; b=qKxa6dRDmhGboAf4t93kFw+cSCWjYrMDcCbxKQLXCH1zPD+OGhpMqESwgP3mNyUytAMu YR7TwU4WPFDXFEdLDT7MDYoZzwWf4VDTdbvxsg00Rq1epl12obXjfcTEd7liodvtUVOa 9DvfQiWl6t5I0JjH7Ssid/iPvtC8DIyobEI= Received: from maileast.thefacebook.com ([163.114.130.16]) by mx0a-00082601.pphosted.com with ESMTP id 2sn7jusrtq-11 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Wed, 22 May 2019 14:29:46 -0700 Received: from mx-out.facebook.com (2620:10d:c0a8:1b::d) by mail.thefacebook.com (2620:10d:c0a8:83::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Wed, 22 May 2019 14:29:41 -0700 Received: by devvm2643.prn2.facebook.com (Postfix, from userid 111017) id 569AF1251A294; Wed, 22 May 2019 14:29:39 -0700 (PDT) Smtp-Origin-Hostprefix: devvm From: Roman Gushchin Smtp-Origin-Hostname: devvm2643.prn2.facebook.com To: CC: Alexei Starovoitov , Daniel Borkmann , , Tejun Heo , , , , Roman Gushchin Smtp-Origin-Cluster: prn2c23 Subject: [PATCH bpf-next 0/4] cgroup bpf auto-detachment Date: Wed, 22 May 2019 14:29:28 -0700 Message-ID: <20190522212932.2646247-1-guro@fb.com> X-Mailer: git-send-email 2.17.1 X-FB-Internal: Safe MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-05-22_13:,, signatures=0 X-Proofpoint-Spam-Details: rule=fb_default_notspam policy=fb_default score=0 priorityscore=1501 malwarescore=0 suspectscore=13 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=390 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1905220148 X-FB-Internal: deliver Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patchset implements a cgroup bpf auto-detachment functionality: bpf programs are attached as soon as possible after removal of the cgroup, without waiting for the release of all associated resources. Patches 2 and 3 are required to implement a corresponding kselftest in patch 4. Roman Gushchin (4): bpf: decouple the lifetime of cgroup_bpf from cgroup itself selftests/bpf: convert test_cgrp2_attach2 example into kselftest selftests/bpf: enable all available cgroup v2 controllers selftests/bpf: add auto-detach test include/linux/bpf-cgroup.h | 8 +- include/linux/cgroup.h | 18 ++ kernel/bpf/cgroup.c | 25 ++- kernel/cgroup/cgroup.c | 11 +- samples/bpf/Makefile | 2 - tools/testing/selftests/bpf/Makefile | 4 +- tools/testing/selftests/bpf/cgroup_helpers.c | 58 +++++++ .../selftests/bpf/test_cgroup_attach.c | 154 ++++++++++++++++-- 8 files changed, 253 insertions(+), 27 deletions(-) rename samples/bpf/test_cgrp2_attach2.c => tools/testing/selftests/bpf/test_cgroup_attach.c (78%) -- 2.20.1