From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-171.mta0.migadu.com (out-171.mta0.migadu.com [91.218.175.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A3CA1426D16; Thu, 26 Feb 2026 15:53:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772121238; cv=none; b=H6WVvkdcZ9ba4WIGCqmiOB1/0m41qcAK4oMRRcPON2FyWMbo98cynCZoHvTxvKfi8bnNBgIV3l1LIxYskgk4lL/bBcF36ltxrpoXmaYT3a3IA9occ0lFZOQkxvssErhEu1puhgFNVdplfzcqbjktwTK1atSunBO25HD8Y1e6X/g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772121238; c=relaxed/simple; bh=7qOousIx56QKmH/mF2Jhpn3RYTANh5hPh6Mkghrjn0I=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=kLBk9wBf4biGaj3Vdui/ivc7cZDaElWKXpOFanFT7rgth+xdYoi0P5CI1I+XxQRz8pSBkwLoD1Cpndb9VEgF6anWZdh59UTmNYVng0sd1zsJHInJ86jPzqyFw/p236K3LeseOkyEVeoGNoVTJPT82Wq07HRQ7sFNn72oNLDt+a8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=Wc4zCWkI; arc=none smtp.client-ip=91.218.175.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="Wc4zCWkI" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1772121226; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xU/P/E3V8lwPxXOwsXyNuPVZtz8N/+iRJGqIf9l5sxM=; b=Wc4zCWkIgS5XtJECh5aP5VvL9yKzmdpAhKr4PRV3POE5wHpRbD6H94TOtEmbaEVtkxtXws oskHPmMw2POJ8xoJSPtCb2TUCMhPX/nKsJ+2R1cMI2eIiuLXW11sH5+DbgyYJtvlcyA+ih J5G33RbH6BBx/N4/J71ODoeh7VIN34A= From: Usama Arif To: Nico Pache Cc: Usama Arif , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-trace-kernel@vger.kernel.org, akpm@linux-foundation.org, anshuman.khandual@arm.com, apopple@nvidia.com, baohua@kernel.org, baolin.wang@linux.alibaba.com, byungchul@sk.com, catalin.marinas@arm.com, cl@gentwo.org, corbet@lwn.net, dave.hansen@linux.intel.com, david@kernel.org, dev.jain@arm.com, gourry@gourry.net, hannes@cmpxchg.org, hughd@google.com, jack@suse.cz, jackmanb@google.com, jannh@google.com, jglisse@google.com, joshua.hahnjy@gmail.com, kas@kernel.org, lance.yang@linux.dev, Liam.Howlett@oracle.com, lorenzo.stoakes@oracle.com, mathieu.desnoyers@efficios.com, matthew.brost@intel.com, mhiramat@kernel.org, mhocko@suse.com, peterx@redhat.com, pfalcato@suse.de, rakie.kim@sk.com, raquini@redhat.com, rdunlap@infradead.org, richard.weiyang@gmail.com, rientjes@google.com, rostedt@goodmis.org, rppt@kernel.org, ryan.roberts@arm.com, shivankg@amd.com, sunnanyong@huawei.com, surenb@google.com, thomas.hellstrom@linux.intel.com, tiwai@suse.de, usamaarif642@gmail.com, vbabka@suse.cz, vishal.moola@gmail.com, wangkefeng.wang@huawei.com, will@kernel.org, willy@infradead.org, yang@os.amperecomputing.com, ying.huang@linux.alibaba.com, ziy@nvidia.com, zokeefe@google.com Subject: Re: [PATCH mm-unstable v15 12/13] mm/khugepaged: run khugepaged for all orders Date: Thu, 26 Feb 2026 07:53:31 -0800 Message-ID: <20260226155334.3373953-1-usama.arif@linux.dev> In-Reply-To: <20260226032650.234386-1-npache@redhat.com> References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT On Wed, 25 Feb 2026 20:26:50 -0700 Nico Pache wrote: > From: Baolin Wang > > If any order (m)THP is enabled we should allow running khugepaged to > attempt scanning and collapsing mTHPs. In order for khugepaged to operate > when only mTHP sizes are specified in sysfs, we must modify the predicate > function that determines whether it ought to run to do so. > > This function is currently called hugepage_pmd_enabled(), this patch > renames it to hugepage_enabled() and updates the logic to check to > determine whether any valid orders may exist which would justify > khugepaged running. > > We must also update collapse_allowable_orders() to check all orders if > the vma is anonymous and the collapse is khugepaged. > > After this patch khugepaged mTHP collapse is fully enabled. > > Signed-off-by: Baolin Wang > Signed-off-by: Nico Pache > --- > mm/khugepaged.c | 30 ++++++++++++++++++------------ > 1 file changed, 18 insertions(+), 12 deletions(-) > Acked-by: Usama Arif