Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp69342pxu; Tue, 24 Nov 2020 19:05:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJyuAPxedZ/v7VQ4xfHK7mhzYHzhTq+PuOrk5xUvTaitxF9LwH4Tn41BzD11qFV9xccFOdS2 X-Received: by 2002:a17:906:2683:: with SMTP id t3mr1388210ejc.414.1606273539753; Tue, 24 Nov 2020 19:05:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606273539; cv=none; d=google.com; s=arc-20160816; b=s/qUPWx6EOSM0J3U8E3ysPWlQ71+qZ5hGViKKvSy6xKDL63LZiHQA7POAtUUAmRjTt QkEiX35ZVjAQvKYfJh7boOq3JyjxjqXmlKVHNXXGw/Nlqgtocvxgo5Tda4BvGsmgiNoW Y4VJ8LxCZ7o/YBca3b5zC8LoROjc3wkrCbvtOukoHhDW/FbJMgAuRZVdqUC3rWifzuFE YsKxsp20zfF6P+eT6wMFThwdfv/tjU1AgNVr0OGNSMhMoOQhv9P7CiR3GCq0CXKmwerG od1ZE6RJhop+4uAwMpcdYd2ccs1SIpwbFhd+lAE/81B+VGtFgyf2i82SrO6YnLjt4Oft hflw== 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=FBlMP3vkmjBpV4Cj/ZwYUzcA6JfufLS/KOYX6AWCiGM=; b=PWaMJuuiOfKpH18B6jvEmroLI8beJpcG0eL5s0B8ybdzVZEVOGVCytqxfJDA4pj/Pp QgQYypNbgPXySvvwG+ZoIPGPXjgXmOt+vowTNWqBRQ6uNPfLANy5bw/YPayWclMwNqJT aP4/+NfUhxmxA2yVAlVj4UIa/3uh2BtgUoZCpeXD13sFw9itD4OlqGPV/2EjtS9stLZN blj5GBteTac70W91USKUB+8oHExI+pEcOKllxPmLh2t1WuFGVFoDFjpwaBrqsVSxlIGF 4BlplZmPjPIqtpX5vozA8upqIwCGrghlfQcm8yo/4KIheBvHhFENMn5MOG5fHzEy3Qjw s8IQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=E9vw7Zh+; 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 w25si407612edu.498.2020.11.24.19.05.17; Tue, 24 Nov 2020 19:05:39 -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=E9vw7Zh+; 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 S1727466AbgKYDCr (ORCPT + 99 others); Tue, 24 Nov 2020 22:02:47 -0500 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:61482 "EHLO mx0b-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727435AbgKYDBe (ORCPT ); Tue, 24 Nov 2020 22:01:34 -0500 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 0AP2sY2h031124 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=FBlMP3vkmjBpV4Cj/ZwYUzcA6JfufLS/KOYX6AWCiGM=; b=E9vw7Zh+lSV8MsBxtIu2CluwQ09YWJoLuagmZRGZuDxunO52Ah+OgN1ESiGljogvsvsg RXgx9EG06hbfFKyqWRYasO4CFaC0g4hgw30cgBOe5rmmsQbj0KLlmZFj+G/k4fwz7f/n tnYP4y5eeLcyagIM4Guw5OlEO9TGVbEghCg= Received: from maileast.thefacebook.com ([163.114.130.16]) by mx0a-00082601.pphosted.com with ESMTP id 34ywv0u3ck-1 (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::f) 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:26 -0800 Received: by devvm3388.prn0.facebook.com (Postfix, from userid 111017) id 0915116A188F; Tue, 24 Nov 2020 19:01:22 -0800 (PST) From: Roman Gushchin To: CC: , , , , , , , Subject: [PATCH bpf-next v8 07/34] bpf: memcg-based memory accounting for bpf maps Date: Tue, 24 Nov 2020 19:00:52 -0800 Message-ID: <20201125030119.2864302-8-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 suspectscore=13 mlxlogscore=711 lowpriorityscore=0 mlxscore=0 phishscore=0 adultscore=0 bulkscore=0 clxscore=1015 impostorscore=0 spamscore=0 malwarescore=0 priorityscore=1501 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 This patch enables memcg-based memory accounting for memory allocated by __bpf_map_area_alloc(), which is used by many types of bpf maps for large memory allocations. Following patches in the series will refine the accounting for some of the map types. Signed-off-by: Roman Gushchin Acked-by: Song Liu --- 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 4154c616788c..4b514bb5cd70 100644 --- a/kernel/bpf/syscall.c +++ b/kernel/bpf/syscall.c @@ -281,7 +281,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