From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (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 A283417D358 for ; Sun, 29 Dec 2024 14:49:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.156.1 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735483799; cv=none; b=baz4iiAubwoGqm60qeVjTY53YynS/f2F8zWG/bs/mfoWOyChbLiWZtguZneUUmEyxqOPUEU1yg0lkPKtFqwXePfCq/+Ng0H4TE4ibpf+aMTlHyTeUC7XMFmzF9WpqsCC/ev1VrbVb/OmgpfspfyUZKi4ZuPjBctkq7RJFWMMB4I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735483799; c=relaxed/simple; bh=m5mvO90UkEHsTOXP7NxXzbfRIi6oKNCx0AHTrU1Bjos=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=cZ2h5aNiLN3ez2HXkB5WNP9q2zY3QWfJqP9yXrnOhfg31kfVQfMI54vVVAzb8bxF7dz51aoFno78yQLS4z+ZK6W7c4juJXcdbF5sqKCb10QH+U7+2x3k2Y3M8w3rYg5wTPMaklvdReh0Dc+Ik7nYahs1Mssc1eu86eyMXhcosiM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com; spf=pass smtp.mailfrom=linux.ibm.com; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b=oH0RGIUi; arc=none smtp.client-ip=148.163.156.1 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="oH0RGIUi" Received: from pps.filterd (m0353729.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4BTCtTE6002331; Sun, 29 Dec 2024 14:49:47 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pp1; bh=Jmmdn/ 7p2oOAdnUqz2b+deV6dKq5cygorUEsF3loJhY=; b=oH0RGIUiYkWoIdM9I6749g 5t1/pnqlhCvpmbxiTuEPAmUSGD7FNO1qQrcvPGSxcF/ulk9zeIIEVehv8hDak1o7 JASXPZzLJY0MQLQbNOZ882ante0bzc8lOZATy/sLiFHSBgplyirPp3H3yJ4FpzbE c4Jmbsa5o0clv+zcdkn9RPk/3Vnk0MnboZmN3bC4ccSqbx49hREEyrSyeFdxDHV4 TrPgi4ljPl+uPN+XkJslKm1IfBNxzNbARGhIrrPVqKtC2v1RIdSRAE9PLV7jlUTK 0Ob1UU4M7BudW1G2mqofXzosca1dJAIm6+tmjYaNEnyRTA/ENFB4S3uhSlQfEcwA == Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 43tufh1rr7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 29 Dec 2024 14:49:47 +0000 (GMT) Received: from m0353729.ppops.net (m0353729.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 4BTEnkfO018917; Sun, 29 Dec 2024 14:49:46 GMT Received: from ppma22.wdc07v.mail.ibm.com (5c.69.3da9.ip4.static.sl-reverse.com [169.61.105.92]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 43tufh1rr4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 29 Dec 2024 14:49:46 +0000 (GMT) Received: from pps.filterd (ppma22.wdc07v.mail.ibm.com [127.0.0.1]) by ppma22.wdc07v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 4BTCtNZ8014022; Sun, 29 Dec 2024 14:49:45 GMT Received: from smtprelay04.wdc07v.mail.ibm.com ([172.16.1.71]) by ppma22.wdc07v.mail.ibm.com (PPS) with ESMTPS id 43tv1xt1nx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 29 Dec 2024 14:49:45 +0000 Received: from smtpav06.wdc07v.mail.ibm.com (smtpav06.wdc07v.mail.ibm.com [10.39.53.233]) by smtprelay04.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 4BTEnjKf24773304 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 29 Dec 2024 14:49:45 GMT Received: from smtpav06.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0457D5804E; Sun, 29 Dec 2024 14:49:45 +0000 (GMT) Received: from smtpav06.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7AA4C5803F; Sun, 29 Dec 2024 14:49:37 +0000 (GMT) Received: from [9.171.1.162] (unknown [9.171.1.162]) by smtpav06.wdc07v.mail.ibm.com (Postfix) with ESMTP; Sun, 29 Dec 2024 14:49:37 +0000 (GMT) Message-ID: Date: Sun, 29 Dec 2024 20:19:35 +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: [RFC v2 PATCH 2/5] memory: move conditionally defined enums use inside ifdef tags To: Gregory Price Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, nehagholkar@meta.com, abhishekd@meta.com, kernel-team@meta.com, david@redhat.com, nphamcs@gmail.com, akpm@linux-foundation.org, hannes@cmpxchg.org, kbusch@meta.com, ying.huang@linux.alibaba.com References: <20241210213744.2968-1-gourry@gourry.net> <20241210213744.2968-3-gourry@gourry.net> <0dd42f11-2c2d-4fab-a115-2b0c8c69952d@linux.ibm.com> Content-Language: en-US From: Donet Tom In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: d3e_xt10yArlPLHGO8pj9JJQEteTsB-5 X-Proofpoint-GUID: joIcTg25mHpFaD9E1r8jzJR9gjZYDYRR X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.62.30 definitions=2024-10-15_01,2024-10-11_01,2024-09-30_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 phishscore=0 malwarescore=0 adultscore=0 priorityscore=1501 clxscore=1015 mlxlogscore=889 spamscore=0 mlxscore=0 lowpriorityscore=0 bulkscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2411120000 definitions=main-2412290129 On 12/27/24 21:12, Gregory Price wrote: > On Fri, Dec 27, 2024 at 04:04:05PM +0530, Donet Tom wrote: >> On 12/11/24 03:07, Gregory Price wrote: >>> NUMA_HINT_FAULTS and NUMA_HINT_FAULTS_LOCAL are only defined if >>> CONFIG_NUMA_BALANCING is defined, but are used outside the tags in >>> numa_migrate_check(). Fix this. >>> >>> TNF_SHARED is only used if CONFIG_NUMA_BALANCING is enabled, so >>> moving this line inside the ifdef is also safe - despite use of TNF_* >>> elsewhere in the function. TNF_* are not conditionally defined. >>> >>> Signed-off-by: Gregory Price >>> --- >>> mm/memory.c | 4 ++-- >>> 1 file changed, 2 insertions(+), 2 deletions(-) >>> >>> diff --git a/mm/memory.c b/mm/memory.c >>> index 83fd35c034d7..6ad7616918c4 100644 >>> --- a/mm/memory.c >>> +++ b/mm/memory.c >>> @@ -5573,14 +5573,14 @@ int numa_migrate_check(struct folio *folio, struct vm_fault *vmf, >>> /* Record the current PID acceesing VMA */ >>> vma_set_access_pid_bit(vma); >>> - count_vm_numa_event(NUMA_HINT_FAULTS); >>> #ifdef CONFIG_NUMA_BALANCING >> IIUC,|do_huge_pmd_numa_page|() and|do_numa_page()| are executed only if >> |CONFIG_NUMA_BALANCING| is enabled (|pte_protnone()| and|pmd_protnone()| >> return 0 if|CONFIG_NUMA_BALANCING| is disabled). >> >> Given this, do we still need the|#ifdef|? >> > the NUMA_HINT_FAULTS stuff is only defined if CONFIG_NUMA_BALANCING is > built. > > The ifdefs around some of this code is a bit inconsistent, it's > probably worth a separate line to try to clean it up. Sure. Thank you. > > ~Gregory