From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f180.google.com (mail-qk1-f180.google.com [209.85.222.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 72FE0320B for ; Fri, 27 Dec 2024 15:42:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735314149; cv=none; b=JBrb4CQ04Zhj1jUkkN4p+HGLx1k16Wb0xjyUMVb1GrrN8kXQ+m8+tQeTVmgfpUNhUqmXt3kk4XxZwu4d9r+hg2e+tmlsXTSINI7IOb08GOvvhQIbGWelW5F8xXNqPK3sAhp/TqtIQxtvSaQ9ugSMT09Wmnt/8eTG/pP1WAKp01c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735314149; c=relaxed/simple; bh=dcNmcW9gKEIxgIsZ955qcQSMQeb87YVBCSA6gxBqaHw=; h=From:Date:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=BkazbNStLGiVX3HL9bESpi7OWEj3fa5b6m/lqjVtbVLbV3S5oZ5dOmFMkaMzvt/H1S9egthGfdNayomfKC0LZTsgvAdeyrzagtKycxuDdXIpoVqGbpcny024+WAmqSoTNabPpKg60WXRYXKp6DKzYoyROnSM9rf+H0wIJ68cgRI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=gourry.net; spf=pass smtp.mailfrom=gourry.net; dkim=pass (2048-bit key) header.d=gourry.net header.i=@gourry.net header.b=AMO2nsAK; arc=none smtp.client-ip=209.85.222.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=gourry.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gourry.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gourry.net header.i=@gourry.net header.b="AMO2nsAK" Received: by mail-qk1-f180.google.com with SMTP id af79cd13be357-7b6e9586b82so578157685a.1 for ; Fri, 27 Dec 2024 07:42:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gourry.net; s=google; t=1735314146; x=1735918946; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:date:from:from:to:cc:subject:date:message-id:reply-to; bh=ih3mv9HhVP9CuyhCNc0pl6V10JcWKow1s537mrauqXk=; b=AMO2nsAKoAnf4AvL8RmWKgmAA73rCaJKuCjAEUl4ikL73KCmZsO10njY0LGAgg5W41 93uScoWmTpTibe8lfYnMu5WOOeLX76QWe09m0QVCiugmGRLEks3O1P12BQChC4IGgY+/ +4RErK/mwe7lJ5pPzJbtPzDl6KoNPDI08ZckJQ8jsvXuk4tXEroEAAz+1No1HvXAbGpD ht3Qgwd01L+hXMvqlX/hP0rjaF8JWuxyidgiv53+7uvqy1d/qDq7jVT4FncYkLKZ8uSu EiW4xeIA8IQjCK8jpiASAMzHqp7eiwCq3EqidaGgFjFjs0RKama33criWX9YX7FoOWIu gr8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735314146; x=1735918946; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:date:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=ih3mv9HhVP9CuyhCNc0pl6V10JcWKow1s537mrauqXk=; b=wWTeaTipsPu9KAfwVXJAt+VkN3pT9L+/C3b2jG1m4v4kZQtVpr8BNlAK8J33N1bawa 6Gd6kx83Uhudu7bxsqCUkSaE2QP5hl3xY2kItHLjU7axPzlaVXBLLjZ/jTRvL/5W3irt R4+Ndo6oH146GAqId3xMn+3mx+EyB6XqG+jm2OrjXH3UiKfE/yALJrM55jMGwR8212ML yNW02bsJJBJNbSLj6b7aoqaKs1YtQF22w+ZFLZGO+LCtnYR0nKGy5Dw2MZehgVZKrZe9 +o6J7909byYP+ND+f80VyX/oJhQQWhV/e+NDZK/8h51yXUfvwc7HwUwpsOTRNg77avDQ rjkQ== X-Forwarded-Encrypted: i=1; AJvYcCXPU32HMAOPVCXgKvEpljwA898gMZBeChARMMs7SJ4kPWmOzcDRbfxyKZ8VXLzsrrCSioTWKo5LRLTHrQE=@vger.kernel.org X-Gm-Message-State: AOJu0YxpoxmfsJEeOeW1ybPZfa4/xd06T5N/rOnhI/JjQ3Y5htdaCA3W w44dUx9dnbYU9YqUyxbNfPrWMyZ1/HD/w7IgOC1XkNhvCzfvw8FS/CF+EZkqOJk= X-Gm-Gg: ASbGncs6HsJjq+pDZATQNurQrIW3gljbujDma4/WW4iO9kHSlMaQxteeIV7jFH8Pnks eesKw3OnCzNUdh6J1ycm1lpo/HaZr0TAQb/m6f57bbkMh05y28046HWk0E8NWMsKwHkHe/gfJvI NyoaPQ9A3b1ntwGHylTOZSBZTEkj6CwgK929bEnZArkk7HneRl2t5fos9iddOVRkgUhd6VmK4Xw L1u+Y0hs1A60v2dq3dNlR4Mp2uvl2M7iCQFej9gf0KeKT3W0F4evfQTyDp5bvv5gFMC2ZkyFLtK CpDmJfMRJ81ECIn2jxyRILGgyPzV8pjaYcmQZ7Y+mDSrNz/fyLJn/Fw= X-Google-Smtp-Source: AGHT+IEfI7GoNj8KLtAf3kiu7j17ni1bm+HixLrZEXhKIduco4r8v7iiMipIdhUhBo7cD7mFEFv3iw== X-Received: by 2002:a05:620a:240d:b0:7b6:eb12:d732 with SMTP id af79cd13be357-7b9ba83f593mr5201358485a.61.1735314146407; Fri, 27 Dec 2024 07:42:26 -0800 (PST) Received: from gourry-fedora-PF4VCD3F (pool-173-79-56-208.washdc.fios.verizon.net. [173.79.56.208]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7b9ac2dfeaesm702998485a.40.2024.12.27.07.42.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Dec 2024 07:42:26 -0800 (PST) From: Gregory Price X-Google-Original-From: Gregory Price Date: Fri, 27 Dec 2024 10:42:24 -0500 To: Donet Tom Cc: Gregory Price , 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 Subject: Re: [RFC v2 PATCH 2/5] memory: move conditionally defined enums use inside ifdef tags Message-ID: References: <20241210213744.2968-1-gourry@gourry.net> <20241210213744.2968-3-gourry@gourry.net> <0dd42f11-2c2d-4fab-a115-2b0c8c69952d@linux.ibm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0dd42f11-2c2d-4fab-a115-2b0c8c69952d@linux.ibm.com> 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. ~Gregory