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 A9385E6F06D for ; Fri, 1 Nov 2024 16:01:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 261596B0088; Fri, 1 Nov 2024 12:01:19 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 211406B0089; Fri, 1 Nov 2024 12:01:19 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1006B6B008C; Fri, 1 Nov 2024 12:01:19 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id E56786B0088 for ; Fri, 1 Nov 2024 12:01:18 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 88E46A0A66 for ; Fri, 1 Nov 2024 16:01:18 +0000 (UTC) X-FDA: 82737989964.05.716AE05 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf05.hostedemail.com (Postfix) with ESMTP id C045410003D for ; Fri, 1 Nov 2024 16:00:22 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=Hz+32a0r; spf=none (imf05.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1730476744; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=CZ9/rERULRJvD1btUQVcVAJF24qxBXwTu8thO571uhU=; b=nVGpLEWnJsODAnCnFgCLivPic0r8m62G3Z6OzZUeHWr72mdFxve5unuSlAwQpiBMOVz7Db P4iXw8RpcHxWOA+xWkfgRNWSL4IDm+9a7EMnlLXHZ9MbHTaxQESAVjaQVB7KSYTaLS0V2W QpSDG1SPTsok14mQDARRxzPH0UVDXnU= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1730476744; a=rsa-sha256; cv=none; b=SdAHBYhQXei/x0t/o/Xkz/UD/ufEBU85bmWLNhDTfoMkS2g0TK2dEHMYyGmCvG02uoU45V J65+lCO8DT6oAgsZFs8yGPhSx8VhEvix4QZepiGa6El8pelr2CzWhRghCAltYzzOYf32qq foQuWR2n8qaZPU1vesZ4AruBOEHuUDY= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=Hz+32a0r; spf=none (imf05.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=CZ9/rERULRJvD1btUQVcVAJF24qxBXwTu8thO571uhU=; b=Hz+32a0rJoP9IwggtPueybLbHt FuejoVtysmHfzuUu69hiCpkZuujJ+50mPDQmNyg1/5s/+dpkxULlDt5K44VXVePxYVDjuEDRAQU2y Z+DihUL8XgVtoHiaETQMTbtheh3B2VElFCj/sPBBPuwVmvEua46ERd66TC9lvaaRlYD/9BZsgxOs2 8ywmhssSrAmm0Bs8Yt0DxbqPXiwf6svYG38Mt1hnHTjx32VByhnEb9b8kiHdCa3KtHrXv7pCB3ERf FPmGqkttmVyNim0u74g4iXnJTcOw98/l4s73pLmly0n5NkJXyCs9jWJU0DxrQ4P9SAbH4LBAOJOe+ IsMikANw==; Received: from willy by casper.infradead.org with local (Exim 4.98 #2 (Red Hat Linux)) id 1t6u5B-0000000G0Oh-1baC; Fri, 01 Nov 2024 16:01:05 +0000 Date: Fri, 1 Nov 2024 16:01:05 +0000 From: Matthew Wilcox To: Stepanov Anatoly Cc: Michal Hocko , Gutierrez Asier , akpm@linux-foundation.org, david@redhat.com, ryan.roberts@arm.com, baohua@kernel.org, peterx@redhat.com, hannes@cmpxchg.org, hocko@kernel.org, roman.gushchin@linux.dev, shakeel.butt@linux.dev, muchun.song@linux.dev, cgroups@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, alexander.kozhevnikov@huawei-partners.com, guohanjun@huawei.com, weiyongjun1@huawei.com, wangkefeng.wang@huawei.com, judy.chenhui@huawei.com, yusongping@huawei.com, artem.kuzin@huawei.com, kang.sun@huawei.com, nikita.panov@huawei-partners.com Subject: Re: [RFC PATCH 0/3] Cgroup-based THP control Message-ID: References: <20241030083311.965933-1-gutierrez.asier@huawei-partners.com> <770bf300-1dbb-42fc-8958-b9307486178e@huawei-partners.com> <80d76bad-41d8-4108-ad74-f891e5180e47@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <80d76bad-41d8-4108-ad74-f891e5180e47@huawei.com> X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: C045410003D X-Stat-Signature: wjb71685xzt5uz46kypzh1kmskr1ywi7 X-HE-Tag: 1730476822-630077 X-HE-Meta: U2FsdGVkX1+D6t9dTDa+A7hE6PcxjZBBHm58mtqfbyBsBH+flLBgrYg5HDxdeVYkJpGvQsTmPPdT/3H3qha+cyYmHjgJAytpf53De5/JaOcSlQLjS7ZROqNlPIhEk96jeWaAIJheNOI++Jlx1kTW5U2sagJAvczxwSPzmbjRYaZYFCSVSl+jfAIVwSD7hwoRJsMWLDhu95yfmONcv8xpvNA+8fi9Nd4wlwwqEzLEy8OthhsZTdTcFrgnz8ll6ZhyCVPGeHxR+gRm8lu2iNQGhPyXh0wSp5ccho4dUfBonN4Ew5+B+BztXijN1uhZGETRJSbBXmrsWZpgwstw1zFCHRmk6HhpBdrxvhvXqmpMZTJhEHJv+JN1+cN8G4R77ksYz3zxJpQCm65c02XSs2V8iB2uE+EetCJDGIZVmKH1cq3vFwd7oASlYbQjIhjVpotAhCifwfxV49ya5sNzIwNbcibTDvA4M+GxhhovMlXBXHFh17GxL9DJoWS/bLufPUljtBa+Gt+IPC4+eo4nJmS7JNMenp25VtyU6T7x+U073nbVqBclCa1ZvIYXenjxqAG4tCAs8mw6d/ytaOU19d2jyDGHIOtMArta8YRTuS94otNPtu0uWoo+r6sYZs8NxAywAG+BIj9tyajHx6kqtgdBss7pshCFt0Cy7SFTU2ajACQUrdnOa4g3DTVqDURJZSaYTgeat1hFJRIGXifi9ym73h4GNoT/aW08AnNVvqMYGYMaqvxpOXwIrJaB+4+yLB7A/ZyWXMM5Y12VklMK/tVVv38entlypGKv5jWP7JIySLb7Ak2fxRKlIb+KPMCijKqaF5sGk2XqJT0L8Gb+q5A8OE4kQP8XyQmW9aATMfv3eeoKHiZ5fk4KYNf7fgZ5LxBv+96V9zCHIoXBKU3OVssfUte7F+OsIfQmGxfQJrgk+GP+v8HkXl30P7RAG7nCwox/jt3Oe17R+v2So2mEcLL RIaXvaY4 vZvSEswGhMhmz/Ydykc0ssoLGpEe1bFHEg7gFpYAGgLbWKrh48LdNkDV3ZVnPTRWOkrmjKww4nO8qdmeZ/7ssSoPwP3IJYtBL6IgrOiY9gMLSfn2B3KWzaT3rX/9yMYB9CwfWyMKIVxfJ2/rN4XFy2p2F0dwhNhq1Gte+UWVvfkJARsoSaL/l8f/XHLxm/kekMVPiplG/IDXg/RcTHMzY1RbHyWG3gl0Z7r899+liiUcW9WU= 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: List-Subscribe: List-Unsubscribe: On Thu, Oct 31, 2024 at 05:37:12PM +0300, Stepanov Anatoly wrote: > Don't get us wrong, we're not trying to push this into memcg specifically. > We're just trying to find a proper/friendly way to control > THP mode for a group of processes (which can be tasks without common parent). > > May be if the process grouping logic were decoupled from hierarchical resource control > logic, it could be possible to gather multiple process, and batch-control some task properties. > But it would require to build kind of task properties system, where > a given set of properties can be flexibly assigned to one or more tasks. > > Anyway, i think we gonna try alternative > approaches first.(prctl, process_madvise). I oppose all of these approaches. They are fundamentally misguided. You're trying to blame sysadmins for our inadequacies as programmers. All of this should be automatic. Certainly the kernel will make mistakes and not use the perfectly optimal size at all times, but it should be able to get close to optimal. Please, focus your efforts on allocating memory of the right size, not on this fake problem of "we only have 235 THPs available and we must make sure that the right process gets 183 of them".