From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexei Starovoitov Subject: Re: [PATCH bpf-next] tools/bpf: adjust rlimit RLIMIT_MEMLOCK for test_dev_cgroup Date: Wed, 20 Dec 2017 19:21:41 -0800 Message-ID: <20171221032139.i3he3hus2noc2lkl@ast-mbp> References: <20171220183708.2334406-1-yhs@fb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: ast@fb.com, daniel@iogearbox.net, guro@fb.com, netdev@vger.kernel.org, kernel-team@fb.com To: Yonghong Song Return-path: Received: from mail-pl0-f65.google.com ([209.85.160.65]:44831 "EHLO mail-pl0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756134AbdLUDVq (ORCPT ); Wed, 20 Dec 2017 22:21:46 -0500 Received: by mail-pl0-f65.google.com with SMTP id n13so10243882plp.11 for ; Wed, 20 Dec 2017 19:21:46 -0800 (PST) Content-Disposition: inline In-Reply-To: <20171220183708.2334406-1-yhs@fb.com> Sender: netdev-owner@vger.kernel.org List-ID: On Wed, Dec 20, 2017 at 10:37:08AM -0800, Yonghong Song wrote: > The default rlimit RLIMIT_MEMLOCK is 64KB. In certain cases, > e.g. in a test machine mimicking our production system, this test may > fail due to unable to charge the required memory for prog load: > > $ ./test_dev_cgroup > libbpf: load bpf program failed: Operation not permitted > libbpf: failed to load program 'cgroup/dev' > libbpf: failed to load object './dev_cgroup.o' > Failed to load DEV_CGROUP program > ... > > Changing the default rlimit RLIMIT_MEMLOCK to unlimited > makes the test pass. > > This patch also fixed a problem where when bpf_prog_load fails, > cleanup_cgroup_environment() should not be called since > setup_cgroup_environment() has not been invoked. Otherwise, > the following confusing message will appear: > ... > (/home/yhs/local/linux/tools/testing/selftests/bpf/cgroup_helpers.c:95: > errno: No such file or directory) Opening Cgroup Procs: /mnt/cgroup.procs > ... > > Signed-off-by: Yonghong Song Applied, Thanks Yonghong.