Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3573871pxb; Mon, 16 Nov 2020 19:47:38 -0800 (PST) X-Google-Smtp-Source: ABdhPJxFFmL9K1Eh22okI4vO8Uyftv5EtNQKTdqX5ZHMF9tI8+ocNK38XbSWjHivZnCVGYgBa6xX X-Received: by 2002:a05:6402:1701:: with SMTP id y1mr18790661edu.209.1605584858652; Mon, 16 Nov 2020 19:47:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605584858; cv=none; d=google.com; s=arc-20160816; b=I5zFTeq4o6z5ft1CN//S7tDapu/Os45y3hdzj523FC0m4c8002GxYq9w2altt0Blo+ BnIoQ6e1U/ZqRNaOPJNM1WoCFxNXfjyYOJgJUHcCa/wdOUM9n1K6WZs4LTfYSA66YGAV ihfLoBxP+X40DrIyCeSE2my1RFLikthDr+W+yZhPk6cM6Xm0DRcvbHnvAfUjwtMMIxr4 2wn55bad26N9kQ2r03paMC0oTZArRPExarsZ1sXs2rCrHwFksRhO9SDvNv4QgaHzhvO2 pyvbsq/rErKSYWR0hXPe23RkFOQbg0jSTZYD1M6knPngiAVOC2br0bNgmVv+bZQahlzV +vFQ== 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=KNn6uyc3tV+ux/DO1FxTwr9IPh3spp8u9TZO13FDxAGqr0lzF1nUZ8E/Q+WEF+5hlQ 46p9bvgYBgK47/ZVqPB3AVQ0mEVKe2nDq2RPHc2I6yQcu/9mudQDcrpM44cLxgHw1eGL 8cKbfxriHY32Za7X7zg01NliljUPvmX0Luve/NHJniKeKpXlq5JRyskx0wMTWe5UvIhz aaBWtbwxBc+garzSBKIk75/j22yFZKaOkyPFqfgdNY4KrchN5uG+GkDMW+/oQsuv7gyn 9mWJhO7TLj+yv6nBV5DUI9jYV0EsgrworthFJXz/p+AhB+3BGnM86OYk3Yc4gLd5k2dO +yeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=murQ0mch; 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 e1si12628167ejf.335.2020.11.16.19.47.16; Mon, 16 Nov 2020 19:47:38 -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=murQ0mch; 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 S1726912AbgKQDnd (ORCPT + 99 others); Mon, 16 Nov 2020 22:43:33 -0500 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:55668 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726973AbgKQDlR (ORCPT ); Mon, 16 Nov 2020 22:41:17 -0500 Received: from pps.filterd (m0044012.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0AH3eXet024889 for ; Mon, 16 Nov 2020 19:41:17 -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=murQ0mchcXXIEZpJZvMR6ZPz5/Gpouj0m2zRcDKfjxK695cZTNvxMVdDcDXkU8EUKSd5 EuKm3fvHm38d4XlI/q+0TrRkDIg5a/r4YQq5qFQGa621JSh6Nw5okc+4kaULx/0wiL9z 7ppctWs9uLcKmjsl23Zzv5NBRsrSWXwb3BY= Received: from mail.thefacebook.com ([163.114.132.120]) by mx0a-00082601.pphosted.com with ESMTP id 34u0698p82-14 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Mon, 16 Nov 2020 19:41:17 -0800 Received: from intmgw002.06.prn3.facebook.com (2620:10d:c085:108::8) by mail.thefacebook.com (2620:10d:c085:21d::4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Mon, 16 Nov 2020 19:41:14 -0800 Received: by devvm3388.prn0.facebook.com (Postfix, from userid 111017) id 83329C63A89; Mon, 16 Nov 2020 19:41:10 -0800 (PST) From: Roman Gushchin To: CC: , , , , , , , Subject: [PATCH bpf-next v6 25/34] bpf: eliminate rlimit-based memory accounting for queue_stack_maps maps Date: Mon, 16 Nov 2020 19:40:59 -0800 Message-ID: <20201117034108.1186569-26-guro@fb.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20201117034108.1186569-1-guro@fb.com> References: <20201117034108.1186569-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-17_01:2020-11-13,2020-11-17 signatures=0 X-Proofpoint-Spam-Details: rule=fb_default_notspam policy=fb_default score=0 mlxscore=0 impostorscore=0 phishscore=0 suspectscore=13 priorityscore=1501 spamscore=0 mlxlogscore=999 adultscore=0 lowpriorityscore=0 bulkscore=0 malwarescore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2011170027 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