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 C54C9C48BF6 for ; Mon, 26 Feb 2024 11:22:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 04C886B00A7; Mon, 26 Feb 2024 06:22:34 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id F17346B00A3; Mon, 26 Feb 2024 06:22:33 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E06046B00A5; Mon, 26 Feb 2024 06:22:33 -0500 (EST) 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 D15C76B00A1 for ; Mon, 26 Feb 2024 06:22:33 -0500 (EST) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id AA34F1C08AF for ; Mon, 26 Feb 2024 11:22:33 +0000 (UTC) X-FDA: 81833716986.17.C4E95FE Received: from out30-132.freemail.mail.aliyun.com (out30-132.freemail.mail.aliyun.com [115.124.30.132]) by imf17.hostedemail.com (Postfix) with ESMTP id DD15D40012 for ; Mon, 26 Feb 2024 11:22:29 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=linux.alibaba.com header.s=default header.b=sDK81OEP; spf=pass (imf17.hostedemail.com: domain of liusong@linux.alibaba.com designates 115.124.30.132 as permitted sender) smtp.mailfrom=liusong@linux.alibaba.com; dmarc=pass (policy=none) header.from=linux.alibaba.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1708946551; 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=yFKuCFUbQJWXllA9q4A3yOIm5hDbUr1UP4xb9Ika1tA=; b=K3BbQSuFFiOGsgdjLPwMhwcmwWUkAcYxyhTU0zcWcmlwiAhS4EFu8FoRHye+DPbtbjE8T6 rsziZRvVxLEayaUXfhbp6Xjb9VAJE9dqImFa1ff0NNWXevmxlb1Tiq6tub5vQO+EhUo1Dk epgj08AIWzXAS952qHrxC7wSSXA6Xak= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=linux.alibaba.com header.s=default header.b=sDK81OEP; spf=pass (imf17.hostedemail.com: domain of liusong@linux.alibaba.com designates 115.124.30.132 as permitted sender) smtp.mailfrom=liusong@linux.alibaba.com; dmarc=pass (policy=none) header.from=linux.alibaba.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1708946551; a=rsa-sha256; cv=none; b=k/UI+WbSTHzsSbufneeCzcN22XAFyW3882vu8cWeKHg/glcwVHYVJ+rTx4qhh7cIVjucxC l6sAUATftnXM2jxqafwOG8KOOkopYjS1CX31P23uq6pozib4KOcjjZuezZ7pOlKDMhd4AU I11k1ga+MkJBnAUTbgrfR1j6yzmgaAw= DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1708946546; h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type; bh=yFKuCFUbQJWXllA9q4A3yOIm5hDbUr1UP4xb9Ika1tA=; b=sDK81OEP1DQNRUoZMHAVp4cuC4S0Hv9TlNB/eGzahpTxmGVPjaIyN0zhboSt3A21R5cYydYEXgVUzx9VMvTEn8hdQIH4rH1TGDBHX6ED0CDbbBGaCzlN1shesCqr0pYaMOgmHw8EmyNKRaqFszRelnfRuipOU2+rRSq5m2utT6M= X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R491e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046060;MF=liusong@linux.alibaba.com;NM=1;PH=DS;RN=5;SR=0;TI=SMTPD_---0W1HP6Kg_1708946545; Received: from 30.178.81.124(mailfrom:liusong@linux.alibaba.com fp:SMTPD_---0W1HP6Kg_1708946545) by smtp.aliyun-inc.com; Mon, 26 Feb 2024 19:22:26 +0800 Message-ID: Date: Mon, 26 Feb 2024 19:22:24 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] mm, thp: display [never] for defrag when THP is set to never To: David Hildenbrand , Yuanhe Shu , akpm@linux-foundation.org Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20240222115323.4925-1-xiangzao@linux.alibaba.com> <8a723092-347d-443a-82e1-4093f6a1ba0e@redhat.com> From: Liu Song In-Reply-To: <8a723092-347d-443a-82e1-4093f6a1ba0e@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DD15D40012 X-Rspam-User: X-Stat-Signature: t6p168wadfnkuazjkxfipny4i9txqqus X-Rspamd-Server: rspam01 X-HE-Tag: 1708946549-771862 X-HE-Meta: U2FsdGVkX1+x8H7kqda7auJYnIY+MEO7LA75GT0aOwoGn6RC+jQpYiY+MwXAUBJ8oZH5IYbdIri/5W+YZ9ru2aFnVmx5C2OxhFfSv57JaX6a3ALDsJGDzMNnJWBJx16cOO0aBNOurUHIZFGOZl12hytrgBreBoqgd9CUZinXC9ln7ZYkWiNlvKz3No34S2BcWVujQTSFkiqZj2JKaH2iGez69p6yrqmAW6c0hsQaZ1EoyJDZALBr0vwdyqNE7Cp66NIMWubm7W2o2ILoiGx3DCqXsLmrOO4FxhVDSvGkVvVN3oTSMsUEk0fdTU2nwqMtDYsFtllw1S3mKotNIQo/nrqGT+RZBAH5WcEn60bukYwlQbABPfgT87W703smMohCCvStbN4hop8IBZqPv61+8c/fT9ZAggo/YirE4msFpUUKDZ/U5mPBao02fsS0Ty3uKo8YQyQs4LzjFkawu/3S13SdJ0MvfiS9HKCuGNjDhfiEoYiS98Dper0LVppwT5NB0Bn878uP4f8DB76bQFpc7tB3o1M1efvFBEVuCOJoFNz3Z8ZNXgVxByskHW3YhNg0nz1bPnx2RrsTRRa7vTi/oWr+/5qQj91Zcpm1mkTeQnHIZnqdPAs1tHOgyj819fLxTNFYDURlzvPVJRVxdACpqoZoriJ/ACrCBBZZGSlHQcWu4GrrZgiRhOKOtvXRyCX3+CSy3pGhjR6ro/mH+HL6NiQ3ooa5q0JEHwJ5Bzm7hv3rxAwWRYT2s70mO00xB9XfMs5b51gnWd2W8uE8GAtYS2Mj08+HUD5s5FGRtGt4l5WfDRyFoZ76Sr4PYT6Xw49Alq6WMIMLvpoLBDZBPaLuykiqxckFO5LCj41cX6lIzcoRLAVWk1vUa/6sOc0aWCWW+W3KESLWHULpUCFm5GLu2QiR8dCyA34o/shTm3Y0czNqXg074gEoANaIFWwQ276VZRibfgUYZFdCj9RpjV+ 1vQHxzbz YerIhDWVuB+AvEpiFxAAV8tdySjfN0mg7FLuyrSvaC0k8IK5LiB8gxUjrSuVVCbnc4as8TpqN1Mnqh4Dba/EiP15HfPQYuai1tXC3UWqEE6mL1+6bqwK5x1yjQShAwUz6p49/f3XX+XeqgHuvlzf/TgVLWvgctGp/CQLJFXbaansyJ1sW88+Xnd2tcrjhJ6FJtU4PPIRHVJ9FkzmU5a/c9wAQHsYIYGWOJXBGPQe9tJBgtXM= 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: 在 2024/2/26 16:54, David Hildenbrand 写道: > On 23.02.24 12:01, Liu Song wrote: >> >> 在 2024/2/22 20:14, David Hildenbrand 写道: >>> On 22.02.24 12:53, Yuanhe Shu wrote: >>>> When transparent_hugepage is set to never by cmdline or echo, defrag >>>> still show what it used to be and can be modified which makes user >>>> confusing whether defrag would take effect. >>>> >>>> Actually if transparent_hugepage is set to never, defrag will not take >>>> effect. Just Display never and remain unchangeable to for defrag when >>>> transparent_hugepage is set to never. >>>> >>>> Suggested-by: Liu Song >>>> Signed-off-by: Yuanhe Shu >>>> --- >>> >>> No, I don't think we want such a dependency between both options. >>> >>> You might just end up breaking existing scripts (enable defrag before >>> enabling THP) for no good reason. >>> >> In certain situations where khugepaged_thread is NULL, it would be more >> reasonable for the value of >> /sys/kernel/mm/transparent_hugepage/khugepaged/defrag to be 0. The patch >> should include a fix for this case. > > Why? > > We have a bunch of THP toggles. They reside in > "/sys/kernel/mm/transparent_hugepage/", indicating that they are THP > specific. > > Some of them are only in effect if some other toggles are set. > > That is very common practice. > > If you think something could be confusing, maybe clarify the doc? I > don't immediately see why any code changes are required, really. We should explain this in the documentation, but to be honest, many people don't read the documentation, and even after we explicitly disable THP with transparent_hugepage=never, khugepaged/defrag is still set to 1, and users come asking why it's still defragging. We can't expect all users to have technical expertise, or to diligently read through the documentation; it would obviously be best if we could avoid user confusion altogether. Thanks