All of lore.kernel.org
 help / color / mirror / Atom feed
From: Balbir Singh <balbir@linux.vnet.ibm.com>
To: Andi Kleen <andi@firstfloor.org>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>,
	akpm@osdl.org, torvalds@osdl.org, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org
Subject: Re: [PATCH] Document huge memory/cache overhead of memory controller in Kconfig
Date: Thu, 21 Feb 2008 16:33:33 +0530	[thread overview]
Message-ID: <47BD5A85.5010401@linux.vnet.ibm.com> (raw)
In-Reply-To: <47BD546B.1050504@firstfloor.org>

Andi Kleen wrote:
> Nick Piggin wrote:
>> On Wednesday 20 February 2008 23:52, Balbir Singh wrote:
>>> Andi Kleen wrote:
>>>> Document huge memory/cache overhead of memory controller in Kconfig
>>>>
>>>> I was a little surprised that 2.6.25-rc* increased struct page for the
>>>> memory controller.  At least on many x86-64 machines it will not fit into
>>>> a single cache line now anymore and also costs considerable amounts of
>>>> RAM.
>>> The size of struct page earlier was 56 bytes on x86_64 and with 64 bytes it
>>> won't fit into the cacheline anymore? Please also look at
>>> http://lwn.net/Articles/234974/
>> BTW. We'll probably want to increase the width of some counters
>> in struct page at some point for 64-bit, 
> 
> You mean change count to atomic64_t? Do you have real evidence
> the 32bit counter is a problem?
> 
>> so then it really will
>> go over with the memory controller!
> 
> Not sure how they are related? The count and the memory controller
> data would be always separate.
> 
> BTW if the memory controllers were limited in number it would
> be also possible on 64bit to encode them in the high bits of
> ->flags. I assume 16bit or so could be spared in there. Probably
> would not be enough though.
> 
>> Actually, an external data structure is a pretty good idea. We
>> could probably do it easily with a radix tree (pfn->memory
>> controller). And that might be a better option for distros.
> 
> I would think just a separate vmalloc()ed array for the counters
> would be easy enough. That array could be allocated the first time
> the memory controller is used (so making it zero cost for
> distribution kernels when it is not used at all) and then also on
> memory hotplug etc. If we assume most memory will be in
> memory controllers that is also more efficient (in terms of
> memory and of cache consumption) than any kind
> of tree.
> 
> Balbir mentioned one reason they didn't do that earlier was
> that they worried about the limited vmalloc space on 32bit,
> but I don't think that's a good reason against it. That is because
> vmalloc on 32bit is limited because of the limited direct
> mapped kernel memory, but increasing mem_map size eats that
> the same limited resource. So rather the 32bit vmalloc
> reservation can be just increased by the same amount as the
> mem_map increase would be (ok modulo hotplug, but that
> is difficult anyways on 32bit)
> 
> Another issue is that it will slightly increase TLB/cache
> cost of the memory controller, but I think that would be a fair
> trade off for it being zero cost when disabled but compiled
> in.
> 
> Doing it with vmalloc should be easy enough. I can do such
> a patch later unless someone beats me to it...
> 

I'll get to it, but I have too many things on my plate at the moment. KAMEZAWA
also wanted to look at it. I looked through some vmalloc() internals yesterday
and I am worried about allocating all the memory on a single node in a NUMA
system and changing VMALLOC_XXXX on every architecture to provide more vmalloc
space. I might be missing something obvious.



-- 
	Warm Regards,
	Balbir Singh
	Linux Technology Center
	IBM, ISTL

WARNING: multiple messages have this Message-ID (diff)
From: Balbir Singh <balbir@linux.vnet.ibm.com>
To: Andi Kleen <andi@firstfloor.org>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>,
	akpm@osdl.org, torvalds@osdl.org, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org
Subject: Re: [PATCH] Document huge memory/cache overhead of memory controller in Kconfig
Date: Thu, 21 Feb 2008 16:33:33 +0530	[thread overview]
Message-ID: <47BD5A85.5010401@linux.vnet.ibm.com> (raw)
In-Reply-To: <47BD546B.1050504@firstfloor.org>

Andi Kleen wrote:
> Nick Piggin wrote:
>> On Wednesday 20 February 2008 23:52, Balbir Singh wrote:
>>> Andi Kleen wrote:
>>>> Document huge memory/cache overhead of memory controller in Kconfig
>>>>
>>>> I was a little surprised that 2.6.25-rc* increased struct page for the
>>>> memory controller.  At least on many x86-64 machines it will not fit into
>>>> a single cache line now anymore and also costs considerable amounts of
>>>> RAM.
>>> The size of struct page earlier was 56 bytes on x86_64 and with 64 bytes it
>>> won't fit into the cacheline anymore? Please also look at
>>> http://lwn.net/Articles/234974/
>> BTW. We'll probably want to increase the width of some counters
>> in struct page at some point for 64-bit, 
> 
> You mean change count to atomic64_t? Do you have real evidence
> the 32bit counter is a problem?
> 
>> so then it really will
>> go over with the memory controller!
> 
> Not sure how they are related? The count and the memory controller
> data would be always separate.
> 
> BTW if the memory controllers were limited in number it would
> be also possible on 64bit to encode them in the high bits of
> ->flags. I assume 16bit or so could be spared in there. Probably
> would not be enough though.
> 
>> Actually, an external data structure is a pretty good idea. We
>> could probably do it easily with a radix tree (pfn->memory
>> controller). And that might be a better option for distros.
> 
> I would think just a separate vmalloc()ed array for the counters
> would be easy enough. That array could be allocated the first time
> the memory controller is used (so making it zero cost for
> distribution kernels when it is not used at all) and then also on
> memory hotplug etc. If we assume most memory will be in
> memory controllers that is also more efficient (in terms of
> memory and of cache consumption) than any kind
> of tree.
> 
> Balbir mentioned one reason they didn't do that earlier was
> that they worried about the limited vmalloc space on 32bit,
> but I don't think that's a good reason against it. That is because
> vmalloc on 32bit is limited because of the limited direct
> mapped kernel memory, but increasing mem_map size eats that
> the same limited resource. So rather the 32bit vmalloc
> reservation can be just increased by the same amount as the
> mem_map increase would be (ok modulo hotplug, but that
> is difficult anyways on 32bit)
> 
> Another issue is that it will slightly increase TLB/cache
> cost of the memory controller, but I think that would be a fair
> trade off for it being zero cost when disabled but compiled
> in.
> 
> Doing it with vmalloc should be easy enough. I can do such
> a patch later unless someone beats me to it...
> 

