Message ID | 20200821150134.2581465-28-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 E826A14F6 for <patchwork-linux-mm@patchwork.kernel.org>; Fri, 21 Aug 2020 15:28:49 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id ABC76207DE for <patchwork-linux-mm@patchwork.kernel.org>; Fri, 21 Aug 2020 15:28:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=fb.com header.i=@fb.com header.b="DY2R5IkN" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org ABC76207DE 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 EA9868D005A; Fri, 21 Aug 2020 11:28:46 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id E57F08D0022; Fri, 21 Aug 2020 11:28:46 -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 D6E648D005A; Fri, 21 Aug 2020 11:28:46 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0095.hostedemail.com [216.40.44.95]) by kanga.kvack.org (Postfix) with ESMTP id BC3D88D0022 for <linux-mm@kvack.org>; Fri, 21 Aug 2020 11:28:46 -0400 (EDT) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 7F1B2181AC9C6 for <linux-mm@kvack.org>; Fri, 21 Aug 2020 15:28:46 +0000 (UTC) X-FDA: 77174958252.23.frogs69_4b083292703a Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin23.hostedemail.com (Postfix) with ESMTP id 48BBE37604 for <linux-mm@kvack.org>; Fri, 21 Aug 2020 15:28:46 +0000 (UTC) X-Spam-Summary: 1,0,0,,d41d8cd98f00b204,prvs=55027216e2=guro@fb.com,,RULES_HIT:30054:30064,0,RBL:67.231.153.30:@fb.com:.lbl8.mailshell.net-64.10.201.10 62.18.0.100;04y8kiw5qmm144kh955wopa5dee7zocupq7wryo67kbe7n9mh1jrq3ztr1uz95o.oy6u81d49ukmfqsb6nx6jwrsnj94nphh8qpfnm59wryhho59rxfi38f7fm9eh1s.r-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: frogs69_4b083292703a X-Filterd-Recvd-Size: 4256 Received: from mx0b-00082601.pphosted.com (mx0b-00082601.pphosted.com [67.231.153.30]) by imf16.hostedemail.com (Postfix) with ESMTP for <linux-mm@kvack.org>; Fri, 21 Aug 2020 15:28:45 +0000 (UTC) Received: from pps.filterd (m0109331.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 07LFAR10028399 for <linux-mm@kvack.org>; Fri, 21 Aug 2020 08:28:45 -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=AY+zEMrZEUFG7cPpW9Pa4Yz4Mskp5yNX44dJ1MGabe0=; b=DY2R5IkNuxqt+xHWB4d1vfNM7+5elhJ8hzBilp1mo6MGLV2EkFT4vSnLUlJus6jYt7Ys /0E+WFyO0s8wzV4kVXfi/NPkP67ftxWgXx8jyMHVwB2+ZPeWf1KFA0kvtjqTHpYN5kZG LqylAeae/qF1PNRGSZuCzxXpmbd5oI6ZSpY= Received: from mail.thefacebook.com ([163.114.132.120]) by mx0a-00082601.pphosted.com with ESMTP id 332gp8031f-5 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for <linux-mm@kvack.org>; Fri, 21 Aug 2020 08:28:45 -0700 Received: from intmgw003.06.prn3.facebook.com (2620:10d:c085:208::11) by mail.thefacebook.com (2620:10d:c085:11d::5) 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:28:42 -0700 Received: by devvm1096.prn0.facebook.com (Postfix, from userid 111017) id AF8E5344107D; 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 27/30] bpf: eliminate rlimit-based memory accounting for xskmap maps Date: Fri, 21 Aug 2020 08:01:31 -0700 Message-ID: <20200821150134.2581465-28-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 mlxlogscore=864 priorityscore=1501 mlxscore=0 phishscore=0 impostorscore=0 lowpriorityscore=0 malwarescore=0 suspectscore=13 spamscore=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: 48BBE37604 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/net/xdp/xskmap.c b/net/xdp/xskmap.c index e574b22defe5..0366013f13c6 100644 --- a/net/xdp/xskmap.c +++ b/net/xdp/xskmap.c @@ -74,7 +74,6 @@ static void xsk_map_sock_delete(struct xdp_sock *xs, static struct bpf_map *xsk_map_alloc(union bpf_attr *attr) { - struct bpf_map_memory mem; int err, numa_node; struct xsk_map *m; u64 size; @@ -90,18 +89,11 @@ static struct bpf_map *xsk_map_alloc(union bpf_attr *attr) numa_node = bpf_map_attr_numa_node(attr); size = struct_size(m, xsk_map, attr->max_entries); - err = bpf_map_charge_init(&mem, size); - if (err < 0) - return ERR_PTR(err); - m = bpf_map_area_alloc(size, numa_node); - if (!m) { - bpf_map_charge_finish(&mem); + if (!m) return ERR_PTR(-ENOMEM); - } bpf_map_init_from_attr(&m->map, attr); - bpf_map_charge_move(&m->map.memory, &mem); spin_lock_init(&m->lock); return &m->map;