Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp450324pxb; Wed, 18 Aug 2021 06:14:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxVHmAM+SSkSYftFNU7gh8UdeaMSTgfm1/d9d8nTy533NFjxqZTDiQc5cNM/JIdbrgKItRU X-Received: by 2002:a02:1942:: with SMTP id b63mr7920666jab.111.1629292486549; Wed, 18 Aug 2021 06:14:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629292486; cv=none; d=google.com; s=arc-20160816; b=YXwybdV2F3EmnLS0TmDjOZ9gbJpyx0k2Fkn2UflDEUDNO23I9IZwr85UhbYesppGFF PNlSRVA0ct0dgBoToQj68PskM7QoCaL/ZGod4IfkHU13saCZqhRysNwPRZeIF9fR6M+w bsIEP5RhqZTFD9bSAU4hQaQQv+ZTYl0SYJIvKxTYNbK/hjj1Xy/rY0Jfg4oAGELi9Phj JvBhnqcjNjyeV8G3NYo5AO/74ie3wAGw3ArGX1c/NNy8auCLFsPU3DZNgSOM6k2sMjGW UwcVYQR4i6Yhb3jQYXU1KRlwoLTfJp8XRzJLj816/hxGziMMwhvVMkB+k4GgnZPLDTa1 JQ1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=7V5+LxBimqkuQF4KnKNJbNWJjmYMOhUyws5t6F+k4UA=; b=L7dujykDathPmW5dpuFLwTDWJpfof9y6/8QaL+IdUCoCTAzQB9k5oOeKrJ1LSADM+r imErNtYaVwYAhD6h7SabYAZI03QQF4EepznrfZbp3WF7BXvs2+DD+JHD8QgaINVhPxA7 g5oxfI13EHDqPFfl/E1gUJj3pSrFVeDom4uX9fU+APLkrpl0wUZsb04Siwow75zw+6ag fQeTXV9gTxi1Ng3uwzC2DClxvKTTyejd882WOk1keCM+sbqKssUZ7XrRpRUwTHFwIZ5N bHz3o+5qnrgx2RaD91fm5TxXuJld1AFWQeodCs2T+Gqgy5xi6e0urVQZnaA1BuAxDR76 hrdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uJjiNHO6; 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 y12si5754827jai.84.2021.08.18.06.14.34; Wed, 18 Aug 2021 06:14:46 -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=k20201202 header.b=uJjiNHO6; 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 S236298AbhHRNL6 (ORCPT + 99 others); Wed, 18 Aug 2021 09:11:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:33172 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233722AbhHRNL5 (ORCPT ); Wed, 18 Aug 2021 09:11:57 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id DE0AB60232; Wed, 18 Aug 2021 13:11:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1629292282; bh=ARE/Rk5keQAVcABEXYM4kZItEQ5ez+wONw4AP1rt1t8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=uJjiNHO6VTs2nYfLIe+ooWLNFQrHXNSoC9M5jZ1S+GlgXwnCeVNNbyWMqPPNyWjh0 G07H4IG9vne+ahMyDDY4DGIqnXT2WGwiqeZP6cIPDXIAaXoo0M+5H87qrCIupEe1RR W8EWtuncctE16zUTgEjk7pD3HafRR2rFsMSMNl8oCLOVpseKpYQ9Cxbl7TS94Vs0aV 7drJoz6meBstLcvxYuF4akaxIEpx9VLkudXu1W+023VF6xOTuH/uUwXsOJ0kZ9nAMl +pIHgKF6l1C7HQpICRIOxpRIaaRIJG/7n2EJJYaRLkeF5EaJEQoh773yloB/Wi1hYw C03g/go8TbUrw== Date: Wed, 18 Aug 2021 15:11:17 +0200 From: Alexey Gladkov To: "Eric W. Biederman" Cc: "Ma, XinjianX" , "linux-kselftest@vger.kernel.org" , lkp , "akpm@linux-foundation.org" , "axboe@kernel.dk" , "christian.brauner@ubuntu.com" , "containers@lists.linux-foundation.org" , "jannh@google.com" , "keescook@chromium.org" , "kernel-hardening@lists.openwall.com" , "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" , "oleg@redhat.com" , "torvalds@linux-foundation.org" Subject: Re: [PATCH v11 5/9] Reimplement RLIMIT_MSGQUEUE on top of ucounts Message-ID: <20210818131117.x7omzb2wkjq7le3s@example.org> References: <87a6lgysxp.fsf@disp2133> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87a6lgysxp.fsf@disp2133> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 17, 2021 at 10:47:14AM -0500, Eric W. Biederman wrote: > "Ma, XinjianX" writes: > > > Hi Alexey, > > > > When lkp team run kernel selftests, we found after these series of patches, testcase mqueue: mq_perf_tests > > in kselftest failed with following message. > > Which kernel was this run against? > > Where can the mq_perf_tests that you ran and had problems with be found? > > During your run were you using user namespaces as part of your test > environment? > > The error message too many files corresponds to the error code EMFILES > which is the error code that is returned when the rlimit is reached. > > One possibility is that your test environment was run in a user > namespace and so you wound up limited by rlimit of the user who created > the user namespace at the point of user namespace creation. > > At this point if you can give us enough information to look into this > and attempt to reproduce it that would be appreciated. I was able to reproduce it on master without using user namespace. I suspect that the maximum value is not assigned here [1]: set_rlimit_ucount_max(&init_user_ns, UCOUNT_RLIMIT_MSGQUEUE, task_rlimit(&init_task, RLIMIT_MSGQUEUE)); [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/kernel/fork.c#n832 > > If you confirm and fix the issue, kindly add following tag as appropriate > > Reported-by: kernel test robot lkp@intel.com > > > > ``` > > # selftests: mqueue: mq_perf_tests > > # > > # Initial system state: > > # Using queue path: /mq_perf_tests > > # RLIMIT_MSGQUEUE(soft): 819200 > > # RLIMIT_MSGQUEUE(hard): 819200 > > # Maximum Message Size: 8192 > > # Maximum Queue Size: 10 > > # Nice value: 0 > > # > > # Adjusted system state for testing: > > # RLIMIT_MSGQUEUE(soft): (unlimited) > > # RLIMIT_MSGQUEUE(hard): (unlimited) > > # Maximum Message Size: 16777216 > > # Maximum Queue Size: 65530 > > # Nice value: -20 > > # Continuous mode: (disabled) > > # CPUs to pin: 3 > > # ./mq_perf_tests: mq_open() at 296: Too many open files > > not ok 2 selftests: mqueue: mq_perf_tests # exit=1 > > ``` > > > > Test env: > > rootfs: debian-10 > > gcc version: 9 > > > > ------ > > Thanks > > Ma Xinjian > > Eric > -- Rgrds, legion