Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp39362ybg; Mon, 27 Jul 2020 22:43:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzOTjCuV+paU461qvKQf7x2llwz0CfYCkQS/0eiayGJrIEZw0dxKTsKP6r+Cwnu52ZH3NS4 X-Received: by 2002:a17:906:8d5:: with SMTP id o21mr25421856eje.155.1595915002714; Mon, 27 Jul 2020 22:43:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595915002; cv=none; d=google.com; s=arc-20160816; b=V2M3hcgEstx48TL7ngvqe8D3DjdKIRPXBB3yG5UeBIFxCbhsAgo8mOvzg7dWQhpqZu VQJ5x0t2iGV5U02woY2IvpcglvBKrsLnQzmsMPTmeebsmcLNuSEFp7Sa9e8ZoTXd+JMv tjM/dLg/RW2UhvMds6cZ1h2MhDrroooPK46xpwc9hVJpHrfZHO4hgptq3/beTmPI2fmL 2UU7+bXeXgm3HBnV8FzSvVAvJVawy4bktQ4svgMqwA01UfBziROpmcOHiqEiuc0gSIqG 5dmXb3bNdviKjg+XQBoeG/ICyUanMeB2fl9vUUP57SxX84BfExR2+EinMR1rF60mjKFj 2Hbw== 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=iXPf2vANBNwkd0YFxFEW1z8h6eMZSV3F8s8jGR8drYk=; b=ntIBJN0HeUHrteGSClPzO3J1leOOMekVbojEIDXvIk00LmdYaeDQQARt7xZ9xpU4rD UgzsFZbALfnc/KxogbEyHESsR9TNlTVtESQgxjKGIc3WQB76Jbud46+HYJ78FDdbzNXN gQh3CFK8SqlvylHxPongE2A3pBX5qcEOdze/uPjcdquFLh4O/+1u0DStEgOS8MBf49AJ uBrev97cl4YRYuLe8sTAtSJ6zdVM6e3iIlakQwW48QWYRJSdHf5807l8i/MuhvMRzySq AA8dvS0cgkJ6IviZnyXZSryMMtN/BlXIjjUYDH99j7Gd/TOkCXB+UyUsEeQ0zTYfdP3F 9maw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Hirz63es; 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 cn25si6609102edb.68.2020.07.27.22.42.59; Mon, 27 Jul 2020 22:43:22 -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=Hirz63es; 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 S1726885AbgG1Fmr (ORCPT + 99 others); Tue, 28 Jul 2020 01:42:47 -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-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: 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: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 >