From: "Martin J. Bligh" <mbligh@aracnet.com> To: Linus Torvalds <torvalds@osdl.org>, Keith Mannthey <kmannth@us.ibm.com> Cc: Andrew Morton <akpm@osdl.org>, "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, linux-mm@kvack.org Subject: Re: [Bugme-new] [Bug 2019] New: Bug from the mm subsystem involving X (fwd) Date: Thu, 05 Feb 2004 23:19:28 -0800 [thread overview] Message-ID: <99000000.1076051967@[10.10.2.4]> (raw) In-Reply-To: <98220000.1076051821@[10.10.2.4]> Fix pfn_valid for architctures with discontiguous memory. This only changes the NUMA definition, and it leaves the NUMA-Q definition as was, because it's faster that way, it's in hotpaths, and our memory is always contiguous. diff -aurpN -X /home/fletch/.diff.exclude pfn_to_nid/include/asm-i386/mmzone.h pfn_valid/include/asm-i386/mmzone.h --- pfn_to_nid/include/asm-i386/mmzone.h Thu Feb 5 20:58:00 2004 +++ pfn_valid/include/asm-i386/mmzone.h Thu Feb 5 22:08:57 2004 @@ -121,14 +121,19 @@ static inline struct pglist_data *pfn_to + __zone->zone_start_pfn; \ }) #define pmd_page(pmd) (pfn_to_page(pmd_val(pmd) >> PAGE_SHIFT)) -/* - * pfn_valid should be made as fast as possible, and the current definition - * is valid for machines that are NUMA, but still contiguous, which is what - * is currently supported. A more generalised, but slower definition would - * be something like this - mbligh: - * ( pfn_to_pgdat(pfn) && ((pfn) < node_end_pfn(pfn_to_nid(pfn))) ) - */ + +#ifdef CONFIG_X86_NUMAQ /* we have contiguous memory on NUMA-Q */ #define pfn_valid(pfn) ((pfn) < num_physpages) +#else +static inline int pfn_valid(int pfn) +{ + int nid = pfn_to_nid(pfn); + + if (nid >= 0) + return (pfn < node_end_pfn(nid)); + return 0; +} +#endif extern int get_memcfg_numa_flat(void ); /*
WARNING: multiple messages have this Message-ID (diff)
From: "Martin J. Bligh" <mbligh@aracnet.com> To: Linus Torvalds <torvalds@osdl.org>, Keith Mannthey <kmannth@us.ibm.com> Cc: Andrew Morton <akpm@osdl.org>, "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, linux-mm@kvack.org Subject: Re: [Bugme-new] [Bug 2019] New: Bug from the mm subsystem involving X (fwd) Date: Thu, 05 Feb 2004 23:19:28 -0800 [thread overview] Message-ID: <99000000.1076051967@[10.10.2.4]> (raw) In-Reply-To: <98220000.1076051821@[10.10.2.4]> Fix pfn_valid for architctures with discontiguous memory. This only changes the NUMA definition, and it leaves the NUMA-Q definition as was, because it's faster that way, it's in hotpaths, and our memory is always contiguous. diff -aurpN -X /home/fletch/.diff.exclude pfn_to_nid/include/asm-i386/mmzone.h pfn_valid/include/asm-i386/mmzone.h --- pfn_to_nid/include/asm-i386/mmzone.h Thu Feb 5 20:58:00 2004 +++ pfn_valid/include/asm-i386/mmzone.h Thu Feb 5 22:08:57 2004 @@ -121,14 +121,19 @@ static inline struct pglist_data *pfn_to + __zone->zone_start_pfn; \ }) #define pmd_page(pmd) (pfn_to_page(pmd_val(pmd) >> PAGE_SHIFT)) -/* - * pfn_valid should be made as fast as possible, and the current definition - * is valid for machines that are NUMA, but still contiguous, which is what - * is currently supported. A more generalised, but slower definition would - * be something like this - mbligh: - * ( pfn_to_pgdat(pfn) && ((pfn) < node_end_pfn(pfn_to_nid(pfn))) ) - */ + +#ifdef CONFIG_X86_NUMAQ /* we have contiguous memory on NUMA-Q */ #define pfn_valid(pfn) ((pfn) < num_physpages) +#else +static inline int pfn_valid(int pfn) +{ + int nid = pfn_to_nid(pfn); + + if (nid >= 0) + return (pfn < node_end_pfn(nid)); + return 0; +} +#endif extern int get_memcfg_numa_flat(void ); /* -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"aart@kvack.org"> aart@kvack.org </a>
next prev parent reply other threads:[~2004-02-06 7:20 UTC|newest] Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top 2004-02-04 23:17 [Bugme-new] [Bug 2019] New: Bug from the mm subsystem involving X (fwd) Martin J. Bligh 2004-02-04 23:17 ` Martin J. Bligh 2004-02-04 23:58 ` Linus Torvalds 2004-02-04 23:58 ` Linus Torvalds 2004-02-05 0:12 ` Martin J. Bligh 2004-02-05 0:12 ` Martin J. Bligh 2004-02-05 0:36 ` Martin J. Bligh 2004-02-05 0:36 ` Martin J. Bligh 2004-02-05 0:43 ` Linus Torvalds 2004-02-05 0:43 ` Linus Torvalds 2004-02-05 0:56 ` Andrew Morton 2004-02-05 0:56 ` Andrew Morton 2004-02-05 1:29 ` Linus Torvalds 2004-02-05 1:29 ` Linus Torvalds 2004-02-05 1:56 ` Keith Mannthey 2004-02-05 1:56 ` Keith Mannthey 2004-02-05 2:04 ` Linus Torvalds 2004-02-05 2:04 ` Linus Torvalds 2004-02-05 2:33 ` Keith Mannthey 2004-02-05 2:33 ` Keith Mannthey 2004-02-05 2:47 ` Linus Torvalds 2004-02-05 2:47 ` Linus Torvalds 2004-02-06 7:17 ` Martin J. Bligh 2004-02-06 7:17 ` Martin J. Bligh 2004-02-06 7:19 ` Martin J. Bligh [this message] 2004-02-06 7:19 ` Martin J. Bligh 2004-02-06 9:57 ` Dave Hansen 2004-02-06 9:57 ` Dave Hansen 2004-02-06 15:49 ` Martin J. Bligh 2004-02-06 15:49 ` Martin J. Bligh 2004-02-06 17:22 ` Dave Hansen 2004-02-06 17:22 ` Dave Hansen 2004-02-06 19:59 ` Martin J. Bligh 2004-02-06 19:59 ` Martin J. Bligh 2004-02-06 20:16 ` Linus Torvalds 2004-02-06 20:16 ` Linus Torvalds 2004-02-06 21:18 ` Martin J. Bligh 2004-02-06 21:18 ` Martin J. Bligh [not found] <51080000.1075936626@flay.suse.lists.linux.kernel> [not found] ` <Pine.LNX.4.58.0402041539470.2086@home.osdl.org.suse.lists.linux.kernel> [not found] ` <60330000.1075939958@flay.suse.lists.linux.kernel> [not found] ` <64260000.1075941399@flay.suse.lists.linux.kernel> [not found] ` <Pine.LNX.4.58.0402041639420.2086@home.osdl.org.suse.lists.linux.kernel> [not found] ` <20040204165620.3d608798.akpm@osdl.org.suse.lists.linux.kernel> [not found] ` <Pine.LNX.4.58.0402041719300.2086@home.osdl.org.suse.lists.linux.kernel> [not found] ` <1075946211.13163.18962.camel@dyn318004bld.beaverton.ibm.com.suse.lists.linux.kernel> [not found] ` <Pine.LNX.4.58.0402041800320.2086@home.osdl.org.suse.lists.linux.kernel> [not found] ` <98220000.1076051821@[10.10.2.4].suse.lists.linux.kernel> [not found] ` <1076061476.27855.1144.camel@nighthawk.suse.lists.linux.kernel> [not found] ` <5450000.1076082574@[10.10.2.4].suse.lists.linux.kernel> [not found] ` <1076088169.29478.2928.camel@nighthawk.suse.lists.linux.kernel> [not found] ` <218650000.1076097590@flay.suse.lists.linux.kernel> [not found] ` <Pine.LNX.4.58.0402061215030.30672@home.osdl.org.suse.lists.linux.kernel> [not found] ` <220850000.1076102320@flay.suse.lists.linux.kernel> 2004-02-07 3:54 ` Andi Kleen 2004-02-07 4:49 ` Martin J. Bligh 2004-02-07 5:21 ` Andi Kleen 2004-02-07 6:37 ` Nick Piggin 2004-02-07 7:31 ` Martin J. Bligh
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to='99000000.1076051967@[10.10.2.4]' \ --to=mbligh@aracnet.com \ --cc=akpm@osdl.org \ --cc=kmannth@us.ibm.com \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-mm@kvack.org \ --cc=torvalds@osdl.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.