Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp44909ybg; Mon, 27 Jul 2020 22:57:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw3mdpQP10xpBKDvt9l/H73p4Dj3DERt5QLgpel7Kwws3EXVyAXxJw6UfJ6wTYIAEpzqNLb X-Received: by 2002:a17:906:9147:: with SMTP id y7mr22610979ejw.399.1595915840330; Mon, 27 Jul 2020 22:57:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595915840; cv=none; d=google.com; s=arc-20160816; b=0B2NIf0oGopCE1MUIKw8aVvMXuD8vTubfb1f79gaLOnvd7y/0RA95q2NbkHbWxqGM4 f6hRGrmpjLkJCo5ICF0/AboquZhhjT9YPyVY3c75DIswa5wzOBS4xFwbp108H6hrgyeo GV+F0cflqhB2ampPbcG6Iu4QiXpw/T2j8uZlGiyZ6p3sOm732/64R+xaZ0Hp0GdzVVlx svEbTGmypSHss1NFN68aOrGUQy9lf21EjmrAowddTd7tTqg9wMY51cSAMgI54MtBWrWE oFf1iFwUvbMvNp2Apf5mJtMEe9AEaddLHyVhICDTBPRWiNyvYX1nqjtexKDyKKW6smws 3vrQ== 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=I1D29EvPhH9GH6nvHnSp01YykbMFZQx9+YLWCGyLdqw=; b=HufrhmfE9AJV5ArD+uZ+NSOdKscONv9MfyqJ1N8waY0B+1pxXJYO7iyMnkcnCDgTfP JiUzc3JHv6+aKZlz5IRZH2jyCra86S5AXAhJt+8Ev84ryfT9wQu1F0Rn0GmrUshNP1ui ocr7pps7LrSiZvkuveTi/oJehptSaCi6tFWd39Fejf2wUwmqPe5TwQpqLtO5dAaCmWQq YeTZC7k0j0EYvp/GGRyAkGswqh5Pm8vxh2ymGHQDoRz7mVLMdHgtlnzR1lTJEWU3pAgu OAaUSTibTpqTTMiHcn09e/DUV3LvuliVQ61TCUo7tmledhudIDsnp5YwxTtbHNsEq5vl enig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="L/biUkUn"; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a6si5502620edr.403.2020.07.27.22.56.58; Mon, 27 Jul 2020 22:57:20 -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=@gmail.com header.s=20161025 header.b="L/biUkUn"; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727079AbgG1F4d (ORCPT + 99 others); Tue, 28 Jul 2020 01:56:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40854 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726615AbgG1F4d (ORCPT ); Tue, 28 Jul 2020 01:56:33 -0400 Received: from mail-qk1-x743.google.com (mail-qk1-x743.google.com [IPv6:2607:f8b0:4864:20::743]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4D093C061794; Mon, 27 Jul 2020 22:56:33 -0700 (PDT) Received: by mail-qk1-x743.google.com with SMTP id h7so17632213qkk.7; Mon, 27 Jul 2020 22:56:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=I1D29EvPhH9GH6nvHnSp01YykbMFZQx9+YLWCGyLdqw=; b=L/biUkUnaM/TOxASLMEbQgs/ELj7a1YXI+5e94wJViaZY/0F173yiL15XqaQmGhW/D 6KJKfDxe14HwLmHwXVGIlvfhUxSxOECBgX3J8mYi7hN/4b5k6Fl+IVN/Vh8ZOUrZbgrR tUxTdb9byycAhcl8HMrBmqScsI3yYEymTJVvwVZLYVVw1K4NOMV99uthoWdWJCQNrrYV 56e/gEhboHqN9XU3P5qO0+VqqtdwWDmLUeVI0xu038Aqw3fXkVy5DRvfiF9Pl1m3H20n rSleFuaTAn6B/BxkJ9jp5CKRz7k1fDPrYtYEEjWwdBuTDkNngpvq0uRyV7r3+YgMjNaD FBDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=I1D29EvPhH9GH6nvHnSp01YykbMFZQx9+YLWCGyLdqw=; b=cFSdtVXjjYCJnI8KFZn8b2y8NpKUyWUUzgWK/7FFcdZMLucAnFVB30NdgvSDVMwPgU NT6mFlNbB6i7Js3K6aSrNnq1qiQ58nkV416hFQ8hmoPnTCQ6VQmjPB4442io9E9OtsoM xnCqzl46tAugpl6xtj7VPj8V78XixbxfDLnoVrkizp7BcBdlc5qqCPdFdEpsh7AWXxw9 xSyL21DbUZ52w/zkt28Zj/3pSyNrKY2d7KP28xzSS4jNF1eT8C73AbUFPATkoglvK4nb rUQ9GASMEqqdLdALLX8EA9MV68wHo+ROzuZKIL0B0k7uqQhqHTsqRyQd6VwXrVucWq6R c/+w== X-Gm-Message-State: AOAM531P1WXq+ekIZARFPU5G1RcgUP/zeT1pBe5lutICSL/S7DXR/aez eq61m4tVHLoDd0Qfrz00gAghOjvDUnYebbRUTzw= X-Received: by 2002:a37:afc3:: with SMTP id y186mr7209799qke.36.1595915792506; Mon, 27 Jul 2020 22:56:32 -0700 (PDT) MIME-Version: 1.0 References: <20200727184506.2279656-1-guro@fb.com> <20200727184506.2279656-23-guro@fb.com> In-Reply-To: <20200727184506.2279656-23-guro@fb.com> From: Andrii Nakryiko Date: Mon, 27 Jul 2020 22:56:21 -0700 Message-ID: Subject: Re: [PATCH bpf-next v2 22/35] bpf: eliminate rlimit-based memory accounting for bpf ringbuffer To: Roman Gushchin Cc: 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 12:21 PM Roman Gushchin wrote: > > Do not use rlimit-based memory accounting for bpf ringbuffer. > It has been replaced with the memcg-based memory accounting. > > bpf_ringbuf_alloc() can't return anything except ERR_PTR(-ENOMEM) > and a valid pointer, so to simplify the code make it return NULL > in the first case. This allows to drop a couple of lines in > ringbuf_map_alloc() and also makes it look similar to other memory > allocating function like kmalloc(). > > Signed-off-by: Roman Gushchin > --- LGTM. Acked-by: Andrii Nakryiko > kernel/bpf/ringbuf.c | 24 ++++-------------------- > 1 file changed, 4 insertions(+), 20 deletions(-) > [...]