From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752515AbbIOCIJ (ORCPT ); Mon, 14 Sep 2015 22:08:09 -0400 Received: from e37.co.us.ibm.com ([32.97.110.158]:49023 "EHLO e37.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751964AbbIOCII (ORCPT ); Mon, 14 Sep 2015 22:08:08 -0400 X-Helo: d03dlp03.boulder.ibm.com X-MailFrom: raghavendra.kt@linux.vnet.ibm.com X-RcptTo: linux-kernel@vger.kernel.org From: Raghavendra K T To: , , , , Cc: , , , , , , , , Subject: [PATCH V2 0/2] Replace nr_node_ids for loop with for_each_node Date: Tue, 15 Sep 2015 07:38:35 +0530 Message-Id: <1442282917-16893-1-git-send-email-raghavendra.kt@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.11.7 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15091502-0025-0000-0000-00001CAEB49B Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Many places in the kernel use 'for' loop with nr_node_ids. For the architectures which supports sparse numa ids, this will result in some unnecessary allocations for non existing nodes. (for e.g., numa node numbers such as 0,1,16,17 is common in powerpc.) So replace the for loop with for_each_node so that allocations happen only for existing numa nodes. Please note that, though there are many places where nr_node_ids is used, current patchset uses for_each_node only for slowpath to avoid find_next_bit traversal. Changes in V2: - Take memcg_aware check outside for_each loop (Vldimir) - Add comment that node 0 should always be present (Vladimir) Raghavendra K T (2): mm: Replace nr_node_ids for loop with for_each_node in list lru powerpc:numa Do not allocate bootmem memory for non existing nodes arch/powerpc/mm/numa.c | 2 +- mm/list_lru.c | 34 +++++++++++++++++++++++----------- 2 files changed, 24 insertions(+), 12 deletions(-) -- 1.7.11.7