linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* 2.4: why is NR_GFPINDEX so large?
@ 2000-06-21 19:48 Timur Tabi
  2000-06-21 19:56 ` Kanoj Sarcar
  0 siblings, 1 reply; 24+ messages in thread
From: Timur Tabi @ 2000-06-21 19:48 UTC (permalink / raw)
  To: Linux MM mailing list

In mmzone.h, NR_GFPINDEX is set to 0x100.  This means that the node_zonelists
array in pg_data_t has 256 elements.  However, then we have code like this in
mm.h:

static inline struct page * alloc_pages(int gfp_mask, unsigned long order)
{
[snip]
	return __alloc_pages(contig_page_data.node_zonelists+(gfp_mask), order);
}

gfp_mask is any combination of any of these flags (from mm.h):

#define __GFP_WAIT	0x01
#define __GFP_HIGH	0x02
#define __GFP_IO	0x04
#define __GFP_DMA	0x08
#define __GFP_HIGHMEM	0x10

Which means theorectically, the largest value is 0x1F, or 31.  This means that
elements 32-255 of array node_zonelists are never accessed.  Can someone explain
this to me?



--
Timur Tabi - ttabi@interactivesi.com
Interactive Silicon - http://www.interactivesi.com

When replying to a mailing-list message, please don't cc: me, because then I'll just get two copies of the same message.
--
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.eu.org/Linux-MM/

^ permalink raw reply	[flat|nested] 24+ messages in thread
* Re: 2.4: why is NR_GFPINDEX so large?
@ 2000-06-21 21:15 frankeh
  0 siblings, 0 replies; 24+ messages in thread
From: frankeh @ 2000-06-21 21:15 UTC (permalink / raw)
  To: Timur Tabi; +Cc: Linux MM mailing list

Timur...

If [A] is located on the same cacheline as frequently accessed readonly
data, and [A] is written frequently on other processors, e.g a frequently
used lock, then in order to write to the cacheline, write access must be
obtained, which will lead to a global cache line invalidate. If [A] is now
accessed again, then the read permissions have to be obtained and the
cacheline has to be transferred back from another processor. These
interprocessor  cacheline transfers can be expensive operations. When you
go up to NUMA machines this will be even more.

Hope this helps, otherwise keep pounding..

-- Hubertus


Timur Tabi <ttabi@interactivesi.com>@kvack.org on 06/21/2000 04:59:51 PM

Sent by:  owner-linux-mm@kvack.org


To:   Linux MM mailing list <linux-mm@kvack.org>
cc:
Subject:  Re: 2.4: why is NR_GFPINDEX so large?



** Reply to message from Kanoj Sarcar <kanoj@google.engr.sgi.com> on Wed,
21
Jun 2000 13:49:56 -0700 (PDT)


> Yes, this is saying that although we waste physical memory (which few
> people care about any more), some of the unused space is never cached,
> since it is not accessed (although hardware processor prefetches might
> change this assumption a little bit). So, valuable cache space is not
> wasted that can be used to hold data/code that is actually used.
>
> What I was warning you about is that if you shrink the array to the
> exact size, there might be other data that comes on the same cacheline,
> which might cause all kinds of interesting behavior (I think they call
> this false cache sharing or some such thing).

Ok, I understand your explanation, but I have a hard time seeing how false
cache sharing can be a bad thing.

If the cache sucks up a bunch of zeros that are never used, that's
definitely
wasted cache space.  How can that be any better than sucking up some real
data
that can be used?



--
Timur Tabi - ttabi@interactivesi.com
Interactive Silicon - http://www.interactivesi.com

When replying to a mailing-list message, please don't cc: me, because then
I'll just get two copies of the same message.
--
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.eu.org/Linux-MM/



--
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.eu.org/Linux-MM/

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2000-06-23 18:11 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-06-21 19:48 2.4: why is NR_GFPINDEX so large? Timur Tabi
2000-06-21 19:56 ` Kanoj Sarcar
2000-06-21 19:57   ` Timur Tabi
2000-06-21 20:23     ` Puppetmaster
2000-06-21 20:37       ` Timur Tabi
2000-06-21 20:37     ` Kanoj Sarcar
2000-06-21 20:41       ` Timur Tabi
2000-06-21 20:49         ` Kanoj Sarcar
2000-06-21 20:59           ` Timur Tabi
2000-06-21 21:10             ` Kanoj Sarcar
2000-06-21 21:28               ` Timur Tabi
2000-06-21 21:41                 ` Kanoj Sarcar
2000-06-21 21:43                   ` Timur Tabi
2000-06-22 19:26                 ` Andrea Arcangeli
2000-06-22 19:51                   ` Jamie Lokier
2000-06-23 17:41                     ` Andrea Arcangeli
2000-06-23 17:52                       ` Jamie Lokier
2000-06-23 18:02                         ` Andrea Arcangeli
2000-06-23 18:03                           ` Andrea Arcangeli
2000-06-22 20:22                   ` Kanoj Sarcar
2000-06-23 18:11                     ` Andrea Arcangeli
2000-06-21 21:22             ` James Manning
2000-06-21 21:24             ` Juan J. Quintela
2000-06-21 21:15 frankeh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox