Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp45473ybg; Mon, 27 Jul 2020 15:08:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx0uSDbk4WyByCU/hk1BwyaLwyg7lfVlblYg/PIqmVh15bNUAwIxLlDSYhfqys7gw+Q58Vc X-Received: by 2002:a50:fd8d:: with SMTP id o13mr3700840edt.313.1595887731370; Mon, 27 Jul 2020 15:08:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595887731; cv=none; d=google.com; s=arc-20160816; b=OG7LmGywGr4sa3T9HrEGcNIkLCDCl2m+4HZT04Ztt3qXIwExgg5LCySncDClO5ckuL Xzz9oTKcY9Lx5rocmJSzgusDeCdJ8MJjDPOCeLqaBWW+adS8oN6K1xsfQCrdD6MiQX+/ bk/H0896rN+PEmcFqPaTCI+pVZxaZcEMXoF9qyD44YNu0x4U0jfkgiFqJq8QoclI7qjE AI1n3K/U89qfexG0FH1Nzyo2gsMpFl987X+VPgxLGX4NM6Q71Q4h0n+Nthlb8nW7PfNe COsi/y8NIzSK95soiKYZQtDTwrGzzqKrxhxXGhFWGrGq2PxElVajY8Jtc3SViN8fS+4H JOsw== 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=WuFdlm+CwCfC5jm4EAsuXY89WjDd91XAqsuAZzGK8mQ=; b=GzhnWCeyuKRGeJBfIQxTQ4O/XO+WQaF+7CQuTGM3BF8/ZOcg0Qq4hO/20Wcjz35j4e GXBF+kFwrxxZRs9NNIXCrouK84tGwBsJvhytPtG/eCN16Jce+8gpClji9tINQwekHqg+ rUwnJkb4r9J31bUjvC8CgPxHTJRYJrVCUWYuDNJoSS9J5NxhSUy/yvkhpCoLIg0eYLDQ lls71h5tRdlLbkH/x/iEikNZh6NxU5SqTIqRykMCQR2voJTiPLcyFbKgjIUqsLqr+Q2x p9LmVV5LLM/cnyMkAWJMj/S89hjJBuQ2F6fb0pVk3FjimhFL4eixibvAYSxYrxgh4ys6 XZlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=PAolxzQ2; 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 s22si6435978ejv.358.2020.07.27.15.08.28; Mon, 27 Jul 2020 15:08:51 -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=PAolxzQ2; 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 S1726981AbgG0WFX (ORCPT + 99 others); Mon, 27 Jul 2020 18:05:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53112 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726140AbgG0WFW (ORCPT ); Mon, 27 Jul 2020 18:05:22 -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 B61E6C061794; Mon, 27 Jul 2020 15:05:22 -0700 (PDT) Received: by mail-qk1-x743.google.com with SMTP id e13so16848044qkg.5; Mon, 27 Jul 2020 15:05:22 -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=WuFdlm+CwCfC5jm4EAsuXY89WjDd91XAqsuAZzGK8mQ=; b=PAolxzQ2iUlCuHDBs8UfBB7KdiLqoIOCLPfykpyhW6G8pTLvwaf47IXSCLLLhbwA+r iTQLd2XrTqDzqT/MGnYqcllM1gjEzX83ZnQSOqcn8wpyb7519Lpd7K53T916HgJRu1o8 pBs2pfSJikX/gZNpKGjcHPa13o2d8ivm9pFJV8ZtFeWqRe9dH+eXSD7bVhfnHUKxAaRc LM0nJXHqgzOx4YLYGtUCFIzag0H97fsliRyGf0qh/gBRSeFj+C7fyOChCsS1fWlrFkj6 WZhGuwm1XGEsvw+Bdm1zqaUGXj+7AG517MPCcP0zvs61uuBjK0kziHXi/1DpjkPB7SZ9 fuQw== 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=WuFdlm+CwCfC5jm4EAsuXY89WjDd91XAqsuAZzGK8mQ=; b=ZiEdKgNC2tz6TdCNZKNjEV/ILe4/vUa+6Lsxt4aAq8uPSW02/5jkEBV0/DCK72Hpj9 D3Xe2RpftwrL4MDCCaXn7Qp/5pGWi9I8Y/iS5LZ43LM7AUIZCgbW3/QjmCHZX1ZX2rKq VEM/C2k2VC/tpw7UFbhqE50lNGfC3zK5+tBQJBhfiQpI0kv/lbUTRdSYs7G13O5O+nt1 zJxLvGDjq0hiHhR7fzughdqFotHZEUMSwBOUNa4J/ePk7BNC2Ze/2cZNw7izuAPC0sse Fboqd3Wo29p9Oo9sl62AJ4SqwIaeUW4FJPpvme9rElJiTcyMPrzKKS0ssF/NUEydEBES 0Vlw== X-Gm-Message-State: AOAM530PiT4zjAgKc48tqDafB8W5vqTLeBqcAZUH0Itc0HpJFMTEMkdJ Yuvxkkcd486UHGXxG28GJtSgvNCiE+KtVsARgO4= X-Received: by 2002:a37:afc3:: with SMTP id y186mr5804406qke.36.1595887521999; Mon, 27 Jul 2020 15:05:21 -0700 (PDT) MIME-Version: 1.0 References: <20200727184506.2279656-1-guro@fb.com> <20200727184506.2279656-30-guro@fb.com> In-Reply-To: <20200727184506.2279656-30-guro@fb.com> From: Andrii Nakryiko Date: Mon, 27 Jul 2020 15:05:11 -0700 Message-ID: Subject: Re: [PATCH bpf-next v2 29/35] bpf: libbpf: cleanup RLIMIT_MEMLOCK usage 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: > > As bpf is not using memlock rlimit for memory accounting anymore, > let's remove the related code from libbpf. > > Bpf operations can't fail because of exceeding the limit anymore. > They can't in the newest kernel, but libbpf will keep working and supporting old kernels for a very long time now. So please don't remove any of this. But it would be nice to add a detection of whether kernel needs a RLIMIT_MEMLOCK bump or not. Is there some simple and reliable way to detect this from user-space? > Signed-off-by: Roman Gushchin > --- > tools/lib/bpf/libbpf.c | 31 +------------------------------ > tools/lib/bpf/libbpf.h | 5 ----- > 2 files changed, 1 insertion(+), 35 deletions(-) > [...]