[{"id":3672963,"web_url":"http://patchwork.ozlabs.org/comment/3672963/","msgid":"<ac8mR-0enzhgMeka@redhat.com>","list_archive_url":null,"date":"2026-04-03T02:30:31","subject":"Re: [LTP] [PATCH] cgroup: make regression test compatible with\n cgroup v2","submitter":{"id":73704,"url":"http://patchwork.ozlabs.org/api/people/73704/","name":"Li Wang","email":"liwang@redhat.com"},"content":"Hi Soma,\n\nFirst, thank you for cleanup this test. Yes, it is only compatible\non Cgroup v1, and it's definately could compatible v2 just with\nsome adjutment.\n\nBut I'd like suggest to make use of the LTP standard Cgroup API, for\nversion-check, mount/unmount, ctrl-file set, etc.\n\nYou can take a look at the cgroup_lib.sh, I think it will be more\nconvenient to reuse the mature APIs.\n\n>  test2()\n>  {\n> +\tif mount | grep -q \"type cgroup2\"; then\n> +\t\ttst_res TCONF \"cgroup v2 already active - cannot mount v1 on this kernel\"\n> +\t\treturn\n> +\tfi\n> +\n>  \tlocal val1\n>  \tlocal val2\n> -\tlocal cgroup_version\n> +\tlocal cgroup_mount=\"$PWD/cgroup\"\n>  \n\n> -\tcgroup_require \"memory\"\n> -\tcgroup_version=$(cgroup_get_version \"memory\")\n> -\tif [ \"$cgroup_version\" = \"2\" ]; then\n> -\t\ttst_res TCONF \"This test requires cgroup v1, but system is using cgroup v2\"\n> -\t\tcgroup_cleanup\n\nThe code you removed here is actually what we recommended as a way to\ncheck the system's cgroup version :).\n\nWe can not simply rely on kernel versions to think the cgroup versions,\nbecause for different Linux distributions, it may backport the new\nfeature to old kernels, and kind of Linux supports v1 and v2 flexibly.","headers":{"Return-Path":"<ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it>","X-Original-To":["incoming@patchwork.ozlabs.org","ltp@lists.linux.it"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","ltp@picard.linux.it"],"Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=lists.linux.it header.i=@lists.linux.it\n header.a=rsa-sha256 header.s=picard header.b=M0fV/UfO;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=WD8AlcYz;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.linux.it\n (client-ip=213.254.12.146; helo=picard.linux.it;\n envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it;\n receiver=patchwork.ozlabs.org)"],"Received":["from picard.linux.it (picard.linux.it [213.254.12.146])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fn2lD0ddcz1xtJ\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 03 Apr 2026 13:30:46 +1100 (AEDT)","from picard.linux.it (localhost [IPv6:::1])\n\tby picard.linux.it (Postfix) with ESMTP id 4AD9C3E5493\n\tfor <incoming@patchwork.ozlabs.org>; Fri,  3 Apr 2026 04:30:44 +0200 (CEST)","from in-4.smtp.seeweb.it (in-4.smtp.seeweb.it\n [IPv6:2001:4b78:1:20::4])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature ECDSA (secp384r1))\n (No client certificate requested)\n by picard.linux.it (Postfix) with ESMTPS id 6D5E93E2344\n for <ltp@lists.linux.it>; Fri,  3 Apr 2026 04:30:40 +0200 (CEST)","from us-smtp-delivery-124.mimecast.com\n (us-smtp-delivery-124.mimecast.com [170.10.129.124])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n (No client certificate requested)\n by in-4.smtp.seeweb.it (Postfix) with ESMTPS id C38001000D90\n for <ltp@lists.linux.it>; Fri,  3 Apr 2026 04:30:39 +0200 (CEST)","from mail-pg1-f197.google.com (mail-pg1-f197.google.com\n [209.85.215.197]) by relay.mimecast.com with ESMTP with STARTTLS\n (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n us-mta-135-zMQOSDnBOgGcLSX05OcifA-1; Thu, 02 Apr 2026 22:30:36 -0400","by mail-pg1-f197.google.com with SMTP id\n 41be03b00d2f7-b630753cc38so2417873a12.1\n for <ltp@lists.linux.it>; Thu, 02 Apr 2026 19:30:36 -0700 (PDT)","from redhat.com ([209.132.188.88]) by smtp.gmail.com with ESMTPSA id\n d2e1a72fcca58-82cf9c3d67dsm5153457b3a.33.2026.04.02.19.30.33\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Thu, 02 Apr 2026 19:30:34 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=lists.linux.it;\n i=@lists.linux.it; q=dns/txt; s=picard; t=1775183444; h=date : to :\n message-id : references : mime-version : in-reply-to : subject :\n list-id : list-unsubscribe : list-archive : list-post : list-help :\n list-subscribe : from : reply-to : cc : content-type :\n content-transfer-encoding : sender : from;\n bh=Z0/YP+roEwRQb7Av5ZpWMayWqOU7O7juUn4Rbyk6pb8=;\n b=M0fV/UfO7SFaNE/UC+6yVYZDCplPPMMYNfgzHdL5j3w5TmLxMte9VBtmLEnPtzwxfRDv2\n Vw/PGKIJQDnAiOB85wBqvoBCnZ/kBCWAdbKY7fs0Jhcvyzzscz+BvLapSfkJtpjdcuEn+Gm\n WRe9H+2vvRfiK5Y6aSgD6Uhmwge4mB4=","v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1775183438;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:content-type:content-type:\n in-reply-to:in-reply-to:references:references;\n bh=/Ky79PIhXNkW912Br/it0zvOkAaP4QrRnnnnMmhMckY=;\n b=WD8AlcYz9kJLfYx7X73SHchfFQ6z/XD/TaOhrn14LVKb5pz+RmnGUEKkCey8qKCqC9GOtM\n vJQxf/6vdSMajA7rak7SSevOYCYo492YXJURLCOX2KOvj7V3cgcyVvVNQM/Sef8RnLWG1u\n IX9CvySze9qSh4TqKlq3YNVTIBNCpo8="],"X-MC-Unique":"zMQOSDnBOgGcLSX05OcifA-1","X-Mimecast-MFC-AGG-ID":"zMQOSDnBOgGcLSX05OcifA_1775183436","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1775183435; x=1775788235;\n h=in-reply-to:content-disposition:mime-version:references:message-id\n :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc\n :subject:date:message-id:reply-to;\n bh=/Ky79PIhXNkW912Br/it0zvOkAaP4QrRnnnnMmhMckY=;\n b=luOEvvW3IKBXlNC6aEVMs7DTE7YkCsdVl6/oBzXvh4RxA1rh8y67tqzlgshLWOItSs\n yOZw/s37loGzRDsrOiZGOQsJXD/XPDnj5mVOktUTPDFgtUnAesp5cELOb3kSpHGj8+KO\n fHCktZmKxogvHYMOsqmHIP1Bdep8ujui+v3KOLh4/YQv+RZ2LTxUJ1rYorYQMSHQkP3I\n +sni7PEqb1CZGKj/Z0a+Cy+/GZwTV2mBFPE1JqG7FkgGrUX/I6dNzOafCx0KEylXfxbc\n /hh/oG9l1u6KanVykqegXOqhR87oC8fCxQzEbRXT5xTmRvcJmli+eBIfilzPji8s4VLP\n alEA==","X-Gm-Message-State":"AOJu0YxBLKPUXSTuaFRKHfwsXqJtJjM4j86l/WEEeC9tHhz5Fb7qP+vp\n IA8DGd5CuxPKe7c8IpgPknECBvbqe9x9eWuXeJvZdcAB6vM4KfyurKlHqWc6qlkf4pZ5ruAZhgm\n afL03vQjVVKYh9yLRQFz+67+83YnHw88+BmozvMHstTSNELFh9c2x","X-Gm-Gg":"ATEYQzzeoHf7u2fdy8BtlLcztujUHytQlNw0fGkcjo/fx0bfPhMzccBPuW7p7hVMK3E\n TZu8KKjt/6TIReVtqim4l0CvXkWOMXWGSbhfudkB7sWWxx1onyZsT20Gn6ue9ouDml8XfZK23IG\n /FLP7qERB0I8nyxF5iKh08EyeAO6/wYJP3E842Gm09/xAL1geGd23zS8Caefvg4b7qgjtK1i3lc\n BLxX0qhSj2Z8mvBZks+IgnPtE30Ez4wD8H3nueayUGZ3gc9K4cBtSPN6dQJBtcfeUXqmBF2IRpZ\n CgAt66TmXd6ehHSF3yTXoCpn1k7yOTsMOEo/bZqaZfGuA9yGGRZVji/AYZJaGO3Vf1InDu3axCn\n McLHBp/CEauL9OF/M0w==","X-Received":["by 2002:aa7:88d1:0:b0:82c:9e00:f958 with SMTP id\n d2e1a72fcca58-82d0d743763mr1377977b3a.0.1775183435546;\n Thu, 02 Apr 2026 19:30:35 -0700 (PDT)","by 2002:aa7:88d1:0:b0:82c:9e00:f958 with SMTP id\n d2e1a72fcca58-82d0d743763mr1377948b3a.0.1775183435023;\n Thu, 02 Apr 2026 19:30:35 -0700 (PDT)"],"Date":"Fri, 3 Apr 2026 10:30:31 +0800","To":"Soma Das <somadas1@linux.ibm.com>","Message-ID":"<ac8mR-0enzhgMeka@redhat.com>","References":"<20260402082546.3245433-1-somadas1@linux.ibm.com>","MIME-Version":"1.0","In-Reply-To":"<20260402082546.3245433-1-somadas1@linux.ibm.com>","X-Mimecast-Spam-Score":"0","X-Mimecast-MFC-PROC-ID":"JFbWiRNsBF3p6O7v5p1v81xfxANn4M9KaODP4xqR2sE_1775183436","X-Mimecast-Originator":"redhat.com","Content-Disposition":"inline","X-Spam-Status":"No, score=0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID,\n DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS shortcircuit=no\n autolearn=disabled version=4.0.1","X-Spam-Checker-Version":"SpamAssassin 4.0.1 (2024-03-25) on in-4.smtp.seeweb.it","X-Virus-Scanned":"clamav-milter 1.0.9 at in-4.smtp.seeweb.it","X-Virus-Status":"Clean","Subject":"Re: [LTP] [PATCH] cgroup: make regression test compatible with\n cgroup v2","X-BeenThere":"ltp@lists.linux.it","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"Linux Test Project <ltp.lists.linux.it>","List-Unsubscribe":"<https://lists.linux.it/options/ltp>,\n <mailto:ltp-request@lists.linux.it?subject=unsubscribe>","List-Archive":"<http://lists.linux.it/pipermail/ltp/>","List-Post":"<mailto:ltp@lists.linux.it>","List-Help":"<mailto:ltp-request@lists.linux.it?subject=help>","List-Subscribe":"<https://lists.linux.it/listinfo/ltp>,\n <mailto:ltp-request@lists.linux.it?subject=subscribe>","From":"Li Wang via ltp <ltp@lists.linux.it>","Reply-To":"Li Wang <liwang@redhat.com>","Cc":"ltp@lists.linux.it","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it","Sender":"\"ltp\" <ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it>"}}]