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 E9F57C71130 for ; Tue, 8 Jul 2025 04:37:38 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 73ADC6B03AB; Tue, 8 Jul 2025 00:37:38 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 712BA6B03AC; Tue, 8 Jul 2025 00:37:38 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 64FAA6B03AD; Tue, 8 Jul 2025 00:37:38 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 571306B03AB for ; Tue, 8 Jul 2025 00:37:38 -0400 (EDT) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 14BA659198 for ; Tue, 8 Jul 2025 04:37:38 +0000 (UTC) X-FDA: 83639838996.27.E31FEDB Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf27.hostedemail.com (Postfix) with ESMTP id CF15540009 for ; Tue, 8 Jul 2025 04:37:35 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Q7Qv10m8; spf=pass (imf27.hostedemail.com: domain of npache@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=npache@redhat.com; dmarc=pass (policy=quarantine) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1751949455; 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=Vcnyx0JysJh5mE8hUE/Z7n/Nl7TxrgUShK09fRyB/o0=; b=DJK0xNydyfk6DJ0ARHeIhyUlwk9p0kGCWs6JyBsiTv8sTP5MWZYg1oOQP3thOVgx3CNAp+ m4c7FE1CVQt5TzcwpN4AZ0qPywK3AFH23QUlB/a9YTmQ00PzTCkiHd9gPRG6RC3sfF/oVO +4tu2ZFSzncGHsVNsX8f6+fKrZY6vEQ= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Q7Qv10m8; spf=pass (imf27.hostedemail.com: domain of npache@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=npache@redhat.com; dmarc=pass (policy=quarantine) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1751949455; a=rsa-sha256; cv=none; b=hz5Av/9CbKLXZaQ9fxqxPyWiuVRAc2OD7Z5iwOc7yvCPFCeHYe88JzQz2LjzevWIvWHuoB x+KP9AHqsbnVfouSxD3Oi1Y9HeBmLXMGVHTzmp1UejyX0C5bWanLwssqSGuwAWra2z7L2p BquI55gZWDhs10mzMgNc87wkGmW+zz0= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1751949455; h=from:from: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=Vcnyx0JysJh5mE8hUE/Z7n/Nl7TxrgUShK09fRyB/o0=; b=Q7Qv10m83IeHeKw20lxnxzLfPQG7F59Jyz5Yo0QsIfzRv19b2xvaJ1wkORz+ZJb3wYqeyq mVPtCtOqmnVwGLg4BGqx9Zndo/OmCi8uRHU3lmYRtI/J8iOnLrfysCbs0RlWlwks8AhrV4 nHGzcWx5y0PqTInVYAdkwXicOp5++rE= Received: from mail-yw1-f200.google.com (mail-yw1-f200.google.com [209.85.128.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-57-NW6JbavXOMWfQti60Il4cQ-1; Tue, 08 Jul 2025 00:37:33 -0400 X-MC-Unique: NW6JbavXOMWfQti60Il4cQ-1 X-Mimecast-MFC-AGG-ID: NW6JbavXOMWfQti60Il4cQ_1751949453 Received: by mail-yw1-f200.google.com with SMTP id 00721157ae682-70e86a2a1b8so54280697b3.1 for ; Mon, 07 Jul 2025 21:37:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751949453; x=1752554253; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Vcnyx0JysJh5mE8hUE/Z7n/Nl7TxrgUShK09fRyB/o0=; b=lIth7zdhvEa4NvlViyNW+t3Vc388eOXfradHbxK5iRjc8+LYCk7bO+uoAwNV186dhi VK77rBGgsKvim89Ew7YfyMFrBIRD5hml036uQUap3zByMvEOJQb3CyaY6kiApioGQgnE t61pXfQEMWRx0s0kF8u6HiYo8Xto5948qdA6afRka9kHhrDEQDzHaN37Y8uWvpqBRzkq +692c1laKhlC7+r42N7D+LAmDnUY7PxRdOYahDEaeaW+uIlbuVHZd5VGFBD40LgPstBM Vfrr4/TE91cbtpl54ugvK2b8VYgOYRFdtLc+UpgoKGn04mN40ViRUWVqyOL/1U0LzNwe E16g== X-Gm-Message-State: AOJu0YwM0aIsyj4LREEEnmvvsmLyNl7je/CiEn+KZ46vBLzq14/mgh/4 h/6YGSKO3djDE7CVWayu94tNNhBMlkDQQfUhppLKip583JX7ra4mi0U0DF5j/+6VxAlhF9LLUF4 zeiTxXQHfkyZhjJsPKKMKJkKrFGUp4a+SXFHi+s+DRrebrJ9mzjIl7iC1j/YgWlYeY6Saxjqc3G p1TIOG1+wF+ONvEMaKmIx1SJFC/nQ= X-Gm-Gg: ASbGnctXINoB18Hw9wDx3J1sbmYTeNJEVt99U3bV3EbqVXypvm4Vrn9WjFChoEHWLnC B3eQGwqLqrtFBVJVUS9TiKR/En+vk+WgWpDZ067g81poVNFT9qmwsBM4bv1tWnCwVQiyNd52Ts2 nNZzpBGA== X-Received: by 2002:a05:690c:6f83:b0:70f:751c:2d8a with SMTP id 00721157ae682-7179e37cd3fmr32458587b3.3.1751949452971; Mon, 07 Jul 2025 21:37:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEbO6Izd1pPXIOqZntc0uu12GmXD8DRIghOcq4/FPxcWuJc0kOyYzeWaxrjFUAr/IBNtPUh2LiSWdlv1rQ3kY4= X-Received: by 2002:a05:690c:6f83:b0:70f:751c:2d8a with SMTP id 00721157ae682-7179e37cd3fmr32458287b3.3.1751949452399; Mon, 07 Jul 2025 21:37:32 -0700 (PDT) MIME-Version: 1.0 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> In-Reply-To: <20250704141422.359c89146ad69512b9be4902@linux-foundation.org> From: Nico Pache Date: Mon, 7 Jul 2025 22:37:06 -0600 X-Gm-Features: Ac12FXyt1IXC4VHFfBXrxUd6UW59TrJJWs8JdbZTinihEwjJ8-ZwuAsNadFXc9I Message-ID: Subject: Re: [PATCH v8 11/15] khugepaged: allow madvise_collapse to check all anonymous mTHP orders To: Andrew Morton , Baolin Wang , 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 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 84yRRR-mEZGjcB5U9DUCE50Rrxf62z0Y6WhLY2INBz0_1751949453 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Stat-Signature: ynpsft61i7bm8k7maa6ju5nd7xizk111 X-Rspamd-Queue-Id: CF15540009 X-Rspamd-Server: rspam11 X-Rspam-User: X-HE-Tag: 1751949455-919597 X-HE-Meta: U2FsdGVkX1+TqyNTGXr1WkpU0GlLooWT1Y59zjhbrDu2QNdnu5hgahtBc5MR2KpuNb7EwwlCkxWqYOVKM8+tUP6lO7Ws/hWoAsM/gugcTaK6/797GLA7Rb5KvKCVmVZ6FsAOm8U/YV6GEO1wQ3fWVmcdf6mFkrZAPizoZAjIrk6AsBqZoh4lb0eeu47gKBNCYCwCxvjzbncyJ3Ho8kJyaaV+1apWC+xHQDsxxTvanAZDwBoou1TN47bf5uKk1BM2yvB7dd5F7aZNqV/Vz1Ywhbkjc49uO3cr7aapacpLpVgurpnut6AE5l1WhTXR7BkXi5V2OAIflr0T/hNKrYtc1601qmqF13u7e01AFDIWCaxOmETRa6FB9raCYJqRMi44kuYMKKZo+QJkK/Oh+UCM0YB1KHy3bBFK47N0xmqKcQ3iZvmGyeeARt+C0zn1ljQ5aJSeZ+/9B/QoQEkxQm5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owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Fri, Jul 4, 2025 at 3:14=E2=80=AFPM 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 logi= c > > 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. > > > > 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). Thanks, -- Nico > > > > [1] > > https://lore.kernel.org/all/cover.1750815384.git.baolin.wang@linux.alib= aba.com/ > > [2] > > https://lore.kernel.org/all/23b8ad10-cd1f-45df-a25c-78d01c8af44f@redhat= .com/ >