Message ID | 20220810151840.16394-3-laoar.shao@gmail.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0EB3DC00140 for <linux-mm@archiver.kernel.org>; Wed, 10 Aug 2022 15:18:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 80A026B0073; Wed, 10 Aug 2022 11:18:49 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 792366B0074; Wed, 10 Aug 2022 11:18:49 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5EC876B0075; Wed, 10 Aug 2022 11:18:49 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 43E506B0073 for <linux-mm@kvack.org>; Wed, 10 Aug 2022 11:18:49 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 1C5FF4140C for <linux-mm@kvack.org>; Wed, 10 Aug 2022 15:18:49 +0000 (UTC) X-FDA: 79784040378.01.4D8DA65 Received: from mail-pj1-f46.google.com (mail-pj1-f46.google.com [209.85.216.46]) by imf10.hostedemail.com (Postfix) with ESMTP id AA6A8C0177 for <linux-mm@kvack.org>; Wed, 10 Aug 2022 15:18:48 +0000 (UTC) Received: by mail-pj1-f46.google.com with SMTP id q7-20020a17090a7a8700b001f300db8677so2420740pjf.5 for <linux-mm@kvack.org>; Wed, 10 Aug 2022 08:18:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=0qneriZlJB8MgUasF3oViKnlhzvyQw+rN/9EeLAKF4M=; b=TgGNLJw+BG2sALPoudkYDLIisbvrlTy7Epjw7sJucu8XOeUAww+Zrw5V/QbGPxzlU7 6vC7+2w+TOmeVTZFe11FTHUd6TscOL6cLwB9twxvsid65cnQwY8QMvDPU5RlAs5w5HG/ LDWjih8myCE17+PiotdM4circp79KSLTaDGRicB+ncaRWmUNgnvxzFIj6Omvt/VulW+O 5GrPcLdp1iuxBHPNCMPXiquLzESc2ppKZzn+UGYo0S2ZK2dwURl1qiO6jYgKilJZCn0r bu5f1sV2rCaGn6uVYMsZMOdgjocRuH/r+Cvd4ueX2q8A67notVve/t7FCBdKT6pXOk5s t7mA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=0qneriZlJB8MgUasF3oViKnlhzvyQw+rN/9EeLAKF4M=; b=qAnPPnMvndxVSQc/nu3H11tlXUPME1glXDuEUtQFx7CEZH83jaNyL06Z53WeiXjn8j r8yGTfYdngVhV7BvyIIs5Bb/RZC/2Q6XIw8TDy6hGa0YCInLytJVI4eK0tqtwV0o4CCw /Wln3EcvGoRO6zH4eoJAxb9Ff7J3x9fpkTRNVejtD9jju8cM16oQ7Roco2GXHJBdMtO5 i8uAGUPVs+2soYO1xPx7ZZO0tHwNz9hGjeEbMV4FUj2/qYR/dA7RJhq9CWlexm0RWGTI LzNpLRsPRcMzs26GVdEedVMg8pyPp+Mkib+qFFSmLbNvELg3+E/mjR7U2O0RmY+krr6e 1gvQ== X-Gm-Message-State: ACgBeo0q4siLiDXXqsxsNRHFjW64MiSknX8LmGQb8tSxbWRNqxb1LxHo xYm1J+OKuC25feTmn0XIsoA= X-Google-Smtp-Source: AA6agR4d1Bxd/15ISidjIj+TY1Sb3aM1iWdWnxazQxG6tDo5K9JirOOAXyUItlqAGwtIQ5VXLWdDRg== X-Received: by 2002:a17:902:7d89:b0:16e:f604:31b8 with SMTP id a9-20020a1709027d8900b0016ef60431b8mr28284781plm.0.1660144727674; Wed, 10 Aug 2022 08:18:47 -0700 (PDT) Received: from vultr.guest ([2001:19f0:6001:5c3e:5400:4ff:fe19:c3bc]) by smtp.gmail.com with ESMTPSA id 85-20020a621558000000b0052b6ed5ca40sm2071935pfv.192.2022.08.10.08.18.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Aug 2022 08:18:46 -0700 (PDT) From: Yafang Shao <laoar.shao@gmail.com> To: ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, kafai@fb.com, songliubraving@fb.com, yhs@fb.com, john.fastabend@gmail.com, kpsingh@kernel.org, sdf@google.com, haoluo@google.com, jolsa@kernel.org, hannes@cmpxchg.org, mhocko@kernel.org, roman.gushchin@linux.dev, shakeelb@google.com, songmuchun@bytedance.com, akpm@linux-foundation.org Cc: netdev@vger.kernel.org, bpf@vger.kernel.org, linux-mm@kvack.org, Yafang Shao <laoar.shao@gmail.com> Subject: [PATCH bpf-next 02/15] bpf: Use bpf_map_area_free instread of kvfree Date: Wed, 10 Aug 2022 15:18:27 +0000 Message-Id: <20220810151840.16394-3-laoar.shao@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220810151840.16394-1-laoar.shao@gmail.com> References: <20220810151840.16394-1-laoar.shao@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1660144728; a=rsa-sha256; cv=none; b=nS7MD5jwL4s7smVKuHEmwtuFI4HgPgKCR+zSU1rtZPd0pgQyasQMk0NY8ddT+cl74iJH1t aOo85xal0ae/sxw0NqWn7DYOiXLi5rEU7sh6vLQcHHFJBWyqzFguu0sC3OOrmqYzNNJmTi QR3nVggHojNUk1SYQBemVnBYkUWx7nU= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=TgGNLJw+; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf10.hostedemail.com: domain of laoar.shao@gmail.com designates 209.85.216.46 as permitted sender) smtp.mailfrom=laoar.shao@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1660144728; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=0qneriZlJB8MgUasF3oViKnlhzvyQw+rN/9EeLAKF4M=; b=36ShdX7Yail3ExOegOJU3/D5vjeVGg1b7BxpU4O7JVd/lghGZGoivLS69vQZwfBfLXKAgY 8Fh6qTTCcQlWIX/lp27D8u8qPdeSq8LuE8pJZsYTUNmcc1EVlkA03fEBMBQEacR+zNWVcA 8bdIt8+OtAwqnvHPY+8l/SISz7QVIs8= Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=TgGNLJw+; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf10.hostedemail.com: domain of laoar.shao@gmail.com designates 209.85.216.46 as permitted sender) smtp.mailfrom=laoar.shao@gmail.com X-Rspam-User: X-Stat-Signature: ppkique4g889zfgqmybffafy8htmsuyr X-Rspamd-Queue-Id: AA6A8C0177 X-Rspamd-Server: rspam03 X-HE-Tag: 1660144728-726648 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: Introduce selectable memcg for bpf map
|
expand
|
diff --git a/kernel/bpf/ringbuf.c b/kernel/bpf/ringbuf.c index ded4fae..3fb54fe 100644 --- a/kernel/bpf/ringbuf.c +++ b/kernel/bpf/ringbuf.c @@ -116,7 +116,7 @@ static struct bpf_ringbuf *bpf_ringbuf_area_alloc(size_t data_sz, int numa_node) err_free_pages: for (i = 0; i < nr_pages; i++) __free_page(pages[i]); - kvfree(pages); + bpf_map_area_free(pages); return NULL; } @@ -190,7 +190,7 @@ static void bpf_ringbuf_free(struct bpf_ringbuf *rb) vunmap(rb); for (i = 0; i < nr_pages; i++) __free_page(pages[i]); - kvfree(pages); + bpf_map_area_free(pages); } static void ringbuf_map_free(struct bpf_map *map)
bpf_map_area_alloc() should be paired with bpf_map_area_free(). Signed-off-by: Yafang Shao <laoar.shao@gmail.com> --- kernel/bpf/ringbuf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)