Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp51131ybg; Mon, 27 Jul 2020 23:08:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwIhI5i7bkwStsTFYg1e6mEME+h9BoZDHW//BqnW2xSwnXnfXYq1uP2CXdJmS5+aj0GpPb7 X-Received: by 2002:a17:906:3842:: with SMTP id w2mr24837123ejc.273.1595916517250; Mon, 27 Jul 2020 23:08:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595916517; cv=none; d=google.com; s=arc-20160816; b=QTUc/SBar6mOaaxHwVGN+lzBs9dfpS7g8KI8UFK3VhhndI+xUnQ2q4OZO+xNu2GyHc v+1yvpRDJmc3y8MobU0v4B3MOSC/eIPOHcppk9lCfxJDjoLRQeyj/65X727e6wG2vPB/ yZGz8dkFaUce4Ngtyz08DWEpZHIjqzAWQ0T58yuN4d/Q7B19weM6dKYoE2MFgzTh7acg /A4g7pc3qaPPE5+m9rQFIdWntaoV0r7v0b6Ya/VFvn2OTe8Tddtlh5ZCrzqT2VdQfi+3 ba3EYC9RkhZ04+pNojrDjf+5UuXG90rpKmWS/Wfe4JgkITpdAG1zPVqPPGpVchWqSp4w ocDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=GXIKEnuVJB6fSzBiqKMkP23b4tyQUqWsYVdzGZcDHgA=; b=vwenn3svWBMeJBwYvA5dyj72jPwB5PgE+KHxKdwuGMpvf5FLCGEQAgoj1n9PI/L1kU 36jSwvcC2xKLp5Y2FuVGEQcQUW+B3mMPx0cbGX8k1yLO0NgvOTIZDgr1R98hl86p6ejS B/C1Yy3Eq7rxjwfM0g6F1h1wrffNTXouKoaoeLt95nB0N6hO6nUUfWQ2TDhpnPv3Xjl3 G3QZ9xKoQ/PB7eyonwqWEvSD7eDshpmPwgEHZ+f5HorcBzVA6osxJ31uTVD1N/3PahE5 JWi76t8Gd5k6syr7wgaltFBL+eEeAhltXfgXt8pvbI8hxQMODBkdF6++N9Ce7WjdW0Wl COPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=0KS7ViZq; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l7si7106648edv.475.2020.07.27.23.08.14; Mon, 27 Jul 2020 23:08:37 -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=@kernel.org header.s=default header.b=0KS7ViZq; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727909AbgG1GG4 (ORCPT + 99 others); Tue, 28 Jul 2020 02:06:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:54032 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726863AbgG1GG4 (ORCPT ); Tue, 28 Jul 2020 02:06:56 -0400 Received: from mail-lj1-f179.google.com (mail-lj1-f179.google.com [209.85.208.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 93BCD21744; Tue, 28 Jul 2020 06:06:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595916415; bh=n0RZjzOmFv1P1B9VBOEM+8Yp9qeHrah7p8zJn6BDskY=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=0KS7ViZq+31IYo7bzL4k6zQ9QAfIBNj3DnN1zRJyIK20utz8y7decsTMTB6/Ze3mG uWoTzmltY5/CRZFyOXbDwQ/eGs/PmIoLNF+bb6SLTGpObXzYzgw1D9rcURquAlDuhC OShvMRxvzxdJSNwxXSk4grtTTvcB7TbDAQY/8zCE= Received: by mail-lj1-f179.google.com with SMTP id q7so19830176ljm.1; Mon, 27 Jul 2020 23:06:55 -0700 (PDT) X-Gm-Message-State: AOAM530ooCyb4jWqU1zFwCz7IqriYlTX5Ef0Z+iTqnR5xjKsrDbVliuD Vyt68yFY+SRKYXZILJnhSjU3WQRrOytcG3EqREU= X-Received: by 2002:a2e:7c14:: with SMTP id x20mr11847298ljc.41.1595916413870; Mon, 27 Jul 2020 23:06:53 -0700 (PDT) MIME-Version: 1.0 References: <20200727184506.2279656-1-guro@fb.com> <20200727184506.2279656-28-guro@fb.com> In-Reply-To: From: Song Liu Date: Mon, 27 Jul 2020 23:06:42 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH bpf-next v2 27/35] bpf: eliminate rlimit-based memory accounting infra for bpf maps To: Andrii Nakryiko Cc: Roman Gushchin , bpf , Networking , Alexei Starovoitov , Daniel Borkmann , Kernel Team , open list Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 27, 2020 at 10:58 PM Andrii Nakryiko wrote: > > On Mon, Jul 27, 2020 at 10:47 PM Song Liu wrote: > > > > On Mon, Jul 27, 2020 at 12:26 PM Roman Gushchin wrote: > > > > > > Remove rlimit-based accounting infrastructure code, which is not used > > > anymore. > > > > > > Signed-off-by: Roman Gushchin > > [...] > > > > > > static void bpf_map_put_uref(struct bpf_map *map) > > > @@ -541,7 +484,7 @@ static void bpf_map_show_fdinfo(struct seq_file *m, struct file *filp) > > > "value_size:\t%u\n" > > > "max_entries:\t%u\n" > > > "map_flags:\t%#x\n" > > > - "memlock:\t%llu\n" > > > + "memlock:\t%llu\n" /* deprecated */ > > > > I am not sure whether we can deprecate this one.. How difficult is it > > to keep this statistics? > > > > It's factually correct now, that BPF map doesn't use any memlock memory, no? I am not sure whether memlock really means memlock for all users... I bet there are users who use memlock to check total memory used by the map. > > This is actually one way to detect whether RLIMIT_MEMLOCK is necessary > or not: create a small map, check if it's fdinfo has memlock: 0 or not > :) If we do show memlock=0, this is a good check... Thanks, Song