Received: by 2002:a17:90b:8d0:0:0:0:0 with SMTP id ds16csp5078738pjb; Mon, 27 Jul 2020 12:21:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxMOswLKzGv2FOYx6FG0zZfaomxL4apPNUF0ZumWYmT6QXo4DCXMppipQ/GKZ1KfVLIbuhR X-Received: by 2002:a17:906:5657:: with SMTP id v23mr23052477ejr.196.1595877710418; Mon, 27 Jul 2020 12:21:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595877710; cv=none; d=google.com; s=arc-20160816; b=qg+j1CirC8DeTlOdvFvNKCl8h8f84JRZn10XwJbgCmfFuMXjFcgzfBHAW+yHW6XMvU 1lHE7o/LI16/KSh8YyJqi3EjC9lwzI4X3wSo8cmbwgc02S+JPVew+9+Dpn6vDjT+5FmX jKAbyN9xgmhA+21YVG3UWUI4wmEdT+Tb4DeAtEM+4Kk7+zhmJxkMIExYXx8ScTT+yWkD AaNHEw/LQLm1bF2auHJUUph7lQzcN2E4w+3HVc75lPxtyf00Pvc4jsL5j/zgiH22IEAO VLXly7ftLHAAoev1HsqjFCSxLmwc9jGAWpyFh3Hd2t1sk8nlvx83Wkrx/zvb7eYBZuAm TTyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:smtp-origin-cluster :cc:to:smtp-origin-hostname:from:smtp-origin-hostprefix :dkim-signature; bh=5A7xQ8yUotOKRnfcZBEJdE63ptjXDxYZrHs9LNGABV8=; b=RGR7Irbj5KtdYdy3T3Ha/PMA6RQc08Uh/W4EmqMOR3/6rmscSWpUrPsDlrZge2lUv1 vL7HnKfjF+SlPWaf2Nsslv2G+RaPy2Eq5VSmblCEApjCsa0CMkfGoDvYx3axDKIG5Z21 B8jTmjG4rBnDtf832WTJtFR4AHCEt+2azm/UnCJTJced4LgKyH5MAe8xTKFxTmYyMv5a aVl/qa/0WIl2UEW4RaUPf91iNmBFhJIDN2KdXH8eCO8whgUFdT7pXi0uyNinU6Gkw6JX yG0tHMl6LALtbfBZ/q5exwHZnQrR1bW3RwOjf7L9itdU3JdSed2PvFC9D0/s3yY4KVgo yMCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=VHz399uz; 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 p2si6294524edy.558.2020.07.27.12.21.28; Mon, 27 Jul 2020 12:21:50 -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=@fb.com header.s=facebook header.b=VHz399uz; 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 S1732237AbgG0SqM (ORCPT + 99 others); Mon, 27 Jul 2020 14:46:12 -0400 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:19346 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732152AbgG0Sp7 (ORCPT ); Mon, 27 Jul 2020 14:45:59 -0400 Received: from pps.filterd (m0109333.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 06RIjrlC021092 for ; Mon, 27 Jul 2020 11:45:58 -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=VHz399uzvaBVTQ6ul97MJYCN/ANduu3k4+eFX3jHd/rUkt08oF1eBA6aK1kAOLD9JlDn MRmYBc8GGC8kH1b0+3zZPOOG6lX8krWu+OqWp96/EOOYST2+iHPAkvkGJK363d509l4p LyLR6624uGMbKFzHdVl25F1SFYIaz/g1d6g= Received: from maileast.thefacebook.com ([163.114.130.16]) by mx0a-00082601.pphosted.com with ESMTP id 32h4ed5u84-9 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Mon, 27 Jul 2020 11:45:58 -0700 Received: from intmgw002.41.prn1.facebook.com (2620:10d:c0a8:1b::d) by mail.thefacebook.com (2620:10d:c0a8:82::f) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Mon, 27 Jul 2020 11:45:27 -0700 Received: by devvm1096.prn0.facebook.com (Postfix, from userid 111017) id 938651DAFE75; Mon, 27 Jul 2020 11:45:10 -0700 (PDT) Smtp-Origin-Hostprefix: devvm From: Roman Gushchin Smtp-Origin-Hostname: devvm1096.prn0.facebook.com To: CC: , Alexei Starovoitov , Daniel Borkmann , , , Roman Gushchin Smtp-Origin-Cluster: prn0c01 Subject: [PATCH bpf-next v2 02/35] bpf: memcg-based memory accounting for bpf maps Date: Mon, 27 Jul 2020 11:44:33 -0700 Message-ID: <20200727184506.2279656-3-guro@fb.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200727184506.2279656-1-guro@fb.com> References: <20200727184506.2279656-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-27_13:2020-07-27,2020-07-27 signatures=0 X-Proofpoint-Spam-Details: rule=fb_default_notspam policy=fb_default score=0 mlxscore=0 priorityscore=1501 spamscore=0 lowpriorityscore=0 impostorscore=0 adultscore=0 bulkscore=0 malwarescore=0 phishscore=0 clxscore=1015 suspectscore=13 mlxlogscore=728 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2007270127 X-FB-Internal: deliver Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- kernel/bpf/syscall.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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. */ =20 - const gfp_t gfp =3D __GFP_NOWARN | __GFP_ZERO; + const gfp_t gfp =3D __GFP_NOWARN | __GFP_ZERO | __GFP_ACCOUNT; unsigned int flags =3D 0; unsigned long align =3D 1; void *area; --=20 2.26.2