Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp69217pxu; Tue, 24 Nov 2020 19:05:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJwwDIPmRnP0nmoPbcDZuGdLcWWanJ0j2gZH/1MMv5NKbszpziVReFVhD7qrIge2ZO2vhW/i X-Received: by 2002:a17:906:1481:: with SMTP id x1mr1398808ejc.186.1606273526125; Tue, 24 Nov 2020 19:05:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606273526; cv=none; d=google.com; s=arc-20160816; b=lG1pnMmfjPF9GKNo1dTr74N5WnpdpwhAr1gPMDjCHfN6QKlh1id1iA01plG8Q9pdwJ 67e/R261SCr3Q+i/F4T4N3baVPXMgRoU/jRKAIOJWD9LVwORi+R5PYOdSQTDqZb/Zjsp 2gZTKRKCiwO7QV3PYhMWey669RE+beHBUmWmOPX9MVnrpy68GuJj2dq0htpTYW7wXjfh PnpwseZiIPClwhfYzo45NkEn7FdQKYV/Tz1oOOAmbiomz7lOtv7h8+rRlx4BpVpvx4VV ygPIYWWCNzwpxsbgVhg28rsCY+RveQgPYrOhW29xc8CYudz6L1urbQF2vMW6z4o5JxFa bdiQ== 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=CtZU/Z66pJ6HgtncJzdrIc0HAIs7vBKCZj6Sx0S+MSs=; b=CMtuOgnf0zp8VNdYPm9NLA7Z06ffnfKFFdjZQ4nV8G8z9/XZkasJ5ilzcwMw6vMfTG crHL0zio0fzoj7exQRlpZpZSE0XO/Mpv35aJmUV0WQn1rPqJEqxlv63tX9ZgHsL0Eo4K qsVyvdcAWgqJwofgLocWv6qViyv3k/+sfb7aFExUhP3/X+HP43ohdvUI0RLdtMnYMiIa VWcEMuzYGtNF2I4xXZ3UUIS5G2nPJYhGlF7kmMfNRK2IirkAEEyAaIelo/nEO6oukcY0 a16UyE48GTxS6tb/oD9jNi4A2/QQCyYcAtnhHJa8zjmLEBRH9A7o05BkFyvKBlUJJETB qK3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=hpG+SSpU; 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 cn1si428070edb.408.2020.11.24.19.05.04; Tue, 24 Nov 2020 19:05:26 -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=hpG+SSpU; 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 S1728224AbgKYDCh (ORCPT + 99 others); Tue, 24 Nov 2020 22:02:37 -0500 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:44224 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727522AbgKYDBf (ORCPT ); Tue, 24 Nov 2020 22:01:35 -0500 Received: from pps.filterd (m0089730.ppops.net [127.0.0.1]) by m0089730.ppops.net (8.16.0.42/8.16.0.42) with SMTP id 0AP2sovn000549 for ; Tue, 24 Nov 2020 19:01:33 -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=CtZU/Z66pJ6HgtncJzdrIc0HAIs7vBKCZj6Sx0S+MSs=; b=hpG+SSpU80fnsqGy5woAxxrDyKT3SzHQXpLjleL4dWzv5/FoMAbe9ZDlQzL2fh8OFo8l JThAiN0d8jNSULGx5DH0b/XOP7QBwSIpEqoaTJox229Cqj5zp6IJAcjpdil2xBKkUXx5 1lQkUQmV6LQDYXRC56xNbnQjBlUaJgrT7qs= Received: from maileast.thefacebook.com ([163.114.130.16]) by m0089730.ppops.net with ESMTP id 351aqe0unq-7 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Tue, 24 Nov 2020 19:01:33 -0800 Received: from intmgw002.41.prn1.facebook.com (2620:10d:c0a8:1b::d) by mail.thefacebook.com (2620:10d:c0a8:82::c) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Tue, 24 Nov 2020 19:01:28 -0800 Received: by devvm3388.prn0.facebook.com (Postfix, from userid 111017) id 38D5816A18A3; Tue, 24 Nov 2020 19:01:22 -0800 (PST) From: Roman Gushchin To: CC: , , , , , , , Subject: [PATCH bpf-next v8 17/34] bpf: refine memcg-based memory accounting for xskmap maps Date: Tue, 24 Nov 2020 19:01:02 -0800 Message-ID: <20201125030119.2864302-18-guro@fb.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20201125030119.2864302-1-guro@fb.com> References: <20201125030119.2864302-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-24_11:2020-11-24,2020-11-24 signatures=0 X-Proofpoint-Spam-Details: rule=fb_default_notspam policy=fb_default score=0 spamscore=0 bulkscore=0 priorityscore=1501 lowpriorityscore=0 adultscore=0 impostorscore=0 malwarescore=0 mlxscore=0 clxscore=1015 phishscore=0 mlxlogscore=751 suspectscore=13 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2011250018 X-FB-Internal: deliver Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Extend xskmap memory accounting to include the memory taken by the xsk_map_node structure. Signed-off-by: Roman Gushchin --- net/xdp/xskmap.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/xdp/xskmap.c b/net/xdp/xskmap.c index 49da2b8ace8b..eceea51182d9 100644 --- a/net/xdp/xskmap.c +++ b/net/xdp/xskmap.c @@ -28,7 +28,9 @@ static struct xsk_map_node *xsk_map_node_alloc(struct x= sk_map *map, struct xsk_map_node *node; int err; =20 - node =3D kzalloc(sizeof(*node), GFP_ATOMIC | __GFP_NOWARN); + node =3D bpf_map_kmalloc_node(&map->map, sizeof(*node), + GFP_ATOMIC | __GFP_NOWARN | __GFP_ZERO | + __GFP_ACCOUNT, NUMA_NO_NODE); if (!node) return ERR_PTR(-ENOMEM); =20 --=20 2.26.2