From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3C1BA2DFA32 for ; Fri, 23 Jan 2026 07:48:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769154535; cv=none; b=uHZ4D+I+1ZmtcRXSErXcwFccaF/G/xIVdX6n60x30lhkWUzebQwEUCqkKSQ2VGavIf+b4TqIA3FpXRSEFxd72P9iOrbtbghedbbutHcfHqQyuZpsEa9+Zv+aCH1aMbEkX+uhSnkqnJ1fRSo1/GfmO7axuJ1+Sgfpuat2h9TQ8p8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769154535; c=relaxed/simple; bh=omcTeKrO9aQvGiARDBJ1QyNrwyGya9clxNgUYR0NS9Y=; h=Message-ID:Date:MIME-Version:Subject:From:To:Cc:References: In-Reply-To:Content-Type; b=KCh526gB5fVQSMw5hSvYpj2zhh4jx+TTbtjDFy2EjrrodOUxKvNShUhfnvMayaL7ENcwxk4Ad2iFLkgIDQk70H9B5eDoUafW8kj+BXEZQLqXpQRLyE67ou4ijsv8aYBO3WTEGHYBPUpz6jz8JYYtg5M1NMW7i6voBD232bG+7i4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 8FB5E1476; Thu, 22 Jan 2026 23:48:45 -0800 (PST) Received: from [10.164.18.63] (MacBook-Pro.blr.arm.com [10.164.18.63]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 234223F632; Thu, 22 Jan 2026 23:48:47 -0800 (PST) Message-ID: Date: Fri, 23 Jan 2026 13:18:45 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH V3 5/5] mm/khugepaged: make khugepaged_collapse_control static From: Dev Jain To: Shivank Garg , Andrew Morton , David Hildenbrand , Lorenzo Stoakes Cc: Zi Yan , Baolin Wang , "Liam R . Howlett" , Nico Pache , Ryan Roberts , Barry Song , Lance Yang , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Wei Yang , Anshuman Khandual References: <20260118192253.9263-4-shivankg@amd.com> <20260118192253.9263-14-shivankg@amd.com> <6486c6dd-2702-4a4d-9662-09639532ce6f@arm.com> Content-Language: en-US In-Reply-To: <6486c6dd-2702-4a4d-9662-09639532ce6f@arm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 22/01/26 2:58 pm, Dev Jain wrote: > On 19/01/26 12:53 am, Shivank Garg wrote: >> The global variable 'khugepaged_collapse_control' is not used outside of >> mm/khugepaged.c. Make it static to limit its scope. >> >> Reviewed-by: Wei Yang >> Reviewed-by: Zi Yan >> Acked-by: David Hildenbrand (Red Hat) >> Reviewed-by: Anshuman Khandual >> Signed-off-by: Shivank Garg >> --- >> mm/khugepaged.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/mm/khugepaged.c b/mm/khugepaged.c >> index 1667abae6d8d..fba6aea5bea6 100644 >> --- a/mm/khugepaged.c >> +++ b/mm/khugepaged.c >> @@ -827,7 +827,7 @@ static void khugepaged_alloc_sleep(void) >> remove_wait_queue(&khugepaged_wait, &wait); >> } >> >> -struct collapse_control khugepaged_collapse_control = { >> +static struct collapse_control khugepaged_collapse_control = { >> .is_khugepaged = true, >> }; >> > Will it not be better to just remove this variable? In madvise_collapse, > we defined cc as a local variable and set .is_khugepaged = false. The > same can be done in int khugepaged() - define a local variable and set > .is_khugepaged = true. Since this patch has been stabilized already by 4 R-bs, it may be a headache to now remove this, we can do my suggestion later. Reviewed-by: Dev Jain > >