Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp7971508imm; Thu, 28 Jun 2018 12:18:00 -0700 (PDT) X-Google-Smtp-Source: ADUXVKL93yEdI9u41WKyrUxfUJPJn1u2plmwEI/oZo4+W41UUoXX8nCtojTg6T46zZVs5Ke51Uyl X-Received: by 2002:a17:902:5a83:: with SMTP id r3-v6mr11529435pli.78.1530213480074; Thu, 28 Jun 2018 12:18:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530213480; cv=none; d=google.com; s=arc-20160816; b=B/deCa1mVK5VbqE3l+dKzJsCnbV3xL50ZxzxNj/0+TCmmkLPJVgyrCAjOsrTQ+JYoL l5jlXPa3kzc75dRuogIR2DG8I51kjyIsuy9lyrHe+DkgvAyWKHZTPu5PNxRFtNVKPz23 9k1jVL4j1JYJQ+0+u9ZDP/nc0sPikK+kQH+N7DiX1yyLCdmlHIcuN7j7eGnTP5LdTk8F pFrqJ53csHc4DYKF5U/BeoLXaqE2cblOxli8TGl18AHGBxSQXJt7ixLFrqUPM8OHqH8K 5+rAfZokUhXYIii1ls5JszL0aDq1sYBIm9ZnaJ0Q/Gbuhh6/UE0EJq8HLI3N+Swf8p7j lmOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:message-id:date:subject:cc:to :from:dkim-signature:dkim-signature:arc-authentication-results; bh=49C5o5ozauIj9HRTdNUrEwudY2mFh9X56WT0lrsY9mg=; b=cvoNkIGxAhFVyvXHLX6CDcExXxrvz1xVSderCfamOKnX0oCh+pv/agWUUi942KBKbn pkVvhERFhbjGo5q5vbMHhMvYB5kqHl3EwgnsRl/wjxMBQacQVydVdHoqDcwAXt6Oxz8g bg0NFN0Mm25GWu7p6ZnhCaiyxDrskV9L4PvSxl8pc6QJ+8Pr8UIrfBtWB+FjfJ9ovoGc BB89oFmpeVTkTR83qbn7CknC1WHzxN7ImmXWsHwCTtT/sBZtyXkUixC9GDi1O6zcH0Ud BLmC0QpHNbM6i/QZObNJOtao/YlYcmgsgANTx+rJNPYW3sVu9hCCjBNlGHiyxzFRxYaw 9kkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=h9t+cGz+; dkim=pass header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=OCjl4HM2; 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 l18-v6si1857985pgi.249.2018.06.28.12.17.45; Thu, 28 Jun 2018 12:18:00 -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=h9t+cGz+; dkim=pass header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=OCjl4HM2; 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 S935831AbeF1Qsm (ORCPT + 99 others); Thu, 28 Jun 2018 12:48:42 -0400 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:49078 "EHLO mx0b-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752157AbeF1Qsi (ORCPT ); Thu, 28 Jun 2018 12:48:38 -0400 Received: from pps.filterd (m0109332.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w5SGhUmh028544; Thu, 28 Jun 2018 09:48:17 -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=49C5o5ozauIj9HRTdNUrEwudY2mFh9X56WT0lrsY9mg=; b=h9t+cGz+rhOT9669JBLqEdTunqX2Lf9uh3Jdv7SBCutgfyVO/Xm67WTvR1Hv3fHjApJh AMjH8WgluLMNXmdW3FiP1uXS1ZrLBTNwgeK/YST+mDN2cVhy2IXJ3ClW4jBDTByabz6H XMZzxk3xr+ckdBu9daJmYP503r32/WTRd3A= Received: from maileast.thefacebook.com ([199.201.65.23]) by mx0a-00082601.pphosted.com with ESMTP id 2jw36e842s-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 28 Jun 2018 09:48:17 -0700 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (192.168.183.28) by o365-in.thefacebook.com (192.168.177.21) with Microsoft SMTP Server (TLS) id 14.3.361.1; Thu, 28 Jun 2018 12:48:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.onmicrosoft.com; s=selector1-fb-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=49C5o5ozauIj9HRTdNUrEwudY2mFh9X56WT0lrsY9mg=; b=OCjl4HM2Hk6xxrFXyyWJimHKPN7cVzSpSPCvpNaVttd6N52UrLukndiGXPLmiNHo7aphYlfVMnBqBhDW0RFFg4lm7LElezG+rPjFIYVDMlvxjRAe5QMLupdsoEdSYZz7wz2WnYIyjUnN5q7+famXaC1yjc7sQ7mOe7iXjFIqSC4= Received: from castle.thefacebook.com (2620:10d:c090:200::4:4716) by DM3PR15MB1081.namprd15.prod.outlook.com (2603:10b6:0:12::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.884.24; Thu, 28 Jun 2018 16:47:54 +0000 From: Roman Gushchin To: CC: , , , Roman Gushchin , Alexei Starovoitov , Daniel Borkmann , Martin KaFai Lau Subject: [PATCH bpf-next 00/14] bpf: cgroup local storage Date: Thu, 28 Jun 2018 09:47:05 -0700 Message-ID: <20180628164719.28215-1-guro@fb.com> X-Mailer: git-send-email 2.14.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [2620:10d:c090:200::4:4716] X-ClientProxiedBy: MW2PR16CA0046.namprd16.prod.outlook.com (2603:10b6:907:1::23) To DM3PR15MB1081.namprd15.prod.outlook.com (2603:10b6:0:12::7) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9d9c582e-2328-411b-1404-08d5dd16e58f X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652034)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600026)(711020)(2017052603328)(7153060)(7193020);SRVR:DM3PR15MB1081; X-Microsoft-Exchange-Diagnostics: 1;DM3PR15MB1081;3:K5oPKIKzCfifJVO/e8Dw/gHdwUcnHJ3mUwTwon2jGXXEbtpYwH6bOhJfpE3gN3IOdYKn83xSK9CsRSG2BdCqpV15MmO36RSG2KAdAZzrX8+59JJ8ivHZ+bjZL+Kbnz+lhXGK26oelcDyKv+mi4vtPgoQVX7nuB4OcxSVf+NjUNVqP08zET24L29BZ7VIXSBzHnFNso7qX2FzYu3+yeG10faLmQv8wBRa0N8B5li4KRTnC6DMaJGY1AxMuPJvqAeJ;25:nEhmEICcwEOYNf4YM9ztuFSVnOgyXMBgAlYK6DGFLqyYQaTinIN4wjzwDOoyUmktjV55dZpZ9YPkFRMdV3q6ouI+vAGtU88qyTkokTL+nVnOEK8GEaRyw1+A3hiBu1o51xaIP5kbaAl/nXp40pADOHcig8CRX6sjsBLwZj+JCX/jVNQQjza6vtlhnLV3yOGR3Nv892OdkgjudytzFua8ES3T7KtDQt0C0aI3bnTnkha6bcsaUDkuxqh3NDd2o/4nH8honf4illJJtq40p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rl3GKkSBdN5egr2qc9OHR62F+LWqRRFOebO2qmwVmkLCjId3M2M7Q8r/8Btk3YU76Ok4ST6EV9XBktHK1bJdGpd1dUhXZvMOxD51QOzJ1SEqBaNzeh9FNoBeNBPhlBv5d7yvb0 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(67672495146484); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3002001)(10201501046)(93006095)(93001095)(3231254)(11241501184)(944501410)(52105095)(149027)(150027)(6041310)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123558120)(20161123562045)(6072148)(201708071742011)(7699016);SRVR:DM3PR15MB1081;BCL:0;PCL:0;RULEID:;SRVR:DM3PR15MB1081; X-Forefront-PRVS: 0717E25089 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(136003)(396003)(346002)(39860400002)(376002)(366004)(189003)(199004)(8676002)(6512007)(4326008)(81166006)(81156014)(69596002)(97736004)(52116002)(2361001)(51416003)(8936002)(305945005)(53416004)(186003)(16526019)(6506007)(386003)(106356001)(105586002)(2906002)(25786009)(36756003)(52396003)(7736002)(68736007)(50226002)(5660300001)(6666003)(53936002)(6916009)(48376002)(50466002)(478600001)(6486002)(1076002)(47776003)(6116002)(86362001)(5024004)(14444005)(16586007)(54906003)(46003)(476003)(486006)(2351001)(2616005)(316002)(42262002);DIR:OUT;SFP:1102;SCL:1;SRVR:DM3PR15MB1081;H:castle.thefacebook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; Received-SPF: None (protection.outlook.com: fb.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;DM3PR15MB1081;23:GQNuy18cvoSjcDDryFmS5E4OAbpEPyM3QBeijF1/M?= =?us-ascii?Q?x/MT0bqj6MfzgId0RR99TMmAUO40+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JAiGbcyCrcPQVpinSXPuK/E+bPtiosyfP7lRAnY9U6X35o5uWhoGmskvML00e/Sj4od5Y7CFcU0PBd4akQ/8YntQ6Pjk+rnqyJo9aerL62pr0RqoVqmaZ3nCpdZ/TGfrHxMwhCSNE0MVtsfbKIcvfBCDp+/olTaZxnpbI9euhK74ywE97eSMO1KpV7yaEMg==;5:KkuevtxtUz9Ry1aS17bdh5GMAUIMyrHVu48M6fCVhMvpvWmwL+vDraVPrElg1vYtYG/tEgMH3VzJfbF6cKFkEQJc/zp8g0MtpH45bSCs8iAKe+BiN6QH+njG3UmqiD0dqmfP41T5+xqul3rjH7RXyA3EjAtfp/as2asRz8UfLBQ=;24:KMhtb/1snGest9APPOmbdw9CY/+9jPameWSc2tRnmZll4MihEhv+6KfP8FGJwwU0MTDWJvlbotjKAiwZK1mY2MVEiLQxnx3NZUEDkAxHtyM= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;DM3PR15MB1081;7:R+lSrZyEFehsWnYGoJUQi7xPZ8ir5rMCbLGR5K3uF+L9NcVBM5pN/A8J/RKyNDY4RtcyH+c969XSD3gOSqspW5Owv8y5luC7py4fn34DQF+6XwWiNbQe/GC1ZwsxG1PyTeJFhtR6vrbD534EHNSzqzxJU2+UYzQmSNNoKrXYilGaoEiKgEgqczi/kMbF5zgl9ZUrrFoU37fp873vARGNtURdTeOhAEcTdLp/kNh2JbcmA/ZKfQ/t7h+OGbgXzF9O;20:aTRookr8vTd3Vl6TNUSVBL1UfuSjIMZgo3rAf/GehlBtzScpMVIPgTXPt9s7V//756H9VFgJonQ42vXeOTJ2uost0/fXlRUisqMhTxH6Yc7aIaTWDPd6QNFHNr76Tv9+3QK8rmGCdpfotK8HBWvvSvGNJJaFUi9wsRf5vj53tVA= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jun 2018 16:47:54.5046 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9d9c582e-2328-411b-1404-08d5dd16e58f X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM3PR15MB1081 X-OriginatorOrg: fb.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-06-28_08:,, signatures=0 X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patchset implements cgroup local storage for bpf programs. The main idea is to provide a fast accessible memory for storing various per-cgroup data, e.g. number of transmitted packets. Cgroup local storage looks as a special type of map for userspace, and is accessible using generic bpf maps API for reading and updating of the data. The (cgroup inode id, attachment type) pair is used as a map key. A user can't create new entries or destroy existing entries; it happens automatically when a user attaches/detaches a bpf program to a cgroup. From a bpf program's point of view, cgroup storage is accessible without lookup using the special get_local_storage() helper function. It takes a map fd as an argument. It always returns a valid pointer to the corresponding memory area. To implement such a lookup-free access a pointer to the cgroup storage is saved for an attachment of a bpf program to a cgroup, if required by the program. Before running the program, it's saved in a special global per-cpu variable, which is accessible from the get_local_storage() helper. This patchset implement only cgroup local storage, however the API is intentionally made extensible to support other local storage types further: e.g. thread local storage, socket local storage, etc. Patch (1) adds an ability to charge bpf maps for consuming memory dynamically. Patch (2) introduces cgroup storage maps. Patch (3) implements a mechanism to pass cgroup storage pointer to a bpf program. Patch (4) implements allocation/releasing of cgroup local storage on attaching/detaching of a bpf program to/from a cgroup. Patch (5) extends bpf_prog_array to store cgroup storage pointers. Patch (6) introduces BPF_PTR_TO_MAP_VALUE, required to skip non-necessary NULL-check in bpf programs. Patch (7) disables creation of maps of cgroup storage maps. Patch (8) introduces the get_local_storage() helper. Patch (9) syncs bpf.h to tools/. Patch (10) adds cgroup storage maps support to bpftool. Patch (11) adds support for testing programs which are using cgroup storage without actually attaching them to cgroups. Patches (12), (13) and (14) are adding necessary tests. Signed-off-by: Roman Gushchin Cc: Alexei Starovoitov Cc: Daniel Borkmann Cc: Martin KaFai Lau Roman Gushchin (14): bpf: add ability to charge bpf maps memory dynamically bpf: introduce cgroup storage maps bpf: pass a pointer to a cgroup storage using pcpu variable bpf: allocate cgroup storage entries on attaching bpf programs bpf: extend bpf_prog_array to store pointers to the cgroup storage bpf/verifier: introduce BPF_PTR_TO_MAP_VALUE bpf: don't allow create maps of cgroup local storages bpf: introduce the bpf_get_local_storage() helper function bpf: sync bpf.h to tools/ bpftool: add support for CGROUP_STORAGE maps bpf/test_run: support cgroup local storage selftests/bpf: add verifier cgroup storage tests selftests/bpf: add a cgroup storage test samples/bpf: extend test_cgrp2_attach2 test to use cgroup storage include/linux/bpf-cgroup.h | 53 ++++ include/linux/bpf.h | 25 +- include/linux/bpf_types.h | 3 + include/uapi/linux/bpf.h | 19 +- kernel/bpf/Makefile | 1 + kernel/bpf/cgroup.c | 54 +++- kernel/bpf/core.c | 76 ++--- kernel/bpf/helpers.c | 20 ++ kernel/bpf/local_storage.c | 369 ++++++++++++++++++++++ kernel/bpf/map_in_map.c | 3 +- kernel/bpf/syscall.c | 53 +++- kernel/bpf/verifier.c | 38 ++- net/bpf/test_run.c | 13 +- net/core/filter.c | 23 +- samples/bpf/test_cgrp2_attach2.c | 27 +- tools/bpf/bpftool/map.c | 1 + tools/include/uapi/linux/bpf.h | 9 +- tools/testing/selftests/bpf/Makefile | 4 +- tools/testing/selftests/bpf/bpf_helpers.h | 2 + tools/testing/selftests/bpf/test_cgroup_storage.c | 130 ++++++++ tools/testing/selftests/bpf/test_verifier.c | 123 +++++++- 21 files changed, 965 insertions(+), 81 deletions(-) create mode 100644 kernel/bpf/local_storage.c create mode 100644 tools/testing/selftests/bpf/test_cgroup_storage.c -- 2.14.4