Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp37006ybg; Mon, 27 Jul 2020 22:37:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyXi5BAscErKnOr/dUM5OM9kJkyJ6i1OYkzqh8j/gZek9NgFrKlF3pQDNtA86ppaWDUJDXf X-Received: by 2002:aa7:da4c:: with SMTP id w12mr23857548eds.122.1595914651756; Mon, 27 Jul 2020 22:37:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595914651; cv=none; d=google.com; s=arc-20160816; b=IDHpJ46bNw0jJWSDhzu7dMooK2I1MHLfJDUbGQIS/PWLEQSmo6mA7tySW+qGLl31vg 7wfU2ze1MZ/QclGqFV7A2B4xhlxFu6mBgP94WGPyblPZNdvqHS+cEbGCgcBM4Ar8HL25 WvegwH71NLhPtXezNdrbpGYXz6R4SvXWy0S8pJEACkQfjiPGD454iyHBMHARXSqIueMY nyAtrMYTgTG+F3h0ro/FhpCetJdas8yEuVOXi3YFa0A/nRJrHhswo+xBpCciP4OqxqCW thrngqku1kvZ6mCc0BeBGkih5odWYWclKYsRbivDvCMbZdChAFibSyhk+l72cEOQrqk1 eujQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=U1E8gSifxDPldap/Y7e80iGTMMX8DwjxLXD/dj6Kpoo=; b=q4YGuhkqMbJzXGsSAD51uZPkun0UB5tz0m8WoHgnwRQGWda6G70CYycmuQDhL3u6GR 7rWqxnTlfBieEK2bMet96KJHrZVt1nyRnp521AtibWuyIpRrBuTtU7Rpi1+gXBAfBQ3g 0mQd3RKZ1a1LAFrcY8ZSIgrbvME8EJbvaRxKiS/tja/TbCs1uVCF4Y3gf6VhLy+Ppcr6 lFF95DlOHRviCdTLO1OL1rQp4IcdFMYjX6epipz5QnRq9wFp5cr/ALIciiHfr8js9VQl xf64di2/1jahLBURYAVB8PxE04LQuplfFvXpKmpekCV8GqIOL6gJiOVfSp4iQcyw55x0 Mzjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=wbztQyAG; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i22si6747380edy.547.2020.07.27.22.37.09; Mon, 27 Jul 2020 22:37:31 -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=@kernel.org header.s=default header.b=wbztQyAG; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726980AbgG1FgO (ORCPT + 99 others); Tue, 28 Jul 2020 01:36:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:43700 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726907AbgG1FgO (ORCPT ); Tue, 28 Jul 2020 01:36:14 -0400 Received: from mail-lj1-f180.google.com (mail-lj1-f180.google.com [209.85.208.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8185A20829; Tue, 28 Jul 2020 05:36:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595914573; bh=NYliXhNE0Ikas7TdF7KFQr01kN+9oP3XTP/30kkz19w=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=wbztQyAGOFzqAtc/JfZCe7NjR+kFf/xrcivW+Rf6ATDHzAHDJHz7KevjKh/J0Gnag tONn7WYm2he40dDt6DtuCGgGkzIYS7INuV2XA8tkcy3by3lWchpA5ujXqbuSfDMhN/ JBB9v1zQB7bOQCUs6X2PMChaSCZ1UbqY15AmqnsQ= Received: by mail-lj1-f180.google.com with SMTP id s16so4527693ljc.8; Mon, 27 Jul 2020 22:36:13 -0700 (PDT) X-Gm-Message-State: AOAM533mXh2AdzPGkvH2KrSjICoq+DTnNIDmdmvcIEkn/BYNn5AfVExc 0XZjS7RCckPw+f8wj64AnDVVsqUbthlzmqv8AhE= X-Received: by 2002:a2e:3003:: with SMTP id w3mr11851266ljw.273.1595914571828; Mon, 27 Jul 2020 22:36:11 -0700 (PDT) MIME-Version: 1.0 References: <20200727184506.2279656-1-guro@fb.com> <20200727184506.2279656-22-guro@fb.com> In-Reply-To: <20200727184506.2279656-22-guro@fb.com> From: Song Liu Date: Mon, 27 Jul 2020 22:36:00 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH bpf-next v2 21/35] bpf: eliminate rlimit-based memory accounting for reuseport_array maps To: Roman Gushchin Cc: bpf , Networking , Alexei Starovoitov , Daniel Borkmann , Kernel Team , open list Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 27, 2020 at 12:23 PM Roman Gushchin wrote: > > Do not use rlimit-based memory accounting for reuseport_array maps. > It has been replaced with the memcg-based memory accounting. > > Signed-off-by: Roman Gushchin Acked-by: Song Liu > --- > kernel/bpf/reuseport_array.c | 12 ++---------- > 1 file changed, 2 insertions(+), 10 deletions(-) > > diff --git a/kernel/bpf/reuseport_array.c b/kernel/bpf/reuseport_array.c > index 90b29c5b1da7..9d0161fdfec7 100644 > --- a/kernel/bpf/reuseport_array.c > +++ b/kernel/bpf/reuseport_array.c > @@ -150,9 +150,8 @@ static void reuseport_array_free(struct bpf_map *map) > > static struct bpf_map *reuseport_array_alloc(union bpf_attr *attr) > { > - int err, numa_node = bpf_map_attr_numa_node(attr); > + int numa_node = bpf_map_attr_numa_node(attr); > struct reuseport_array *array; > - struct bpf_map_memory mem; > u64 array_size; > > if (!bpf_capable()) > @@ -161,20 +160,13 @@ static struct bpf_map *reuseport_array_alloc(union bpf_attr *attr) > array_size = sizeof(*array); > array_size += (u64)attr->max_entries * sizeof(struct sock *); > > - err = bpf_map_charge_init(&mem, array_size); > - if (err) > - return ERR_PTR(err); > - > /* allocate all map elements and zero-initialize them */ > array = bpf_map_area_alloc(array_size, numa_node); > - if (!array) { > - bpf_map_charge_finish(&mem); > + if (!array) > return ERR_PTR(-ENOMEM); > - } > > /* copy mandatory map attributes */ > bpf_map_init_from_attr(&array->map, attr); > - bpf_map_charge_move(&array->map.memory, &mem); > > return &array->map; > } > -- > 2.26.2 >