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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1E395C43334 for ; Wed, 29 Jun 2022 06:13:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 57BA08E0001; Wed, 29 Jun 2022 02:13:07 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 52AF06B0072; Wed, 29 Jun 2022 02:13:07 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3F2108E0001; Wed, 29 Jun 2022 02:13:07 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 2C3996B0071 for ; Wed, 29 Jun 2022 02:13:07 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 028A761381 for ; Wed, 29 Jun 2022 06:13:06 +0000 (UTC) X-FDA: 79630255614.21.7A9F4D3 Received: from mail-lj1-f175.google.com (mail-lj1-f175.google.com [209.85.208.175]) by imf29.hostedemail.com (Postfix) with ESMTP id 3D46812003B for ; Wed, 29 Jun 2022 06:13:06 +0000 (UTC) Received: by mail-lj1-f175.google.com with SMTP id a39so16451275ljq.11 for ; Tue, 28 Jun 2022 23:13:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvz-org.20210112.gappssmtp.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=tXBEMcYdLbL7j0CBnFEQrI7j8CDRw/szwLk4z5HVwIU=; b=6xIoLTbTENo5N5hHKjhjfiPk6YpVnyqcLFcwoVzvW3j8d4aWTu8RxffBad1YuW22ZQ B7JUZzvMlY3hMEVofUyVtHBYlj7NYSiQSjSmRtHMHwYaGzHsaqvwDqH4SBVu0eg2wt1p 09spkd8NH3luZDqG7H3iAwgS+g1MUQ3GRFz+F1gyrPFJjm6z7aaVcn7gc2MOrFB/p6kF JajynDxOhztcu9FGmfWos5JDk1HGKQ0g4bqDoY+ExizDNO0aXZPzeg0b1uGZ74fHWMX+ +J+20MEXlTNZIPQhPd4BwwqzofH2gf1h83iJVr7esOJIGCDxJ6fleBsVho2LMH/DFy0V agWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=tXBEMcYdLbL7j0CBnFEQrI7j8CDRw/szwLk4z5HVwIU=; b=HneE4vj9Y7fjs5JTTuQOg99q8hl89tRoZiIIuh2GEYJxE66OQfXJuv/BzzqEFawSLx DbyIUqYvLDbRUAfnzDNCfo8NftIYcXZTENNjIaEZvQr3jKMneQL/ABAlVzPchjtnKdfJ kvEN9ahbtXIucQyRrpbfg2NdEZr9rs0YDt7LGpPwri7ObmRknHrX7cpMACFjSUooKcJV IzyIc/ibHVVTgdFeKCOUeZp0Z46RuWN3BB1bMxAgkgOcSO6PunF8KrKG7iW6H/wFMKZA 9VjlTVK3rZru3ZI3f0x0buh8wAP4SloYsOkRPG1xoRH1UOIN4D0Y7eDYlcvGMHrprUA8 NeGQ== X-Gm-Message-State: AJIora8N4MjvXSBltZAZcKRAf9vlYGj0jFtHOFSztGqHY1OHjrYbONcU 0xaGPbylSOqixfxi/b2BjwNPbw== X-Google-Smtp-Source: AGRyM1uz1PB+XkmMF33YPm/T9ikaMMh3hNuHzNz1feoMJukKhHNlhRxnBXWZVy0f0Esc50JJckDEkA== X-Received: by 2002:a2e:a707:0:b0:25a:7709:d8ce with SMTP id s7-20020a2ea707000000b0025a7709d8cemr849124lje.362.1656483184254; Tue, 28 Jun 2022 23:13:04 -0700 (PDT) Received: from [192.168.1.65] ([46.188.121.129]) by smtp.gmail.com with ESMTPSA id z9-20020a0565120c0900b0047f66471224sm2475170lfu.222.2022.06.28.23.13.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 28 Jun 2022 23:13:03 -0700 (PDT) Message-ID: <525a3eea-8431-64ad-e464-5503f3297722@openvz.org> Date: Wed, 29 Jun 2022 09:13:02 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH cgroup] cgroup: set the correct return code if hierarchy limits are reached Content-Language: en-US To: Tejun Heo , =?UTF-8?Q?Michal_Koutn=c3=bd?= Cc: Roman Gushchin , Shakeel Butt , Michal Hocko , Zefan Li , Johannes Weiner , kernel@openvz.org, linux-kernel@vger.kernel.org, Andrew Morton , linux-mm@kvack.org, Vlastimil Babka , Muchun Song , cgroups@vger.kernel.org References: <186d5b5b-a082-3814-9963-bf57dfe08511@openvz.org> <17916824-ba97-68ba-8166-9402d5f4440c@openvz.org> <20220628091648.GA12249@blackbody.suse.cz> From: Vasily Averin In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1656483186; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=tXBEMcYdLbL7j0CBnFEQrI7j8CDRw/szwLk4z5HVwIU=; b=f+0F9OVPawahL1SUZvgXF4aiI8UTZpH7IPCq6N4SOgAipwA1/6Wek4MKYaevJPB1JyMaqR jSBPlIfy0hsdQGpsqW65YDtKNzBfI0/oCsW0SulHnnQyxMiRmz7znNRt+woLKdamNaj/mS etYahE1i/qfSwuB1ICm591/S+EwBuJ8= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=openvz-org.20210112.gappssmtp.com header.s=20210112 header.b=6xIoLTbT; spf=pass (imf29.hostedemail.com: domain of vvs@openvz.org designates 209.85.208.175 as permitted sender) smtp.mailfrom=vvs@openvz.org; dmarc=pass (policy=none) header.from=openvz.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1656483186; a=rsa-sha256; cv=none; b=x80OQ7lcLWgmZzzlgt3gKXmnaqooVmTeHVXw+I0SZM06TZpGS202AUGhSG8F+4HQhg8MT1 wUVMBhQT0fawFjnoVWLHhiaiRg4twf2oT+78bTU0giPo7aG/uvZpBss7ibpiPoajs63XAR q+5mmnia1l2CJUFhkenI3hQknSbNVwM= Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=openvz-org.20210112.gappssmtp.com header.s=20210112 header.b=6xIoLTbT; spf=pass (imf29.hostedemail.com: domain of vvs@openvz.org designates 209.85.208.175 as permitted sender) smtp.mailfrom=vvs@openvz.org; dmarc=pass (policy=none) header.from=openvz.org X-Rspam-User: X-Rspamd-Server: rspam06 X-Stat-Signature: frrjcpsiqzryp5as6jpejew8m93pnfmq X-Rspamd-Queue-Id: 3D46812003B X-HE-Tag: 1656483186-877332 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 6/28/22 12:22, Tejun Heo wrote: > On Tue, Jun 28, 2022 at 11:16:48AM +0200, Michal Koutný wrote: >> The mkdir(2) manpage doesn't list EAGAIN at all. ENOSPC makes better >> sense here. (And I suspect the dependency on this particular value won't >> be very wide spread.) > > Given how we use these system calls as triggers for random kernel > operations, I don't think adhering to posix standard is necessary or > possible. Using an error code which isn't listed in the man page isn't > particularly high in the list of discrepancies. > > Again, I'm not against changing it but I'd like to see better > rationales. On one side, we have "it's been this way for a long time > and there's nothing particularly broken about it". I'm not sure the > arguments we have for the other side is strong enough yet. I would like to recall this patch. I experimented on fedora36 node with LXC and centos stream 9 container. and I did not noticed any critical systemd troubles with original -EAGAIN. When cgroup's limit is reached systemd cannot start new services, for example lxc-attach generates following output: [root@fc34-vvs ~]# lxc-attach c9s lxc-attach: c9s: cgroups/cgfsng.c: cgroup_attach_leaf: 2084 Resource temporarily unavailable - Failed to create leaf cgroup ".lxc" lxc-attach: c9s: cgroups/cgfsng.c: __cgroup_attach_many: 3517 Resource temporarily unavailable - Failed to attach to cgroup fd 11 lxc-attach: c9s: attach.c: lxc_attach: 1679 Resource temporarily unavailable - Failed to attach cgroup lxc-attach: c9s: attach.c: do_attach: 1237 No data available - Failed to receive lsm label fd lxc-attach: c9s: attach.c: do_attach: 1375 Failed to attach to container I did not found any loop in userspace caused by EAGAIN. Messages looks unclear, however situation with the patched kernel is not much better: [root@fc34-vvs ~]# lxc-attach c9s lxc-attach: c9s: cgroups/cgfsng.c: cgroup_attach_leaf: 2084 No space left on device - Failed to create leaf cgroup ".lxc" lxc-attach: c9s: cgroups/cgfsng.c: __cgroup_attach_many: 3517 No space left on device - Failed to attach to cgroup fd 11 lxc-attach: c9s: attach.c: lxc_attach: 1679 No space left on device - Failed to attach cgroup lxc-attach: c9s: attach.c: do_attach: 1237 No data available - Failed to receive lsm label fd lxc-attach: c9s: attach.c: do_attach: 1375 Failed to attach to container Thank you, Vasily Averin