Received: by 2002:a17:90b:8d0:0:0:0:0 with SMTP id ds16csp5079333pjb; Mon, 27 Jul 2020 12:22:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwtJ7ETs+8zLZXCkkGzPHwJ1W0H7GlUGwceHnPujqhjAzQURnPWWs/5F6P7ZRz4yZIt1jmX X-Received: by 2002:a17:906:fac1:: with SMTP id lu1mr23458673ejb.427.1595877768445; Mon, 27 Jul 2020 12:22:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595877768; cv=none; d=google.com; s=arc-20160816; b=cJL3wrP7aZlUHjwLomJKXbEQUupJbO5IZw7nZTrSGmuMpmW1zRycfDfbugl1On3Hsv N8b/O/FzDG1pQrdy7pSEtrXz/bBFnEksnNr7JMXBEWgSSkcsauJcqkcBpo+nkG2j8qzy DGZe0sLdQkeuZB+5zLEfB5GR6fgQULYrGa+pfyLu9d9GRvlfSWBbn7Z4v1UvHlhzT+Jb SwSwK/caiVfGdHEvONFd1fy4JH5l8e+Bfclo8IMyXV+ukSPfyZr/zVRQLOcCePa5G73J Yb37dH84awfBnfJ7/wBOrXtI0zrHj774arljJe48cME1TVtJGMk17pzZvmU1mnkzPdHG c+zg== 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=MfBRLRLGsy/1tMM++wlzJ5s7yWgWU4zl3ei5tqNLqCg=; b=V3LCiR+3l6xeOhKEd368mru2OF8tYHCH7w7DYWJ92xuVVzKn2Q6mQr+4mFQspS077D JIKTaNCuQgwhzp+Tf4Uh3yjezR5PaUOjhSZEWyjSiYnSzwortBR1swejkFAOm1ho3anC 1QLhe6xDH86Eb9u4nUvZD9nkTHTwK5nr9inQj/JbC6xkLsGhn1P7mxoZzM2SA6JUJEyA I4VQsbLAZ65+0xTqxBQGEaTIDubi3J+NIchSaw1kqAUg9a5Ptw0klzfP8JD6mokga6PA FXy5vtNCE1GE77UMz/T1az/94fJfz12FISDeWrNBXPV9yMU6kd5MVpDDRmXg6B44p6RW Eklg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=n2cUFF0S; 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 r21si1425834edc.313.2020.07.27.12.22.26; Mon, 27 Jul 2020 12:22:48 -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=n2cUFF0S; 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 S1732282AbgG0Sqb (ORCPT + 99 others); Mon, 27 Jul 2020 14:46:31 -0400 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:41744 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732103AbgG0Spx (ORCPT ); Mon, 27 Jul 2020 14:45:53 -0400 Received: from pps.filterd (m0109333.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 06RIjrul021093 for ; Mon, 27 Jul 2020 11:45:53 -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=MfBRLRLGsy/1tMM++wlzJ5s7yWgWU4zl3ei5tqNLqCg=; b=n2cUFF0S5gIHneq7Beg2k2JVJoWOTUazSxUzmdxga9yo81qlaZhbvZewEvLd89+hZIyQ Y5z0tOf2Rtnmu8knvK90bbNJKLmWkMYYYQGIzEvuHvkcl2PQ9UEUAPDzq0L5dgBdS9Ob k9VjcYA0FXU086XCUd9gyhwNhN/Lfit/LK4= Received: from mail.thefacebook.com ([163.114.132.120]) by mx0a-00082601.pphosted.com with ESMTP id 32h4ed5u9q-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Mon, 27 Jul 2020 11:45:53 -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; Mon, 27 Jul 2020 11:45:16 -0700 Received: by devvm1096.prn0.facebook.com (Postfix, from userid 111017) id EDFAF1DAFE99; 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 20/35] bpf: eliminate rlimit-based memory accounting for queue_stack_maps maps Date: Mon, 27 Jul 2020 11:44:51 -0700 Message-ID: <20200727184506.2279656-21-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 mlxscore=0 priorityscore=1501 spamscore=0 lowpriorityscore=0 impostorscore=0 adultscore=0 bulkscore=0 malwarescore=0 phishscore=0 clxscore=1015 suspectscore=13 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2007270127 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 queue_stack maps. It has been replaced with the memcg-based memory accounting. Signed-off-by: Roman Gushchin --- kernel/bpf/queue_stack_maps.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/kernel/bpf/queue_stack_maps.c b/kernel/bpf/queue_stack_maps.= c index 44184f82916a..92e73c35a34a 100644 --- a/kernel/bpf/queue_stack_maps.c +++ b/kernel/bpf/queue_stack_maps.c @@ -66,29 +66,21 @@ static int queue_stack_map_alloc_check(union bpf_attr= *attr) =20 static struct bpf_map *queue_stack_map_alloc(union bpf_attr *attr) { - int ret, numa_node =3D bpf_map_attr_numa_node(attr); - struct bpf_map_memory mem =3D {0}; + int numa_node =3D bpf_map_attr_numa_node(attr); struct bpf_queue_stack *qs; - u64 size, queue_size, cost; + u64 size, queue_size; =20 size =3D (u64) attr->max_entries + 1; - cost =3D queue_size =3D sizeof(*qs) + size * attr->value_size; - - ret =3D bpf_map_charge_init(&mem, cost); - if (ret < 0) - return ERR_PTR(ret); + queue_size =3D sizeof(*qs) + size * attr->value_size; =20 qs =3D bpf_map_area_alloc(queue_size, numa_node); - if (!qs) { - bpf_map_charge_finish(&mem); + if (!qs) return ERR_PTR(-ENOMEM); - } =20 memset(qs, 0, sizeof(*qs)); =20 bpf_map_init_from_attr(&qs->map, attr); =20 - bpf_map_charge_move(&qs->map.memory, &mem); qs->size =3D size; =20 raw_spin_lock_init(&qs->lock); --=20 2.26.2