From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-180.mta1.migadu.com (out-180.mta1.migadu.com [95.215.58.180]) (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 0297433A9D0 for ; Sun, 11 Jan 2026 13:44:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768139060; cv=none; b=qiVbgzJo/ebos2FK78UDRilyxcy5ndOkewV6Wh/6czoADvpie+Iq9wwMa1I5pRFJ0qzPvRs5tNkMssa+N73Ta6XgxgZva5ZeW4JXuhIF4ggQErAgz7Fs0T9S1ovLcuf1MfyVTtpxuCf4KOS+76UjavPJNXTcz01FXzFBlDHDSoQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768139060; c=relaxed/simple; bh=ykvueONkfHCeHe92EwRwUzwapcXXDeXwJbAWXzwbxr0=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=aJVKFXv+vDrkosvGWMq1368SzQBNOKB3m3CYzQT/G859vhWvsp2qkyO4zwLcMFB+NT+Mma9xOJ3Mt1V4PjJFYvLmllOxGWt/Ap7dwgheBfvHor+oTIM9pLDL7jxgomGgkDqhxf3yKvJYOCxEnb89qKZxZMIy3lbD94ifv5WYAK0= 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=fONpD/j/; arc=none smtp.client-ip=95.215.58.180 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="fONpD/j/" Message-ID: <3bc64585-c026-4e5c-9b45-9f16035acdbc@linux.dev> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1768139057; 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=fXyszkHrXsV2533oeYCb4bMEtFrBGn71RruUhytsnjQ=; b=fONpD/j/M2HGQTi3SyhQxHUf0C4ySg2VPaDEhUK5D9rykdcjcWP5LIE41Yok2/upaqcD+y 00BS57qqyWvhb8tE1BP9J7/9Go18HCEevjrklW91ZX4zZNtLH9Mn95reB8tWcvh+lODM0+ wIwZIpxJSJ8TK0ME+RgQcIYKu2bXjro= Date: Sun, 11 Jan 2026 21:44:10 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [PATCH mm-new v4 6/6] mm: khugepaged: set to next mm direct when mm has MMF_DISABLE_THP_COMPLETELY Content-Language: en-US To: Vernon Yang Cc: lorenzo.stoakes@oracle.com, ziy@nvidia.com, dev.jain@arm.com, baohua@kernel.org, linux-mm@kvack.org, david@kernel.org, linux-kernel@vger.kernel.org, Vernon Yang , akpm@linux-foundation.org References: <20260111121909.8410-1-yanglincheng@kylinos.cn> <20260111121909.8410-7-yanglincheng@kylinos.cn> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Lance Yang In-Reply-To: <20260111121909.8410-7-yanglincheng@kylinos.cn> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT On 2026/1/11 20:19, Vernon Yang wrote: > When an mm with the MMF_DISABLE_THP_COMPLETELY flag is detected during > scanning, directly set khugepaged_scan.mm_slot to the next mm_slot, > reduce redundant operation. > > Without this patch, entering khugepaged_scan_mm_slot() next time, we > will set khugepaged_scan.mm_slot to the next mm_slot. > > With this patch, we will directly set khugepaged_scan.mm_slot to the > next mm_slot. > > Signed-off-by: Vernon Yang > --- Thanks! LGTM, so Reviewed-by: Lance Yang > mm/khugepaged.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/mm/khugepaged.c b/mm/khugepaged.c > index 8a7008760566..4c055d6c2717 100644 > --- a/mm/khugepaged.c > +++ b/mm/khugepaged.c > @@ -2566,7 +2566,7 @@ static unsigned int khugepaged_scan_mm_slot(unsigned int pages, enum scan_result > * Release the current mm_slot if this mm is about to die, or > * if we scanned all vmas of this mm. > */ > - if (hpage_collapse_test_exit(mm) || !vma) { > + if (hpage_collapse_test_exit_or_disable(mm) || !vma) { > /* > * Make sure that if mm_users is reaching zero while > * khugepaged runs here, khugepaged_exit will find