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 750EFE6B278 for ; Fri, 1 Nov 2024 14:03:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0353C6B009C; Fri, 1 Nov 2024 10:03:56 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id F275E6B009E; Fri, 1 Nov 2024 10:03:55 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DC7A76B009F; Fri, 1 Nov 2024 10:03:55 -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 BEBF06B009C for ; Fri, 1 Nov 2024 10:03:55 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 1D64416067B for ; Fri, 1 Nov 2024 14:03:54 +0000 (UTC) X-FDA: 82737693696.06.737A979 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by imf22.hostedemail.com (Postfix) with ESMTP id 85F45C001E for ; Fri, 1 Nov 2024 14:03:16 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf22.hostedemail.com: domain of stepanov.anatoly@huawei.com designates 185.176.79.56 as permitted sender) smtp.mailfrom=stepanov.anatoly@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1730469776; a=rsa-sha256; cv=none; b=xj6pqCOIylouSpeF2yS1Ju3OY5LzZbK40YWYVh0my5KzvtPAEeSV98W7IQPyisWsoj7lCv IHUUu0ZIXsV+uBtS85ecq6wr9LJHhcYNYfG6a90r1eWBx6TpxL0YQhJy6YAkhtwHN8H2zc UgS9yO1ON1zRO4YMy4ckHrnffxuImWQ= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf22.hostedemail.com: domain of stepanov.anatoly@huawei.com designates 185.176.79.56 as permitted sender) smtp.mailfrom=stepanov.anatoly@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1730469776; 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; bh=9RenhdB1XKpESTHv4D6FEPk8stmBsAMFi2455Vh9/3w=; b=MPgYJEoqE1LF3qn4+dNs5Zns8izSFbJ1oP/l0gahK+52kQHod/t109Y/m+FDKUpTtIwXUa JL0a398OMbSEx2wY7lI7BUl9yJ0j3R6pZB3beG7dp1c5I6l8SxidZ61ScJO8Jrpzmk1DZE T+gMThNIwiShH+Cjd6LtBT3m/nUYlT4= Received: from mail.maildlp.com (unknown [172.18.186.231]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4Xg2cH2SBRz6JB91; Fri, 1 Nov 2024 22:02:23 +0800 (CST) Received: from mscpeml500003.china.huawei.com (unknown [7.188.49.51]) by mail.maildlp.com (Postfix) with ESMTPS id 43DAC140A70; Fri, 1 Nov 2024 22:03:47 +0800 (CST) Received: from [10.123.123.226] (10.123.123.226) by mscpeml500003.china.huawei.com (7.188.49.51) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.34; Fri, 1 Nov 2024 17:03:46 +0300 Message-ID: <0f533707-e9fc-4abd-95fb-bf22c322285d@huawei.com> Date: Fri, 1 Nov 2024 17:03:46 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC PATCH 0/3] Cgroup-based THP control To: Michal Hocko CC: Gutierrez Asier , , , , , , , , , , , , , , , , , , , , , , , References: <80d76bad-41d8-4108-ad74-f891e5180e47@huawei.com> <274e1560-9f6c-4dd9-b27c-2fd0f0c54d03@huawei.com> <5120497d-d60a-4a4b-a39d-9b1dbe89154c@huawei.com> <5baa6024-a0a4-4b0b-a7d1-641bba7e5b87@huawei.com> Content-Language: en-US From: Stepanov Anatoly In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.123.123.226] X-ClientProxiedBy: mscpeml500003.china.huawei.com (7.188.49.51) To mscpeml500003.china.huawei.com (7.188.49.51) X-Rspam-User: X-Rspamd-Queue-Id: 85F45C001E X-Rspamd-Server: rspam01 X-Stat-Signature: ywcq11i96pkb5e7gkssf63b3wh583osf X-HE-Tag: 1730469796-800570 X-HE-Meta: U2FsdGVkX19kEbcBKC0KXljb66vcRNZ9TcPZb+gqdEUI9Q3xaZQziO69NpgmLpRlnoBl3mps6yAa/NzK6mXXEJFC8sYy0gfUc6Df/BI+qTLx0XoDDDEgcn/nK66h503FVNSnr64e1H2EZuAP69lizWtD7TR6HUw4oDYz+tU1LZWjiavuzM/e2suVcNh7SJ7RjbccKTfyhHDsV36mBjAZmwt1OvSahFeYJxp14BBMKkHlIpGsggND90JZazObWQZJK46TgHnqaUJwkAC8n6CBoqOleTvac+eP7q71HMMM2xBywSsnFdm1RHdVs/b41uuEShwLEXE3wCE8cAGG4LHeEryV72tqcj6LhuVw+7Add0nCbB+mMfXJDLckKNWryUilvGYDz0iYD8T44toU5dX0wV7T+Ubaj3PLUAuOXHkq6YEKxKzdSkvhXk6aYxvitXCsqXUBrHdchWF8cHgI58AXRqFHWny6oSbooXgUijUi9YctdV06+PnTXn+ItaaiYRRIIp0OzsflUphqWic1TXST9Phed7POsQDNgiftNeY2bnW+wgJUIgOR47Tfsyhr86SRAYufXOJRB5+Hipzw+PtYDwRH14ulKBuWTwv0NcWp94qUm8Z2TZMpkaxWghzbZsDnXGOCiSKG+qiQvkjDKgCqbjm/pWxR1IYX9m6rJFfALXRNn4gTkjYacdrztjtOt9zNTsX4obLDWa20RAOjMcS80Utyg99jGXbwuhiq/qV0uNJp4jDZ23fcff67YPuLFd5iVPj7bjAcdDK2TQy4ZGxyeoavEs/hg9GLlFReo37Dfhq2DWT18gkUm9sfbS+mieUu/qq+PRDvMf4No0sWnV5t65UlLCMNvUVD1BpOJwoCiqBoHYzpPLPIA7uWvwLNqaGSSdHpLkHeP7Q6oVfLg1uMVDvrQaIupLAWGhw9GSNJwOWpa5SnT786yIQa32n5GQYVxtQGtJ/3Eyd6wRedlRi dwNxFmuo 5MkQRoqmFVYvG+jJjZr3FkgvTEVNuNMUl1di8YfEjboNiuxawgKqAJ37y40GUOmYJiP2HBDkKkZmVzwqqgsFvoBBwBZ8NbLOr9TiFBsDsKuIyR8jmhm0NkVOj5GjSHGf3o1cJ6v3BUydSVqH/p2/ZalBJyKELE/oS2tsdF01V0xSHnKg= 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 11/1/2024 4:50 PM, Michal Hocko wrote: > On Fri 01-11-24 16:39:07, Stepanov Anatoly wrote: >> On 11/1/2024 4:28 PM, Michal Hocko wrote: >>> On Fri 01-11-24 16:24:55, Stepanov Anatoly wrote: >>>> On 11/1/2024 4:15 PM, Michal Hocko wrote: >>>>> On Fri 01-11-24 14:54:27, Stepanov Anatoly wrote: >>>>>> On 11/1/2024 10:35 AM, Michal Hocko wrote: >>>>>>> On Thu 31-10-24 17:37:12, Stepanov Anatoly wrote: >>>>>>>> If we consider the inheritance approach (prctl + launcher), it's fine until we need to change >>>>>>>> THP mode property for several tasks at once, in this case some batch-change approach needed. >>>>>>> >>>>>>> I do not follow. How is this any different from a single process? Or do >>>>>>> you mean to change the mode for an already running process? >>>>>>> >>>>>> yes, for already running set of processes >>>>> >>>> >>>>> Why is that preferred over setting the policy upfront? >>>> Setting the policy in advance is fine, as the first step to do. >>>> But we might not know in advance >>>> which exact policy is the most beneficial for one set of apps or another. >> >>> >>> How do you plan to find that out when the application is running >>> already? >> For example, if someone willing to compare some DB server performance with THP-off vs THP-on, >> and DB server restart isn't an option. > > So you essentially expect user tell you that they want THP and you want > to make that happen on fly, correct? It is not like there is an actual > monitoring and dynamic policing. For a user/sysadmin this scenario is almost the same as experimenting with global THP settings, but with explicit THP usage, less THP overuse by some random apps, so more predictable. > > If that is the case then I am not really convinced this is a worthwhile > to support TBH. I can see that a workload knows in advance that they > benefit from THP but I am much more dubious about "learning during the > runtime" is a real life thing. I might be wrong of course but if > somebody has performance monitoring that is able to identify performance > bottlenecks based on specific workload then applying THP on the whole > group of proceesses seems like a very crude way to deal with that. I > could see a case for madvice_process(MADV_COLLAPSE) to deal with > specific memory hotspots though. Yes, we have something like this in mind. -- Anatoly Stepanov, Huawei