I'll get to it, but I have too many things on my plate at the moment. KAMEZAWA
also wanted to look at it. I looked through some vmalloc() internals yesterday
and I am worried about allocating all the memory on a single node in a NUMA
system and changing VMALLOC_XXXX on every architecture to provide more vmalloc
space. I might be missing something obvious.



-- 
	Warm Regards,
	Balbir Singh
	Linux Technology Center
	IBM, ISTL

--
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:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2008-02-21 11:09 UTC|newest]

Thread overview: 66+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-20 12:23 [PATCH] Document huge memory/cache overhead of memory controller in Kconfig Andi Kleen
2008-02-20 12:23 ` Andi Kleen
2008-02-20 12:52 ` Balbir Singh
2008-02-20 12:52   ` Balbir Singh
2008-02-20 15:00   ` John Stoffel
2008-02-20 15:00     ` John Stoffel
2008-02-20 15:20     ` Balbir Singh
2008-02-20 15:20       ` Balbir Singh
2008-02-20 15:49       ` Jan Engelhardt
2008-02-20 15:49         ` Jan Engelhardt
2008-02-20 16:10         ` John Stoffel
2008-02-20 16:10           ` John Stoffel
2008-02-20 16:15           ` Balbir Singh
2008-02-20 16:15             ` Balbir Singh
2008-02-20 17:00             ` Andi Kleen
2008-02-20 17:00               ` Andi Kleen
2008-02-21  6:49             ` KAMEZAWA Hiroyuki
2008-02-21  6:49               ` KAMEZAWA Hiroyuki
2008-02-21  6:52               ` Balbir Singh
2008-02-21  6:52                 ` Balbir Singh
2008-02-20 18:19         ` Pavel Machek
2008-02-20 18:19           ` Pavel Machek
2008-02-20 18:28           ` Jan Engelhardt
2008-02-20 18:28             ` Jan Engelhardt
2008-02-20 18:51             ` Pavel Machek
2008-02-20 18:51               ` Pavel Machek
2008-02-21 14:46               ` KOSAKI Motohiro
2008-02-21 14:46                 ` KOSAKI Motohiro
2008-02-21 14:52                 ` Balbir Singh
2008-02-21 14:52                   ` Balbir Singh
2008-02-21 23:55                 ` Pavel Machek
2008-02-21 23:55                   ` Pavel Machek
2008-02-22  3:09                   ` KOSAKI Motohiro
2008-02-22  3:09                     ` KOSAKI Motohiro
2008-02-20 16:15       ` John Stoffel
2008-02-20 16:15         ` John Stoffel
2008-02-20 16:54       ` Ray Lee
2008-02-20 16:54         ` Ray Lee
2008-02-20 16:57     ` Andi Kleen
2008-02-20 16:57       ` Andi Kleen
2008-02-21  4:35   ` Nick Piggin
2008-02-21  4:35     ` Nick Piggin
2008-02-21  5:06     ` Balbir Singh
2008-02-21  5:06       ` Balbir Singh
     [not found]       ` <200802211622.51751.nickpiggin@yahoo.com.au>
2008-02-21  5:46         ` Balbir Singh
2008-02-21  5:46           ` Balbir Singh
2008-02-21 10:44       ` Andi Kleen
2008-02-21 10:44         ` Andi Kleen
2008-02-22  4:41         ` Balbir Singh
2008-02-22  4:41           ` Balbir Singh
2008-02-22  9:51           ` Andi Kleen
2008-02-22  9:51             ` Andi Kleen
2008-02-22 12:14             ` Balbir Singh
2008-02-22 12:14               ` Balbir Singh
2008-02-22 13:00               ` Andi Kleen
2008-02-22 13:00                 ` Andi Kleen
2008-02-22 15:47                 ` Balbir Singh
2008-02-22 15:47                   ` Balbir Singh
2008-02-21 10:37     ` Andi Kleen
2008-02-21 10:37       ` Andi Kleen
2008-02-21 11:03       ` Balbir Singh [this message]
2008-02-21 11:03         ` Balbir Singh
2008-02-22  6:59         ` KAMEZAWA Hiroyuki
2008-02-22  6:59           ` KAMEZAWA Hiroyuki
2008-02-22  7:06           ` Balbir Singh
2008-02-22  7:06             ` Balbir Singh

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=47BD5A85.5010401@linux.vnet.ibm.com \
    --to=balbir@linux.vnet.ibm.com \
    --cc=akpm@osdl.org \
    --cc=andi@firstfloor.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=nickpiggin@yahoo.com.au \
    --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: link
Be 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.