Message ID | 20200821150134.2581465-23-guro@fb.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <SRS0=VkKC=B7=kvack.org=owner-linux-mm@kernel.org> Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D034B722 for <patchwork-linux-mm@patchwork.kernel.org>; Fri, 21 Aug 2020 15:18:01 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 9394B207BB for <patchwork-linux-mm@patchwork.kernel.org>; Fri, 21 Aug 2020 15:18:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=fb.com header.i=@fb.com header.b="bkc8WAgj" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9394B207BB Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=fb.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 362E48D0053; Fri, 21 Aug 2020 11:17:57 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 314B18D0022; Fri, 21 Aug 2020 11:17:57 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1B3058D0053; Fri, 21 Aug 2020 11:17:57 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0228.hostedemail.com [216.40.44.228]) by kanga.kvack.org (Postfix) with ESMTP id 029DB8D0022 for <linux-mm@kvack.org>; Fri, 21 Aug 2020 11:17:56 -0400 (EDT) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id C0701181AEF1A for <linux-mm@kvack.org>; Fri, 21 Aug 2020 15:17:56 +0000 (UTC) X-FDA: 77174930952.11.coach90_3e00fd62703a Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin11.hostedemail.com (Postfix) with ESMTP id 8F507180F8B81 for <linux-mm@kvack.org>; Fri, 21 Aug 2020 15:17:56 +0000 (UTC) X-Spam-Summary: 1,0,0,,d41d8cd98f00b204,prvs=55027216e2=guro@fb.com,,RULES_HIT:30054:30064:30079,0,RBL:67.231.153.30:@fb.com:.lbl8.mailshell.net-62.18.0.100 64.10.201.10;04yr8kk4m4n6wr68snufmr9mwa9i9ycdzcoggbj785snp5ayzpw6t1pr5tkwr9d.a5133hyqmmdjj9prmi7jmtdgybn93wenawf57qb4nz96pornfwf9rc3whj6cctd.e-lbl8.mailshell.net-223.238.255.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:24,LUA_SUMMARY:none X-HE-Tag: coach90_3e00fd62703a X-Filterd-Recvd-Size: 4593 Received: from mx0b-00082601.pphosted.com (mx0b-00082601.pphosted.com [67.231.153.30]) by imf22.hostedemail.com (Postfix) with ESMTP for <linux-mm@kvack.org>; Fri, 21 Aug 2020 15:17:55 +0000 (UTC) Received: from pps.filterd (m0109332.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 07LFATTS023038 for <linux-mm@kvack.org>; Fri, 21 Aug 2020 08:17:55 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=facebook; bh=LNqDcun6xOIbIYkt7APuKm2n1cxQU9Xgs1+YBzvY3CU=; b=bkc8WAgjswd6/P9ezFXqKebSYv3F5r46qS7qWlyI1IgLW+ckvGB4ve6nWBhkW/QFtqqF PTwnwq/m945BNsQagr6yoBdbqfEgRpF7hCiqENUnt/BMJXYOaR+SFxyYotsBNFUZ7Hz6 jfvyMG6s8Z/IhhDJbYMb07WbzIHl6fE0hb0= Received: from mail.thefacebook.com ([163.114.132.120]) by mx0a-00082601.pphosted.com with ESMTP id 332ehfrrfd-7 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for <linux-mm@kvack.org>; Fri, 21 Aug 2020 08:17:55 -0700 Received: from intmgw002.41.prn1.facebook.com (2620:10d:c085:208::11) by mail.thefacebook.com (2620:10d:c085:21d::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Fri, 21 Aug 2020 08:17:52 -0700 Received: by devvm1096.prn0.facebook.com (Postfix, from userid 111017) id 970993441073; Fri, 21 Aug 2020 08:01:35 -0700 (PDT) Smtp-Origin-Hostprefix: devvm From: Roman Gushchin <guro@fb.com> Smtp-Origin-Hostname: devvm1096.prn0.facebook.com To: <bpf@vger.kernel.org> CC: <netdev@vger.kernel.org>, Alexei Starovoitov <ast@kernel.org>, Daniel Borkmann <daniel@iogearbox.net>, <kernel-team@fb.com>, <linux-kernel@vger.kernel.org>, Johannes Weiner <hannes@cmpxchg.org>, Shakeel Butt <shakeelb@google.com>, <linux-mm@kvack.org>, Roman Gushchin <guro@fb.com>, Song Liu <songliubraving@fb.com> Smtp-Origin-Cluster: prn0c01 Subject: [PATCH bpf-next v4 22/30] bpf: eliminate rlimit-based memory accounting for reuseport_array maps Date: Fri, 21 Aug 2020 08:01:26 -0700 Message-ID: <20200821150134.2581465-23-guro@fb.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200821150134.2581465-1-guro@fb.com> References: <20200821150134.2581465-1-guro@fb.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-FB-Internal: Safe Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235,18.0.687 definitions=2020-08-21_08:2020-08-21,2020-08-21 signatures=0 X-Proofpoint-Spam-Details: rule=fb_default_notspam policy=fb_default score=0 lowpriorityscore=0 priorityscore=1501 spamscore=0 mlxscore=0 suspectscore=38 mlxlogscore=762 phishscore=0 malwarescore=0 impostorscore=0 clxscore=1015 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2008210143 X-FB-Internal: deliver X-Rspamd-Queue-Id: 8F507180F8B81 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam05 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: <linux-mm.kvack.org> |
Series |
bpf: switch to memcg-based memory accounting
|
expand
|
diff --git a/kernel/bpf/reuseport_array.c b/kernel/bpf/reuseport_array.c index 90b29c5b1da7..9d0161fdfec7 100644 --- a/kernel/bpf/reuseport_array.c +++ b/kernel/bpf/reuseport_array.c @@ -150,9 +150,8 @@ static void reuseport_array_free(struct bpf_map *map) static struct bpf_map *reuseport_array_alloc(union bpf_attr *attr) { - int err, numa_node = bpf_map_attr_numa_node(attr); + int numa_node = bpf_map_attr_numa_node(attr); struct reuseport_array *array; - struct bpf_map_memory mem; u64 array_size; if (!bpf_capable()) @@ -161,20 +160,13 @@ static struct bpf_map *reuseport_array_alloc(union bpf_attr *attr) array_size = sizeof(*array); array_size += (u64)attr->max_entries * sizeof(struct sock *); - err = bpf_map_charge_init(&mem, array_size); - if (err) - return ERR_PTR(err); - /* allocate all map elements and zero-initialize them */ array = bpf_map_area_alloc(array_size, numa_node); - if (!array) { - bpf_map_charge_finish(&mem); + if (!array) return ERR_PTR(-ENOMEM); - } /* copy mandatory map attributes */ bpf_map_init_from_attr(&array->map, attr); - bpf_map_charge_move(&array->map.memory, &mem); return &array->map; }