Message ID | 20200821150134.2581465-8-guro@fb.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <SRS0=VkKC=B7=kvack.org=owner-linux-mm@kernel.org> Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C2A98722 for <patchwork-linux-mm@patchwork.kernel.org>; Fri, 21 Aug 2020 15:17:52 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 85750207BB for <patchwork-linux-mm@patchwork.kernel.org>; Fri, 21 Aug 2020 15:17:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=fb.com header.i=@fb.com header.b="E/vo9Ew4" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 85750207BB Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=fb.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 9C9EC8D004B; Fri, 21 Aug 2020 11:17:51 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 97A688D0022; Fri, 21 Aug 2020 11:17:51 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8B82E8D004B; Fri, 21 Aug 2020 11:17:51 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0127.hostedemail.com [216.40.44.127]) by kanga.kvack.org (Postfix) with ESMTP id 75C4A8D0022 for <linux-mm@kvack.org>; Fri, 21 Aug 2020 11:17:51 -0400 (EDT) Received: from smtpin02.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 38DFE824556B for <linux-mm@kvack.org>; Fri, 21 Aug 2020 15:17:51 +0000 (UTC) X-FDA: 77174930742.02.bead67_100f8702703a Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin02.hostedemail.com (Postfix) with ESMTP id 462DF10097AA4 for <linux-mm@kvack.org>; Fri, 21 Aug 2020 15:17:50 +0000 (UTC) X-Spam-Summary: 1,0,0,,d41d8cd98f00b204,prvs=55027216e2=guro@fb.com,,RULES_HIT:30054:30064:30070,0,RBL:67.231.145.42:@fb.com:.lbl8.mailshell.net-64.10.201.10 62.18.0.100;04ygj47a4w1e9ebsr5twoodjzendsypjwugzdssztj5e3pwrmzim3rg1hj1mujc.aedojtwy3ds36bnfeuc513a1bfccw8y4ifrctxfsiq8dnkwfo56q3u6hq7eqgzf.o-lbl8.mailshell.net-223.238.255.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:31,LUA_SUMMARY:none X-HE-Tag: bead67_100f8702703a X-Filterd-Recvd-Size: 4147 Received: from mx0a-00082601.pphosted.com (mx0a-00082601.pphosted.com [67.231.145.42]) by imf26.hostedemail.com (Postfix) with ESMTP for <linux-mm@kvack.org>; Fri, 21 Aug 2020 15:17:49 +0000 (UTC) Received: from pps.filterd (m0109334.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 07LF9iwa016946 for <linux-mm@kvack.org>; Fri, 21 Aug 2020 08:17:48 -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=e2ojmGdAXN/pi/PSfQUa46nBXC9EwlxjxEiNBa1My1c=; b=E/vo9Ew4cQEd8ZY/5/dKu3FGkLMv4eqClqmMPCEvhKNkpraopPoYzmc3iqNKCGK6KCPy kPCwi7vEe5boCEtDtKmQRbeOS6+o18BACiB4bVg7lGTYXWoXv0FJmSTBGNT/rrYZa2rY TS3U7KUOpvBUEynegJA9ARH3x2CxMsRrtQU= Received: from maileast.thefacebook.com ([163.114.130.16]) by mx0a-00082601.pphosted.com with ESMTP id 331crbj8nc-8 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for <linux-mm@kvack.org>; Fri, 21 Aug 2020 08:17:48 -0700 Received: from intmgw003.06.prn3.facebook.com (2620:10d:c0a8:1b::d) by mail.thefacebook.com (2620:10d:c0a8:83::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Fri, 21 Aug 2020 08:17:46 -0700 Received: by devvm1096.prn0.facebook.com (Postfix, from userid 111017) id 4859C3441053; Fri, 21 Aug 2020 08:01:35 -0700 (PDT) Smtp-Origin-Hostprefix: devvm From: Roman Gushchin <guro@fb.com> Smtp-Origin-Hostname: devvm1096.prn0.facebook.com To: <bpf@vger.kernel.org> CC: <netdev@vger.kernel.org>, Alexei Starovoitov <ast@kernel.org>, Daniel Borkmann <daniel@iogearbox.net>, <kernel-team@fb.com>, <linux-kernel@vger.kernel.org>, Johannes Weiner <hannes@cmpxchg.org>, Shakeel Butt <shakeelb@google.com>, <linux-mm@kvack.org>, Roman Gushchin <guro@fb.com>, Song Liu <songliubraving@fb.com> Smtp-Origin-Cluster: prn0c01 Subject: [PATCH bpf-next v4 07/30] bpf: refine memcg-based memory accounting for devmap maps Date: Fri, 21 Aug 2020 08:01:11 -0700 Message-ID: <20200821150134.2581465-8-guro@fb.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200821150134.2581465-1-guro@fb.com> References: <20200821150134.2581465-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-08-21_08:2020-08-21,2020-08-21 signatures=0 X-Proofpoint-Spam-Details: rule=fb_default_notspam policy=fb_default score=0 impostorscore=0 lowpriorityscore=0 malwarescore=0 adultscore=0 mlxlogscore=869 spamscore=0 clxscore=1015 bulkscore=0 mlxscore=0 priorityscore=1501 phishscore=0 suspectscore=13 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2008210143 X-FB-Internal: deliver X-Rspamd-Queue-Id: 462DF10097AA4 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam03 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> |
Series |
bpf: switch to memcg-based memory accounting
|
expand
|
On Fri, Aug 21, 2020 at 8:18 AM Roman Gushchin <guro@fb.com> wrote: > > Include map metadata and the node size (struct bpf_dtab_netdev) on > element update into the accounting. > > Signed-off-by: Roman Gushchin <guro@fb.com> > Acked-by: Song Liu <songliubraving@fb.com> Reviewed-by: Shakeel Butt <shakeelb@google.com>
diff --git a/kernel/bpf/devmap.c b/kernel/bpf/devmap.c index 10abb06065bb..05bf93088063 100644 --- a/kernel/bpf/devmap.c +++ b/kernel/bpf/devmap.c @@ -175,7 +175,7 @@ static struct bpf_map *dev_map_alloc(union bpf_attr *attr) if (!capable(CAP_NET_ADMIN)) return ERR_PTR(-EPERM); - dtab = kzalloc(sizeof(*dtab), GFP_USER); + dtab = kzalloc(sizeof(*dtab), GFP_USER | __GFP_ACCOUNT); if (!dtab) return ERR_PTR(-ENOMEM); @@ -603,7 +603,8 @@ static struct bpf_dtab_netdev *__dev_map_alloc_node(struct net *net, struct bpf_prog *prog = NULL; struct bpf_dtab_netdev *dev; - dev = kmalloc_node(sizeof(*dev), GFP_ATOMIC | __GFP_NOWARN, + dev = kmalloc_node(sizeof(*dev), + GFP_ATOMIC | __GFP_NOWARN | __GFP_ACCOUNT, dtab->map.numa_node); if (!dev) return ERR_PTR(-ENOMEM);