Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp2244824ybg; Thu, 30 Jul 2020 14:28:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzw9WuC9SmZjKzdIyxkmC2tiJrOapTEtN3bd/0pjweh44EmyptUfcnN2OcpniIfy9uHmAVv X-Received: by 2002:a17:906:98c1:: with SMTP id zd1mr1082410ejb.410.1596144533349; Thu, 30 Jul 2020 14:28:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596144533; cv=none; d=google.com; s=arc-20160816; b=B6ASJcdEjyX5trDOVKSHy0pKZhk/TN6nEsEGgdlHX9iJJOsDxZTnc2fBTnslnOpYli j8n/gG+U6TI+Z0Y9MM89tM7PNRsXrTQB31TO3bBYYp6kq5f7x5Wt4rrpo5TyTXq28asW T/YBEm1rm/VCP0QVMYNQxL1OeNtEONS3sdFeznIh5BmSyJwohaQf/6JYQNTme/fjQ2o8 yNkVnTimj0pGIEm81l8UkMPc0/iY0hOISeyoAqHH/hnYlzkHh+b1Sz0j2Qz3/BXQvFKJ DRt49X7+/CRK590VLvlLa5cFDIux0eLQTnDxRoiv0LdaK2DXhqnwQlG5ygGssmPul+Ia EFHg== 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=gCLOpqUXHAWE2sGF7OqGp2MScbZ8CmithNn8XFEXBiY=; b=0Zl6VSx/7LMdlCX/HDlyqVqSsAMDEik6YAmSMrHGWcmV6ms23J6Y3TaGhm5l4m+yiG p4xdmkYlSzwW5lXI4ZsiI5+1/N6/TLorskvyBshaqS4HyPpPpxmF2B1WE9H96Mw7WapL 12XPoZmXZmNBcck6XGh9Og8IckDElLFXvedO4g9d0p3q7KjlhCxa8bR6QHZz0p3XJKWy Q2ZkB/n7MNJ6YHUOPKfEj8IU5nFHJHtjgVnX54gogIMwnCVcH7WAgf1ydiKfePG5wBXH uIVsNRb+NZMVyY+glipizoICDFe6DtIf4UBW58nfltWRyulC04z2eoAQK5upf8Ee9WSj idGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b="KJcW/7Bj"; 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 12si3724592edx.70.2020.07.30.14.28.31; Thu, 30 Jul 2020 14: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="KJcW/7Bj"; 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 S1731003AbgG3VZs (ORCPT + 99 others); Thu, 30 Jul 2020 17:25:48 -0400 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:51024 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730632AbgG3VXV (ORCPT ); Thu, 30 Jul 2020 17:23:21 -0400 Received: from pps.filterd (m0044010.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 06ULFark011439 for ; Thu, 30 Jul 2020 14:23:21 -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=gCLOpqUXHAWE2sGF7OqGp2MScbZ8CmithNn8XFEXBiY=; b=KJcW/7Bj6yaZETsPY93JSecLiaw6rpL5gHorp5Sizuf+5RwYJ2s21S+tyJg+0zYXXDHv /G8LQcq8crlArd8D+duo7mKfjb0D0hOfmvRx7MS7AXHxWzNrSb0+PgG9DjOH4GxFHzKE Y0hpvfBrQuV+WcqY6wbDUCryRVWUNRtvm5Q= Received: from mail.thefacebook.com ([163.114.132.120]) by mx0a-00082601.pphosted.com with ESMTP id 32kcbuy0yx-7 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Thu, 30 Jul 2020 14:23:21 -0700 Received: from intmgw002.41.prn1.facebook.com (2620:10d:c085:208::11) by mail.thefacebook.com (2620:10d:c085:21d::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Thu, 30 Jul 2020 14:23:19 -0700 Received: by devvm1096.prn0.facebook.com (Postfix, from userid 111017) id 0579320B00C4; Thu, 30 Jul 2020 14:23:13 -0700 (PDT) Smtp-Origin-Hostprefix: devvm From: Roman Gushchin Smtp-Origin-Hostname: devvm1096.prn0.facebook.com To: CC: , Alexei Starovoitov , Daniel Borkmann , , , Roman Gushchin , Song Liu Smtp-Origin-Cluster: prn0c01 Subject: [PATCH bpf-next v3 20/29] bpf: eliminate rlimit-based memory accounting for queue_stack_maps maps Date: Thu, 30 Jul 2020 14:23:01 -0700 Message-ID: <20200730212310.2609108-21-guro@fb.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200730212310.2609108-1-guro@fb.com> References: <20200730212310.2609108-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-30_15:2020-07-30,2020-07-30 signatures=0 X-Proofpoint-Spam-Details: rule=fb_default_notspam policy=fb_default score=0 mlxlogscore=999 bulkscore=0 clxscore=1015 suspectscore=13 phishscore=0 malwarescore=0 priorityscore=1501 adultscore=0 spamscore=0 impostorscore=0 mlxscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2007300150 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 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 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