Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp68892pxu; Tue, 24 Nov 2020 19:04:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJzclCmKjCqt+s3fmciBeE77kCbn2tBZSXA3P2npWgr+7adFiztLx8nIsV+sECwwF95646WZ X-Received: by 2002:a50:9fcb:: with SMTP id c69mr1497960edf.289.1606273486334; Tue, 24 Nov 2020 19:04:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606273486; cv=none; d=google.com; s=arc-20160816; b=GcBcNzPZQwH1sUWEs649fWP+jlV1drzhSAhZoYI3vqGiUpYI2ffMztSKPziohiudJ2 MW/9RqYkgWYJ0u7hI3E7DWjrfEdyil9f0c0YAdGveBZVGmreJRFLpOLYmVAFwB5zfpNl se8E5Uqqh2fXWeI7ypx7+cj1Ycs7KrxAXDoUCCJGbWCnGGGEwbNm5HsADDOATjnO+pKI k/eO/sV7rgn1HV77FojCwnFHO/voYtefLrI9RpLVItuTj7ySrKNPdBxtcNRyZPgvTMiU 2Yk2GMpD7tYQ2Fp5ECLm4G+DPm5aLqspzkZ+6PrvGosZY5ruROvifM5W6rVai/GHjcbJ USzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=rKGNszCW/P6dvmhm3p060mdAyE8dspU8E8AG4YPMM50=; b=rxe9QTvHaNOIwqFay+wKhTifGsnwAyiqJRQjpzfCb6C56T7+8zK3oHSHEMkqreLiWu vsIpytPuDiHeeY1yCKIpUNC5seor4rO/4cHcwZV4qHqufq6NdkE//va5WqLfhk7evkBG un5gafG8f/hpqBrr9HQe1GxP+VjlG5i2ySanyDYW8NuTnTqhGA8e80vettvzmAXR3GWh GwpDIRMFC9TJfyFFu8kRRPSqQyrxQ3D9TNQ4NkxhxLwD8Ps4eu/T4TWgM/clIY7hssSo wcGTCa1XhL/2kb8m5wEq38Kblm1r15oA4MSTig+3+nsTqGRpvmK6xOyvi+At0EiF8Spg MQpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=AjoMsABg; 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 o26si426543edq.426.2020.11.24.19.04.24; Tue, 24 Nov 2020 19:04:46 -0800 (PST) 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=AjoMsABg; 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 S1727942AbgKYDBo (ORCPT + 99 others); Tue, 24 Nov 2020 22:01:44 -0500 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:39440 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727777AbgKYDBl (ORCPT ); Tue, 24 Nov 2020 22:01:41 -0500 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 0AP30fi7002497 for ; Tue, 24 Nov 2020 19:01:40 -0800 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=rKGNszCW/P6dvmhm3p060mdAyE8dspU8E8AG4YPMM50=; b=AjoMsABg4dXIuOh87B66cN6uMPlmYwbur7cAuiqG8DWWGjXSku9RRVTQiZtgzqqVyYqq GW3x9Azh2tO3Jn7afzEiz/bRKUuc/4WaeeSGBCGGjL0O1tf4pswxHCmjrf/sAaC4Wv/h 4XSkNihs9KYeydb2sNsQt2++AwXC5MOGebo= Received: from maileast.thefacebook.com ([163.114.130.16]) by mx0a-00082601.pphosted.com with ESMTP id 34yk904r1w-5 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Tue, 24 Nov 2020 19:01:40 -0800 Received: from intmgw001.06.prn3.facebook.com (2620:10d:c0a8:1b::d) by mail.thefacebook.com (2620:10d:c0a8:83::4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Tue, 24 Nov 2020 19:01:32 -0800 Received: by devvm3388.prn0.facebook.com (Postfix, from userid 111017) id 5E5CD16A18B3; Tue, 24 Nov 2020 19:01:22 -0800 (PST) From: Roman Gushchin To: CC: , , , , , , , Subject: [PATCH bpf-next v8 25/34] bpf: eliminate rlimit-based memory accounting for queue_stack_maps maps Date: Tue, 24 Nov 2020 19:01:10 -0800 Message-ID: <20201125030119.2864302-26-guro@fb.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20201125030119.2864302-1-guro@fb.com> References: <20201125030119.2864302-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.312,18.0.737 definitions=2020-11-24_11:2020-11-24,2020-11-24 signatures=0 X-Proofpoint-Spam-Details: rule=fb_default_notspam policy=fb_default score=0 mlxscore=0 lowpriorityscore=0 impostorscore=0 phishscore=0 bulkscore=0 suspectscore=13 malwarescore=0 mlxlogscore=999 spamscore=0 priorityscore=1501 clxscore=1015 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2011250019 X-FB-Internal: deliver 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 Acked-by: Song Liu --- 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 0ee2347ba510..f9c734aaa990 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