From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4F821C433E1 for ; Tue, 28 Jul 2020 05:42:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 29A9D21883 for ; Tue, 28 Jul 2020 05:42:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595914967; bh=lj3FNQ1UDqad2e0mCQmLxeBO4aVJvqcXp3FfYr1yaKs=; h=References:In-Reply-To:From:Date:Subject:To:Cc:List-ID:From; b=DK0rxCddch01PLrVD0nZu9nsLMBMsmeJVFslrJUp1UU8+SSMqhugELSkEBZJW9vVW yaTCiovXdYVf10hUIJLraS7J2dPBz6jQlHO9tUzVeKxxIL20TdNQEKZ90XhSu6pOVh nU+BDVQq82bEu/hd2RSclLEQfa6EOq1ROxYTbQ/Q= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726631AbgG1Fmq (ORCPT ); Tue, 28 Jul 2020 01:42:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:45858 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726162AbgG1Fmq (ORCPT ); Tue, 28 Jul 2020 01:42:46 -0400 Received: from mail-lf1-f45.google.com (mail-lf1-f45.google.com [209.85.167.45]) (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 9829D21883; Tue, 28 Jul 2020 05:42:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595914965; bh=lj3FNQ1UDqad2e0mCQmLxeBO4aVJvqcXp3FfYr1yaKs=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=Hirz63esA2VGBgqPzEHyFgMOc8WlNGlLrR1ie0210JBHeNfO9ib9yDnUl7QnJLKbE VsrFxtJIDPwuaP1BAQ9lRkC6vC2da4X6yGZ6Uftx+uXoQSm+N2yMywFwJ1zuEDDWQy 0NmvkeOp2iaY3uzgpPyX0NQtpiO6q+YYqGfgSoq4= Received: by mail-lf1-f45.google.com with SMTP id j22so4416877lfm.2; Mon, 27 Jul 2020 22:42:45 -0700 (PDT) X-Gm-Message-State: AOAM531bgJIRP56/zQ2xxYkJMb7s/iwYqqLQkDiDQZ5syzWsuL9cJWRg GzgDUb5UZ7NP0FHcSW4TxTx0ZB5LccUJ46El4Rc= X-Google-Smtp-Source: ABdhPJwyH+WSjHjYgU1gw0yiKhX4F2dJYfdOacs8MdbY26DOXkMyXb0Jk/TQrnIt3t9PjDKoB60Duy4DkaZsdJuuHGY= X-Received: by 2002:a19:be53:: with SMTP id o80mr13458103lff.33.1595914963845; Mon, 27 Jul 2020 22:42:43 -0700 (PDT) MIME-Version: 1.0 References: <20200727184506.2279656-1-guro@fb.com> <20200727184506.2279656-27-guro@fb.com> In-Reply-To: <20200727184506.2279656-27-guro@fb.com> From: Song Liu Date: Mon, 27 Jul 2020 22:42:32 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH bpf-next v2 26/35] bpf: eliminate rlimit-based memory accounting for xskmap maps To: Roman Gushchin Cc: bpf , Networking , Alexei Starovoitov , Daniel Borkmann , Kernel Team , open list Content-Type: text/plain; charset="UTF-8" Sender: bpf-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org On Mon, Jul 27, 2020 at 12:21 PM Roman Gushchin wrote: > > Do not use rlimit-based memory accounting for xskmap maps. > It has been replaced with the memcg-based memory accounting. > > Signed-off-by: Roman Gushchin Acked-by: Song Liu > --- > net/xdp/xskmap.c | 10 +--------- > 1 file changed, 1 insertion(+), 9 deletions(-) > > diff --git a/net/xdp/xskmap.c b/net/xdp/xskmap.c > index e574b22defe5..0366013f13c6 100644 > --- a/net/xdp/xskmap.c > +++ b/net/xdp/xskmap.c > @@ -74,7 +74,6 @@ static void xsk_map_sock_delete(struct xdp_sock *xs, > > static struct bpf_map *xsk_map_alloc(union bpf_attr *attr) > { > - struct bpf_map_memory mem; > int err, numa_node; > struct xsk_map *m; > u64 size; > @@ -90,18 +89,11 @@ static struct bpf_map *xsk_map_alloc(union bpf_attr *attr) > numa_node = bpf_map_attr_numa_node(attr); > size = struct_size(m, xsk_map, attr->max_entries); > > - err = bpf_map_charge_init(&mem, size); > - if (err < 0) > - return ERR_PTR(err); > - > m = bpf_map_area_alloc(size, numa_node); > - if (!m) { > - bpf_map_charge_finish(&mem); > + if (!m) > return ERR_PTR(-ENOMEM); > - } > > bpf_map_init_from_attr(&m->map, attr); > - bpf_map_charge_move(&m->map.memory, &mem); > spin_lock_init(&m->lock); > > return &m->map; > -- > 2.26.2 >