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 7EC93C8303C for ; Tue, 8 Jul 2025 06:15:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1FD496B0170; Tue, 8 Jul 2025 02:15:53 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1D4EE6B0306; Tue, 8 Jul 2025 02:15:53 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 111CE6B037F; Tue, 8 Jul 2025 02:15:53 -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 01C896B0170 for ; Tue, 8 Jul 2025 02:15:52 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id A40021289BA for ; Tue, 8 Jul 2025 06:15:52 +0000 (UTC) X-FDA: 83640086544.10.5888BBA Received: from out30-98.freemail.mail.aliyun.com (out30-98.freemail.mail.aliyun.com [115.124.30.98]) by imf27.hostedemail.com (Postfix) with ESMTP id 4AADB4000D for ; Tue, 8 Jul 2025 06:15:48 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=linux.alibaba.com header.s=default header.b="CD/2dz8C"; spf=pass (imf27.hostedemail.com: domain of baolin.wang@linux.alibaba.com designates 115.124.30.98 as permitted sender) smtp.mailfrom=baolin.wang@linux.alibaba.com; dmarc=pass (policy=none) header.from=linux.alibaba.com ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=linux.alibaba.com header.s=default header.b="CD/2dz8C"; spf=pass (imf27.hostedemail.com: domain of baolin.wang@linux.alibaba.com designates 115.124.30.98 as permitted sender) smtp.mailfrom=baolin.wang@linux.alibaba.com; dmarc=pass (policy=none) header.from=linux.alibaba.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1751955351; a=rsa-sha256; cv=none; b=hSXWK7BJfHcFlccvTBwH0qgqS+gmn4mybaCf5tQakOJGc3JqpNq56KNkx/t6ZfKUQVkIGt YRXOSwCtDQBcaSZcge/HYidphsAIAhBJB0dh69y4kms9Zkv4RZraP5Os875zZ8TP2aNz1N xjGCZVR+feRoybNgBSVmUTn+/SZSYtg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1751955351; 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=wupd60Oal9Y3QOsXWJFex1COZtG3ybcO2A2WTdS/tRc=; b=crJ3T9wqZMbIjduKFZx+OKaKUWz+XHjp3CN86fcNFvnjix3bOOTVjTRk8904V9cUygyVVQ qSW8QVcsKg5p9Jwo0mGpcbwIrIEpCbnpIvH7VVRQiYMbquaJuGDvVfs7vgMiFkErGnVYp8 UPtDCAZMH6r+dBT2PT6/p79M43Wgm0Y= DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1751955344; h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type; bh=wupd60Oal9Y3QOsXWJFex1COZtG3ybcO2A2WTdS/tRc=; b=CD/2dz8CHnUnoRqLxvrPobeLgm8kAFQfK1Fr2priGLVi6y13CWdDCggZiKdTX1VC3E1XS6uvDyI9ZTkgZNKnlJ0OUn4D9ifMDxc8bWWWkDw63Hi96f1pgdmmX6yogzjO2Ejl2XCyojHZK3qEhCCUfrZ7bPDESx/WmWLcMiIX2l4= Received: from 30.74.144.119(mailfrom:baolin.wang@linux.alibaba.com fp:SMTPD_---0WiL4GDP_1751955340 cluster:ay36) by smtp.aliyun-inc.com; Tue, 08 Jul 2025 14:15:41 +0800 Message-ID: <854ef84f-20ae-4985-9514-7f0616e0fc85@linux.alibaba.com> Date: Tue, 8 Jul 2025 14:15:40 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v8 11/15] khugepaged: allow madvise_collapse to check all anonymous mTHP orders To: Nico Pache , Andrew Morton , david@redhat.com, dev.jain@arm.com, Hugh Dickins Cc: linux-mm@kvack.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, ziy@nvidia.com, lorenzo.stoakes@oracle.com, Liam.Howlett@oracle.com, ryan.roberts@arm.com, corbet@lwn.net, rostedt@goodmis.org, mhiramat@kernel.org, mathieu.desnoyers@efficios.com, baohua@kernel.org, willy@infradead.org, peterx@redhat.com, wangkefeng.wang@huawei.com, usamaarif642@gmail.com, sunnanyong@huawei.com, vishal.moola@gmail.com, thomas.hellstrom@linux.intel.com, yang@os.amperecomputing.com, kirill.shutemov@linux.intel.com, aarcange@redhat.com, raquini@redhat.com, anshuman.khandual@arm.com, catalin.marinas@arm.com, tiwai@suse.de, will@kernel.org, dave.hansen@linux.intel.com, jack@suse.cz, cl@gentwo.org, jglisse@google.com, surenb@google.com, zokeefe@google.com, hannes@cmpxchg.org, rientjes@google.com, mhocko@suse.com, rdunlap@infradead.org References: <20250702055742.102808-1-npache@redhat.com> <20250702055742.102808-12-npache@redhat.com> <2f6d9541-8083-4d3c-a9c1-cba0d5bf98a0@linux.alibaba.com> <20250704141422.359c89146ad69512b9be4902@linux-foundation.org> From: Baolin Wang In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 4AADB4000D X-Stat-Signature: 8n695wkcej7qqfmnrpwy65ri18ths3sk X-Rspam-User: X-HE-Tag: 1751955348-768297 X-HE-Meta: U2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4cdCOA15zW67WLJunF84ov4ttMvYodEvDnSWscCkJJNJj8Y4TctFg/n3ps3uc+tDqJbA0/vwU5+CqbiIAzm2YYzb03X6dpBQS0q6qZFfAdbXnuYeP2y1Mrhu46sNFzwlazub+OME4hQDAvyjjiL09KNuaZSoo9DDWvSavn3gal1dG+VRLlBjKEZH9WxZtVGjNkCSuMk1lcosPdE1BMvjlUDn1/7pgtEn3MzwU0HqIeqKseJU48Hd49r/BRoMnkQxVTfycuTIzGuHY72lqHR04radm0Sx11z9cb4rml8ZauB5hJPQbYSz9tV8QRJN4ZN6nwZIhJiw/QCkIUWhjNm+x2vbs7mmixNza62Djwwdh1x65VqoKvuSl9Rpzr0QwZhEZJiazzVlKO1WDSRw+WuV1i0KqTULVFyADa+tw+NZrTAGTcmVXnMjc7cO4jJlzOTnPypYwVwqTqpKbvkWa 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 2025/7/8 12:37, Nico Pache wrote: > On Fri, Jul 4, 2025 at 3:14 PM Andrew Morton wrote: >> >> On Fri, 4 Jul 2025 14:11:13 +0800 Baolin Wang wrote: >> >>> On 2025/7/2 13:57, Nico Pache wrote: >>>> Allow madvise_collapse to scan/collapse all mTHP orders without the >>>> strict requirement of needing the PMD-order enabled. >>>> >>>> Signed-off-by: Nico Pache >>> >>> I am afraid we should drop this patch from the series, since Hugh >>> explicitly opposed my modification of the madvise_collapse control logic >>> in this thread[1]. >> >> Well it drops easily enough. I don't know if it compiles yet. >> >> Nico, can you confirm that you're OK with the droppage and that the >> series is still good without this patch? > Yes that is fine, it shouldn't conflict at all. Although this isn't > the only patch that will need modification... Ill reply to Baolin > inline here. >> >>> Moreover, since we have not yet clarified how to handle the conflict >>> between the semantics of madvise_collapse and the THP interfaces, we >>> should keep the current logic[2] (means madvise_collapse still only >>> allows PMD collapse). > Hi Baolin, > > Sorry I saw most of that discussion but missed that point by David. > > We should come to an agreement on what the proper approach is, because > if not we'll ALWAYS have this problem and NEVER solve it (pun > intended). > > Jokes aside, if we are leaving MADV_COLLAPSE untouched then I need to > make some slight modifications to this series so that MADV_COLLAPSE > never tries anything other than PMD collapse (should be a pretty small > change). Dropping this commit alone does not achieve that, but rather > just allows MADV_COLLAPSE to work if PMD is disabled, and one other > mTHP size is enabled. On second thought this isn't great either as > MADV_COLLAPSE ignores sysfs, so if you have any mTHP size enabled, it > will still continue to collapse to other PMD+mTHP sizes... wow this > really is a mess. Yes, this is what I mentioned earlier about the conflict between MADV_COLLAPSE and mTHP collapse :( >>> If madvise_collapse is to support mTHP collapse, there will be more >>> semantic conflicts to discuss. > I guess a V9 is inevitable, I will drop mTHP support for > MADV_COLLAPSE, and drop this patch too. I'll let this series sit for a > week or so to gather reviews (and make sure nothing else is missing). Sure.