From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C9CE1C4338F for ; Wed, 18 Aug 2021 13:11:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B1F7F60462 for ; Wed, 18 Aug 2021 13:11:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236614AbhHRNL7 (ORCPT ); Wed, 18 Aug 2021 09:11:59 -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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 801B7C432BE for ; Wed, 18 Aug 2021 13:11:25 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 12E2C61053 for ; Wed, 18 Aug 2021 13:11:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 12E2C61053 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 9BDD88D0001; Wed, 18 Aug 2021 09:11:24 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 96E366B0072; Wed, 18 Aug 2021 09:11:24 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 85CBD8D0001; Wed, 18 Aug 2021 09:11:24 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0148.hostedemail.com [216.40.44.148]) by kanga.kvack.org (Postfix) with ESMTP id 6D0B76B006C for ; Wed, 18 Aug 2021 09:11:24 -0400 (EDT) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id EA938183F91E2 for ; Wed, 18 Aug 2021 13:11:23 +0000 (UTC) X-FDA: 78488237646.24.02D4A59 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf08.hostedemail.com (Postfix) with ESMTP id 8BDB53008BD2 for ; Wed, 18 Aug 2021 13:11:23 +0000 (UTC) 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> X-Rspamd-Queue-Id: 8BDB53008BD2 Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=uJjiNHO6; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf08.hostedemail.com: domain of legion@kernel.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=legion@kernel.org X-Rspamd-Server: rspam04 X-Stat-Signature: fbj8augukhoby46jjnc5qyp1hzdtdtqf X-HE-Tag: 1629292283-119720 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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