Message ID | 20200725000410.3566700-3-guro@fb.com |
---|---|
State | Changes Requested |
Delegated to: | BPF Maintainers |
Headers | show
Return-Path: <bpf-owner@vger.kernel.org> X-Original-To: incoming-bpf@patchwork.ozlabs.org Delivered-To: patchwork-incoming-bpf@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=bpf-owner@vger.kernel.org; receiver=<UNKNOWN>) Authentication-Results: ozlabs.org; dmarc=pass (p=reject dis=none) header.from=fb.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=fb.com header.i=@fb.com header.a=rsa-sha256 header.s=facebook header.b=ShrEL8UO; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4BD5sX1gZpz9sRW for <incoming-bpf@patchwork.ozlabs.org>; Sat, 25 Jul 2020 10:04:32 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726968AbgGYAEa (ORCPT <rfc822;incoming-bpf@patchwork.ozlabs.org>); Fri, 24 Jul 2020 20:04:30 -0400 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:58548 "EHLO mx0b-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726915AbgGYAEa (ORCPT <rfc822;bpf@vger.kernel.org>); Fri, 24 Jul 2020 20:04:30 -0400 Received: from pps.filterd (m0109331.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 06ONmvQJ013431 for <bpf@vger.kernel.org>; Fri, 24 Jul 2020 17:04:29 -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=5A7xQ8yUotOKRnfcZBEJdE63ptjXDxYZrHs9LNGABV8=; b=ShrEL8UO2kexo3wpmMlYSPJchkgCBQbGua1G1l6Yd+GshtsLLcdcSaCw1gFqxq9nRRwB 5HxUPG8bUFm0upYE4WOtnpIVEY1w90zj0OKq2QLk5HS0T+mSrah48fA8yjvYQ7E9oCgN NcfAFIgqOxC3J1s8BjIVcdqrIixxj42dHYA= Received: from maileast.thefacebook.com ([163.114.130.16]) by mx0a-00082601.pphosted.com with ESMTP id 32embcegm6-5 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for <bpf@vger.kernel.org>; Fri, 24 Jul 2020 17:04:29 -0700 Received: from intmgw003.06.prn3.facebook.com (2620:10d:c0a8:1b::d) by mail.thefacebook.com (2620:10d:c0a8:82::d) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Fri, 24 Jul 2020 17:04:27 -0700 Received: by devvm1096.prn0.facebook.com (Postfix, from userid 111017) id B3F431B35A6E; Fri, 24 Jul 2020 17:04:26 -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>, Roman Gushchin <guro@fb.com> Smtp-Origin-Cluster: prn0c01 Subject: [PATCH bpf-next 02/35] bpf: memcg-based memory accounting for bpf maps Date: Fri, 24 Jul 2020 17:03:37 -0700 Message-ID: <20200725000410.3566700-3-guro@fb.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200725000410.3566700-1-guro@fb.com> References: <20200725000410.3566700-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-07-24_10:2020-07-24,2020-07-24 signatures=0 X-Proofpoint-Spam-Details: rule=fb_default_notspam policy=fb_default score=0 bulkscore=0 mlxlogscore=712 impostorscore=0 clxscore=1015 priorityscore=1501 lowpriorityscore=0 adultscore=0 phishscore=0 mlxscore=0 suspectscore=13 spamscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2007240164 X-FB-Internal: deliver Sender: bpf-owner@vger.kernel.org Precedence: bulk List-ID: <bpf.vger.kernel.org> X-Mailing-List: bpf@vger.kernel.org |
Series |
bpf: switch to memcg-based memory accounting
|
expand
|
diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c index ee290b1f2d9e..501b2c071d7b 100644 --- a/kernel/bpf/syscall.c +++ b/kernel/bpf/syscall.c @@ -275,7 +275,7 @@ static void *__bpf_map_area_alloc(u64 size, int numa_node, bool mmapable) * __GFP_RETRY_MAYFAIL to avoid such situations. */ - const gfp_t gfp = __GFP_NOWARN | __GFP_ZERO; + const gfp_t gfp = __GFP_NOWARN | __GFP_ZERO | __GFP_ACCOUNT; unsigned int flags = 0; unsigned long align = 1; void *area;
This patch enables memcg-based memory accounting for memory allocated by __bpf_map_area_alloc(), which is used by most map types for large allocations. Following patches in the series will refine the accounting for some map types. Signed-off-by: Roman Gushchin <guro@fb.com> --- kernel/bpf/syscall.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)