Received: by 2002:a17:90b:8d0:0:0:0:0 with SMTP id ds16csp5082395pjb; Mon, 27 Jul 2020 12:28:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz5xH8TYpWiwnixyrOQ10+jd/kJKSTdw/ybSSa5K6WO7ZVKFvyzRGiPPAm9vAY4xwNC4EW5 X-Received: by 2002:a17:907:94c3:: with SMTP id dn3mr14994017ejc.226.1595878133934; Mon, 27 Jul 2020 12:28:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595878133; cv=none; d=google.com; s=arc-20160816; b=xG+KVT56caVJ5y6AG3yo8l+VIesPKAV6R8cHrEBVyvdd3YjD28rtefqu3lSNMsec0G Cb4Ohzi1tZbqRUNQz69222CGC6UOzotf8TuR1iD9Rdy9UFCE8oSCFRkIZXSx2vdCKToS BYvAh2q1UDDUk3byx1gujDiVnQAPopolf3Tc0sfO0Acy1t+AegjCVg/KTw8OTuZ/FXhb 9jDnuI4A0GBSwI15HPr17m4MaFsMOatWXGuYLbrVaGHA2Wcglo9q0k4fg9q5kkW9oUWz XsfYnRAiv6x/Eo3K1NkO/VlPV1CueeNk/izJ/OSHl65iFAYSDspLyBmwh39XaHRzw26y vVyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:smtp-origin-cluster :cc:to:smtp-origin-hostname:from:smtp-origin-hostprefix :dkim-signature; bh=spKGLxK3o4M7edg5m180h3ipHDO4sW7AlZIYk+WTamM=; b=h+OjjBX/FU0jIACww9R0yBU3NKODnZEecJfZAxp5NYaTNRYdgYZOLLyVlWCU8RxfEw Ayyg3mLKLprf6ntGNUPSN74jJ4qvpLiLmW+jVbRPEMjhrPuehSeQIQMvUv3bEGro4/Tf a+h3zkCLPQGUCWwuHId+bT7/3loWTyOeGKk6/A6Y86sTr4M2CQHh5XGSRGCwrqtc0RjW 1xtZzsZ2pOkFeTsj43F9V0O0FTG/onBxIsB2qiiTr2lmBMyV2LHZEVvnng2x5yfsKAPc 7zbNaYya8uJPPX2117EMlTD6GlgJTKS3j44OWjHKqgT9rtOu9HwASQ7wWuXfKz7F0jAB UQwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=NogtlayQ; 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=REJECT sp=REJECT dis=NONE) header.from=fb.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p25si6594253ejc.560.2020.07.27.12.28.31; Mon, 27 Jul 2020 12:28:53 -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=@fb.com header.s=facebook header.b=NogtlayQ; 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=REJECT sp=REJECT dis=NONE) header.from=fb.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730892AbgG0SsE (ORCPT + 99 others); Mon, 27 Jul 2020 14:48:04 -0400 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:10168 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731708AbgG0SpZ (ORCPT ); Mon, 27 Jul 2020 14:45:25 -0400 Received: from pps.filterd (m0109334.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 06RIcv6Y016654 for ; Mon, 27 Jul 2020 11:45:25 -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=spKGLxK3o4M7edg5m180h3ipHDO4sW7AlZIYk+WTamM=; b=NogtlayQM9G4TQBScZkqEq7YG9r7IugV+Pk7d7/OpB7GCAU5cKbWPWeuUDcEgYvzJfri wwQF1C5T2z7y3eKfc3K8I/4L0nOedEtOTOHzMo2ns6husBr3a71DPbYr1IAvtpYeBzTR c8p/KFqRbY/kqKCA1mISsXtOzoitZy4M55I= Received: from maileast.thefacebook.com ([163.114.130.16]) by mx0a-00082601.pphosted.com with ESMTP id 32h4q9dvj9-18 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Mon, 27 Jul 2020 11:45:25 -0700 Received: from intmgw004.06.prn3.facebook.com (2620:10d:c0a8:1b::d) by mail.thefacebook.com (2620:10d:c0a8:82::e) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Mon, 27 Jul 2020 11:45:22 -0700 Received: by devvm1096.prn0.facebook.com (Postfix, from userid 111017) id D3FE31DAFE8F; Mon, 27 Jul 2020 11:45:10 -0700 (PDT) Smtp-Origin-Hostprefix: devvm From: Roman Gushchin Smtp-Origin-Hostname: devvm1096.prn0.facebook.com To: CC: , Alexei Starovoitov , Daniel Borkmann , , , Roman Gushchin Smtp-Origin-Cluster: prn0c01 Subject: [PATCH bpf-next v2 15/35] bpf: eliminate rlimit-based memory accounting for cpumap maps Date: Mon, 27 Jul 2020 11:44:46 -0700 Message-ID: <20200727184506.2279656-16-guro@fb.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200727184506.2279656-1-guro@fb.com> References: <20200727184506.2279656-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-07-27_13:2020-07-27,2020-07-27 signatures=0 X-Proofpoint-Spam-Details: rule=fb_default_notspam policy=fb_default score=0 spamscore=0 impostorscore=0 clxscore=1015 lowpriorityscore=0 mlxlogscore=934 malwarescore=0 adultscore=0 phishscore=0 mlxscore=0 priorityscore=1501 bulkscore=0 suspectscore=38 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2007270126 X-FB-Internal: deliver Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Do not use rlimit-based memory accounting for cpumap maps. It has been replaced with the memcg-based memory accounting. Signed-off-by: Roman Gushchin --- kernel/bpf/cpumap.c | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/kernel/bpf/cpumap.c b/kernel/bpf/cpumap.c index 74ae9fcbe82e..50f3444a3301 100644 --- a/kernel/bpf/cpumap.c +++ b/kernel/bpf/cpumap.c @@ -86,8 +86,6 @@ static struct bpf_map *cpu_map_alloc(union bpf_attr *at= tr) u32 value_size =3D attr->value_size; struct bpf_cpu_map *cmap; int err =3D -ENOMEM; - u64 cost; - int ret; =20 if (!bpf_capable()) return ERR_PTR(-EPERM); @@ -111,26 +109,14 @@ static struct bpf_map *cpu_map_alloc(union bpf_attr= *attr) goto free_cmap; } =20 - /* make sure page count doesn't overflow */ - cost =3D (u64) cmap->map.max_entries * sizeof(struct bpf_cpu_map_entry = *); - - /* Notice returns -EPERM on if map size is larger than memlock limit */ - ret =3D bpf_map_charge_init(&cmap->map.memory, cost); - if (ret) { - err =3D ret; - goto free_cmap; - } - /* Alloc array for possible remote "destination" CPUs */ cmap->cpu_map =3D bpf_map_area_alloc(cmap->map.max_entries * sizeof(struct bpf_cpu_map_entry *), cmap->map.numa_node); if (!cmap->cpu_map) - goto free_charge; + goto free_cmap; =20 return &cmap->map; -free_charge: - bpf_map_charge_finish(&cmap->map.memory); free_cmap: kfree(cmap); return ERR_PTR(err); --=20 2.26.2