Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp47462ybg; Mon, 27 Jul 2020 23:02:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxxulNR7B+IPifrPJRTF2f9UfizPE9kdHLActQ1fw8yc03lHmj7Ytd5/RI445FfRcaVYJNi X-Received: by 2002:a17:906:c0d9:: with SMTP id bn25mr23684899ejb.176.1595916153948; Mon, 27 Jul 2020 23:02:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595916153; cv=none; d=google.com; s=arc-20160816; b=mZUBygUEqIb4KpIM9Ubqp9IP7neOycpIkUSylMSEa2ZWX/mwuvIsoO0un+8/dA8m5p y7aJRAFHyKM7prf+OyB41fB2QTNMeQHC5JIflUNSV6DOxyix14ACuZzoufx1LR7AETxb XxeqAbaPxIwHtoN4npQLMJI2KIBnEjvzzeS39yWtgGdk1J43PF3+SbhUFlOrQxDwoz4V /r4aC5vhV6nrLKj0hkJPeXQCfytSCmbpMnctZ9ixngpuZqH9w3n14X8PrGTHXRntWIBy TrSyDeKt6NxGBw4brCDF309J/1BXuqBCeedLkkHsl//zZ46/KPCHWDuV8os8LGN1NT/T l5Fw== 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=wTdlg95ZXA4TOgFXjgtc+n7E+T+5B9dQx/aSYFnHSfI=; b=ah0Da821Wt038QvOmt1MJQhQGi1S3bxRlIYPGzd+nvUYPq7nInXIFMAROucQzuOe+s 6sxy5yLLQuw+2kV/voc+geSFiK8KQGRtZ4jTualEq4DOLLktFA7HMa/lFHtKvPboD6r8 vLWg2+l2f4rhasPH9Qo0QbS9ONnw2aklbKBHkzPYxZ4tw72Wgpc4uc3aD2B6kiB95bIO iUpfNkc9qCuX/IvS1KKVIMDl5Yf3RlLNptIK6Zzx8IHUCLoH3GWqOLayi7Gm/RA0S/KG yQlIR5auSLxUIIBnoPLcAGh/5d6LQTHCUiPmOXiggzZYF3tFoTtkbPdKtmapjJi9J6jT A1+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=i8ALjci8; 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 d23si6960965edz.176.2020.07.27.23.02.11; Mon, 27 Jul 2020 23:02:33 -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=i8ALjci8; 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 S1726971AbgG1F7p (ORCPT + 99 others); Tue, 28 Jul 2020 01:59:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41346 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726821AbgG1F7o (ORCPT ); Tue, 28 Jul 2020 01:59:44 -0400 Received: from mail-qv1-xf43.google.com (mail-qv1-xf43.google.com [IPv6:2607:f8b0:4864:20::f43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AED64C061794; Mon, 27 Jul 2020 22:59:44 -0700 (PDT) Received: by mail-qv1-xf43.google.com with SMTP id r19so146527qvw.11; Mon, 27 Jul 2020 22:59:44 -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=wTdlg95ZXA4TOgFXjgtc+n7E+T+5B9dQx/aSYFnHSfI=; b=i8ALjci8bEtI5Kdl1vA8f/CZ8e3VOIZMgU3kxLr1qUQx6fwap0HFd48p/VQgVtNazW u7Zk0ZtOuHCJtA3gZzhMEpDdMfPPhwFmNjbSfFgmu7LE3hq1FPvlyqEzh86RBBPZ6ryF 8FnNOnY6bc37h/U1fgIJXj8RaYJdPz74csFUqBgmgFreU/WUMD3709uchus5jUU1yKJL SOQ/djnxHCUowWA1uLApIYJnJ0elXu/iwTZfw5+UlFPD9PYOX6ZNtIfqRktcOcg425Gf KvvGX6np7Eu6STOjBJiENi8UV2HMw4ogOS+DarcDUrw7AHKPepO9qE6GvtLtNRHtJNqz vQ4Q== 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=wTdlg95ZXA4TOgFXjgtc+n7E+T+5B9dQx/aSYFnHSfI=; b=RVDe+rdxZhsO3gxrNsEcuQWBpjHZ+YFTGHFQkBhnWQADrCon3/fdMkUI//rd8hYmmD 8cgHxgL+T5BrbhX074cbhMmk1d+1EpvxeIvV/DYiGbYM9bAQm00ekNYj+jMfHbAgm7Go iww6/w1fnck7iISQ/UeNsEBne7QD79pC/2CnFyjhO3liUOQsNIS4YbOKqdZYYonlHTpF urQzOLTe2W4y7Zpl3B9HGgV43DfjdpfknSgCvL6ogz+bpGku/rkO+xggOkOypWl0lZLQ XlBivuAiFHUXjM6exkWQ6bwvyuKJLJpypxJN8ekB9kmIMTkh+sQeX1OEH6OJin3Uvsyn nD0Q== X-Gm-Message-State: AOAM532Vl+oYR23C/5jXD8OC3grM/71nB9Pe2Ca6kuZ/6pNYnvrNWUZ+ Vx25ScO5dw+7QSvPpeq6rPzE0i6QtihuUQoG+DY= X-Received: by 2002:ad4:4645:: with SMTP id y5mr26753304qvv.163.1595915983996; Mon, 27 Jul 2020 22:59:43 -0700 (PDT) MIME-Version: 1.0 References: <20200727184506.2279656-1-guro@fb.com> <20200727184506.2279656-30-guro@fb.com> <20200727231538.GA352883@carbon.DHCP.thefacebook.com> In-Reply-To: <20200727231538.GA352883@carbon.DHCP.thefacebook.com> From: Andrii Nakryiko Date: Mon, 27 Jul 2020 22:59:33 -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 4:15 PM Roman Gushchin wrote: > > On Mon, Jul 27, 2020 at 03:05:11PM -0700, Andrii Nakryiko wrote: > > 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. > > Yeah, good point, agree. > So we just can drop this patch from the series, no other changes > are needed. > > > > > 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? > > Hm, the best idea I can think of is to wait for -EPERM before bumping. > We can in theory look for the presence of memory.stat::percpu in cgroupfs, > but it's way to cryptic. > As I just mentioned on another thread, checking fdinfo's "memlock: 0" should be reliable enough, no? > Thanks!